Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update, general cleanup and overall improvements #35

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
d506024
updated to python 3, refactored code, added typehints
Apr 24, 2022
8a6cb18
removed test file
Apr 24, 2022
5a32898
updated to python 3, using beartype, overal cleanup and improvement.
May 1, 2022
cb7ef0c
added look arounds
May 2, 2022
0bd8d37
update readme
May 2, 2022
963c7b1
Create main.yml
rbroderi May 5, 2022
7234a88
fix missing typealias for python 3.8:
May 5, 2022
552c1d5
Merge branch 'master' of https://github.com/rbroderi/PythonVerbalExpr…
May 5, 2022
fa247a0
condense python version dependent imports
May 5, 2022
c74049a
condense python version dependent imports
May 5, 2022
c639670
Update main.yml
rbroderi May 5, 2022
1f461e5
Update main.yml
rbroderi May 5, 2022
d38fe3c
condense python version dependent imports
May 5, 2022
6e6163f
Merge branch 'master' of https://github.com/rbroderi/PythonVerbalExpr…
May 5, 2022
6f8f1c5
adding github actions badge
May 5, 2022
9f4a8e4
updated readme
May 5, 2022
09a59fc
Create GPL_LICENSE.txt
rbroderi May 8, 2022
8c8e673
change name and structure as fork
May 8, 2022
628509b
update name in init.py
May 8, 2022
eb3ce53
update name in init.py
May 8, 2022
d48c248
Update README.md
rbroderi May 8, 2022
ada781c
update setup.py
May 8, 2022
ccde2ac
Merge branch 'master' of https://github.com/rbroderi/PythonVerbalExpr…
May 8, 2022
9ddf7a8
update version to 1.0.1
May 8, 2022
ec5231f
push to pypi.org
May 8, 2022
2950a58
update setup.py python versions
May 8, 2022
b0f29e2
updated travis.yml with python versions
May 8, 2022
1298138
updated manifest.in
May 8, 2022
38360d2
added documentation
May 8, 2022
b150014
switch to pdoc from pdoc3
May 8, 2022
15b1fca
Set theme jekyll-theme-cayman
rbroderi May 8, 2022
3e71c04
Delete docs directory
rbroderi May 8, 2022
03f293e
add github pages
May 8, 2022
b7d2533
update readme
May 8, 2022
4bdd63a
update readme
May 8, 2022
66778e4
remove travis.yaml dependency
May 8, 2022
c9f4e51
remove travis.yaml dependency
May 8, 2022
7fd6e73
switch config around, using setup.cfg and, tox
May 8, 2022
ab9b9ac
adde pre-commit hooks and pyproject.toml
May 8, 2022
27383e4
adde pre-commit hooks and pyproject.toml
May 8, 2022
0befb31
fix gha
May 8, 2022
aa1811b
fix gha
May 8, 2022
a971431
fix gha
May 8, 2022
3e53366
fix gha
May 8, 2022
c3ee46d
fix gha
May 8, 2022
7d6f3e7
use poseur for older python versions
May 8, 2022
b576312
use poseur for older python versions
May 8, 2022
fed6933
use poseur for older python versions
May 8, 2022
d28af7a
use beartype protocol instead
May 8, 2022
013d258
use beartype protocol instead
May 8, 2022
5d8a468
us typing-extensions protocol if not in typing
May 8, 2022
f69a8f4
use runtime checkable from typing-extensions for version 3.7
May 8, 2022
395b2b6
push to pypi.org
May 8, 2022
82d2355
added auto doc generate pre-commit hook
May 8, 2022
2af09a0
added auto doc generate pre-commit hook
May 8, 2022
cb25f04
added auto doc generate pre-commit hook
May 8, 2022
f7efcf5
added auto doc generate pre-commit hook
May 8, 2022
38c6068
added auto doc generate pre-commit hook
May 8, 2022
f1d1caf
use importlib_metadata for python 3.7
May 8, 2022
a04e3ce
Update README.md
rbroderi May 8, 2022
8bcc875
Update README.md
rbroderi May 8, 2022
cc9a299
Update README.md
rbroderi May 9, 2022
161b921
Update README.md
rbroderi May 9, 2022
10145fd
Update README.md
rbroderi May 9, 2022
fa07e9c
add pycln
May 12, 2022
e55e48e
updated pre-commit tests
May 12, 2022
7f5b797
cleanup and move to new dev enviroment. Drop support for python versi…
Apr 28, 2024
1ce407a
cleanup and move to new dev enviroment. Drop support for python versi…
Apr 28, 2024
ff1d5a1
update readme
Apr 28, 2024
c898467
Update README.md
rbroderi Apr 28, 2024
9436a14
Update README.md
rbroderi Apr 28, 2024
3433381
Update gh_pages.yaml
rbroderi Apr 28, 2024
d40c1ee
update pypi workflow to publish
Apr 28, 2024
18c63ac
bump version
Apr 28, 2024
b8c4fca
add classifiers
Apr 28, 2024
75e672f
Rename LICENSE.txt to LICENSE
rbroderi Apr 28, 2024
df0e0e3
Update README.md
rbroderi Apr 28, 2024
40b0bba
Update LICENSE
rbroderi Apr 28, 2024
209b469
Update README.md
rbroderi Apr 28, 2024
429f9b6
Update README.md
rbroderi Apr 28, 2024
a71bedc
Update README.md
rbroderi Apr 28, 2024
214583f
Update README.md
rbroderi Apr 28, 2024
f2088f9
Update README.md
rbroderi Apr 28, 2024
1cf8876
Update README.md
rbroderi Apr 28, 2024
ff4b462
Update README.md
rbroderi Apr 28, 2024
90e4d49
Update README.md
rbroderi Apr 28, 2024
c0d2172
Update README.md
rbroderi Apr 28, 2024
63f2027
Update README.md
rbroderi Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# .gitattributes snippet to force users to use same line endings for project.
#
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

#
# The above will handle all files NOT found below
# https://help.github.com/articles/dealing-with-line-endings/
# https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes



# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
*.js text
*.json text
*.htm text
*.html text
*.xml text
*.txt text
*.ini text
*.inc text
*.pl text
*.rb text
*.py text
*.scm text
*.sql text
.htaccess text
*.sh text

# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.pyc binary
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This is a basic workflow to help you get started with Actions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove all the comments. When people don't understand the file, they should look at the GH documentation.


name: CI

# Controls when the workflow will run
on: # yamllint disable-line rule:truthy
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
pull_request:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow pushes/pr to all branches. Enough capacity to check everything.

Suggested change
on: # yamllint disable-line rule:truthy
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extend to use 3.11 too

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use v4

with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to update pip

pip install tox tox-gh-actions
- name: Run tests
run: tox -v
25 changes: 20 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
venv
dist
build
*.py[co]
*.egg-info
__pycache__/
build/
.vscode/
.tox/
eggs/
.eggs/
*.egg-info/
~*
.mypy_cache/
.pspp
.cache/
.viminfo
.idea/
desktop.ini
.gitconfig
.recommenders
.metadata/
.venv/
venv/
__pycache__/
236 changes: 231 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,233 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

minimum_pre_commit_version: 1.21.0
repos:
- repo: https://github.com/ambv/black
rev: stable
- repo: meta
hooks:
- id: black
args: [--line-length=79]
language_version: python3.6
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
types: [file, text]
exclude_types: [html, javascript]
- id: end-of-file-fixer
types: [file, text]
exclude_types: [html, javascript]
- id: check-case-conflict
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-merge-conflict
name: "Check for merge conflicts"
- id: check-yaml
name: "Yaml: Check files"
types: [file, yaml]
- id: check-toml
name: "TOML: check toml syntax"
types: [file, toml]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.3
hooks:
- id: check-github-workflows
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.3 # or higher tag
hooks:
- id: yamllint
name: "Yaml: Linting files"
args: [--format, parsable, --strict]
types: [file, yaml]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
hooks:
- id: remove-tabs
name: "Python: Convert Tabs to 4 spaces"
args: ['--whitespaces-count', '4'] # defaults to: 4
types: [file, python]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
name: "Python: Formating files"
args: [--line-length=88, --preview, --safe]
types: [file, python]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
name: "Python: upgrade syntax"
args: [--py37-plus]
- repo: https://github.com/hadialqattan/pycln
rev: v1.3.2
hooks:
- id: pycln
name: "Python: remove unused imports."
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
name: "Python: Formating code in docstrings"
additional_dependencies: [black==22.3]
types: [file, python]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: "Python: Sorting imports"
types: [file, python]
args:
- "--multi-line=3" # makes this compatible with add-trailing-comma
- "--trailing-comma" # makes this compatible with add-trailing-comma
- "--profile"
- "black"
- repo: local
hooks:
- id: python_file_name_check
name: "Python: File name check"
entry: "python ./check_names.py"
language: python
pass_filenames: true
types: [file, python]
verbose: false
- repo: https://github.com/pycqa/flake8
rev: '4.0.1' # old 4.0.1 seem to freeze?
hooks:
- id: flake8
name: "Python: Linting files (flake8)"
args: # arguments to configure flake8
# making isort line length compatible with black
- "--max-line-length=88"
- "--max-complexity=18"
- "--kwargs-max-positional-arguments=4"
# allowing these errors now that in the past we ignored.
# D100 Missing docstring in public module
# D103 Missing docstring in public function
# D104 Missing docstring in public package
# D105 Missing docstring in magic method
# D107 Missing docstring in __init__
# D200 One-line docstring should fit on one line with quotes
# D205 1 blank line required between summary line and description
# D400 First line should end with a period
# D401 First line should be in imperative mood
# D403 First word of the first line should be properly capitalized
# these are errors that will be ignored by flake8
# VNE002 variable name 'XXX' should be clarified
# W503 see https://www.flake8rules.com/rules/W503.html no longer best practice
# - "--ignore=VNE002,W503"
# removed cohesion as it was causing issues with enum type classes
# E203 spaces around ':' ignoring per https://github.com/psf/black/issues/315
# PD005 and PD011 falsely flag on other add or values methods
- "--ignore=W503,E203, PD005, PD011"
# when checking with wemake - "--ignore=W503,E203, PD005, PD011, WPS226, WPS112, WPS204, Q000, WPS421, WPS305, WPS237, WPS529, E800, C812, WPS110, WPS360, WPS323"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all these comments

additional_dependencies:
- flake8-blind-except
- flake8-assert-msg
- flake8-builtins
- flake8-docstrings
- flake8-implicit-str-concat
- flake8-mock
- flake8-variables-names
- pep8-naming
- flake8-bugbear
- flake8-executable
- flake8-raise
- flake8-pytest
- flake8-use-pathlib
- flake8-string-format
- flake8-colors
- flake8-tuple
- pandas-vet
- flake8-length
- flake8-assertive
- flake8-warnings
- flake8-comprehensions
- flake8-simplify
- flake8-noqa
- flake8-force-keyword-arguments
exclude: "setup[.]py|conf[.]py|__init__[.]py"
types: [file, python]
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
hooks:
- id: add-trailing-comma
name: "Python: Add trailing comma"
args: [--py36-plus]
types: [file, python]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.950'
hooks:
- id: mypy
name: "Python: Checking variable types"
args: [--ignore-missing-imports, --allow-redefinition]
exclude: "setup[.]py|conf[.]py"
additional_dependencies:
- pydantic
- types-all
- pandas-stubs
types: [file, python]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.4'
hooks:
- id: bandit
name: "Python: Checking for potential security issues (bandit)"
args:
- "--skip=B404,B506,B607,B603,B701,B101,B602"
- repo: https://github.com/jazzband/pip-tools
rev: 6.6.0
hooks:
- id: pip-compile
name: "Python: Compile any requirements.in to requirements.txt"
args: [--quiet, --no-allow-unsafe, requirements.in]
files: requirements[.]in
- id: pip-compile
name: "Python: Compile any requirements_dev.in to requirements_dev.txt"
args: [--quiet, --no-allow-unsafe, requirements_dev.in]
files: requirements_dev[.]in
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.2.4
hooks:
- id: python-safety-dependencies-check
name: "Python: Checking requirements.txt files for vulnerablitites"
always_run: true
files: requirements.txt
args: [requirements.txt]
- id: python-safety-dependencies-check
name: "Python: Checking requirements_dev.txt files for vulnerablitites"
always_run: true
files: requirements_dev.txt
args: [requirements_dev.txt]
- repo: local
hooks:
- id: remove-en-dashes
name: Remove the EXTREMELY confusing unicode character U+2013
language: system
entry: perl -pi* -e 's/\xe2\x80\x93/-/g && ($t = 1) && print STDERR $_; END{{exit $t}}'
types: [file]
types_or: [python, powershell, lua, jinja]
- repo: https://github.com/sirosen/texthooks
rev: 0.3.1
hooks:
- id: fix-smartquotes
types: [file]
types_or: [python, powershell, lua, jinja]
- id: fix-ligatures
types: [file]
types_or: [python, powershell, lua, jinja]
- id: forbid-bidi-controls
types: [file]
types_or: [python, powershell, lua, jinja]
- repo: local
hooks:
- id: pdoc
name: "Generate Documentation"
description: 'Auto generating documentation with PDOC'
entry: pdoc
args: [verbex, -o, docs]
language: python
language_version: python3
require_serial: true
types: [python]
pass_filenames: false
additional_dependencies:
- beartype
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"cSpell.words": [
"pylance",
"pyright",
"Verbex"
],
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--ignore=E501"
]
}
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: default
rules:
comments-indentation: disable
document-start: disable
new-lines: disable
line-length: disable
Loading