-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor package setup - drop setup.py & setup.cfg - use pyproject.toml - remove deprecated config code * use bump-my-version for releases bump2version being deprecated, bump-my-version is a maintained fork. * improve git & lint workflows - add pre-commit - use black, ruff & mypy via pre-commit - fix some lint issues catched by ruff * refactor dev workflows - drop scripts folder - add Makefile - add dev optional dependency - remove all requirements files - generate new requirements-dev.txt * add pre-commit hooks - debug-statements - vulture (and drop RUF100 * restrict scopes of github workflows * refactor dev workflows - only hard-pin test dependencies - add/update/drop Makefile recipes - adapt github workflows
- Loading branch information
1 parent
38e5c15
commit 1db6781
Showing
40 changed files
with
520 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,9 @@ output/*/index.html | |
# pytest | ||
.pytest_cache | ||
|
||
# ruff | ||
.ruff_cache | ||
|
||
# tmp files | ||
/tmp/ | ||
/*.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
# - id: trailing-whitespace # TODO: enable this | ||
# - id: end-of-file-fixer # TODO: enable this | ||
- id: debug-statements | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
args: ["--target-version", "py38"] | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 'v0.0.290' | ||
hooks: | ||
- id: ruff | ||
args: ["--fix"] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.5.1 | ||
hooks: | ||
- id: mypy | ||
types: [python] | ||
args: [] # TODO: enable this: "--check-untyped-defs" | ||
# TODO: narrow tests exclusion down to: ^tests/testdata/typing/*$ | ||
exclude: | | ||
(?x)^( | ||
.vulture.py| | ||
tests/.* | ||
)$ | ||
additional_dependencies: [ | ||
pydantic==1.*, | ||
types-python-dateutil, | ||
types-requests, | ||
types-urllib3, | ||
types-redis, | ||
types-cachetools, | ||
types-tabulate | ||
] | ||
|
||
- repo: https://github.com/jendrikseipp/vulture | ||
rev: v2.9.1 | ||
hooks: | ||
- id: vulture | ||
args: ["--min-confidence", "90", "modelkit", "bin", ".vulture.py"] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude tests * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
SHELL := /bin/bash | ||
.SHELLFLAGS := -e -x -c -o pipefail | ||
.PHONY: setup setup_lint lint tests coverage ci_tests requirements upgrade | ||
|
||
setup_lint: | ||
pip install --upgrade pip pre-commit | ||
pre-commit install | ||
|
||
lint: | ||
pre-commit run --all-files | ||
|
||
tests: | ||
export ENABLE_TF_SERVING_TEST=True; \ | ||
export ENABLE_TF_TEST=True; \ | ||
export ENABLE_REDIS_TEST=True; \ | ||
export ENABLE_S3_TEST=True; \ | ||
export ENABLE_GCS_TEST=True; \ | ||
export ENABLE_AZ_TEST=True; \ | ||
pytest | ||
|
||
coverage: | ||
export ENABLE_TF_SERVING_TEST=True; \ | ||
export ENABLE_TF_TEST=True; \ | ||
export ENABLE_REDIS_TEST=True; \ | ||
export ENABLE_S3_TEST=True; \ | ||
export ENABLE_GCS_TEST=True; \ | ||
export ENABLE_AZ_TEST=True; \ | ||
coverage run -m pytest; \ | ||
coverage report -m; \ | ||
coverage xml | ||
|
||
setup: | ||
pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
pip install -e .[lint,tensorflow,cli,api,assets-s3,assets-gcs,assets-az] | ||
pre-commit install | ||
|
||
ci_tests: | ||
pip install --upgrade pip nox | ||
@if [ "$(OS_NAME)" = "ubuntu-latest" ]; then \ | ||
export ENABLE_TF_SERVING_TEST=True; \ | ||
export ENABLE_TF_TEST=True; \ | ||
export ENABLE_REDIS_TEST=True; \ | ||
export ENABLE_S3_TEST=True; \ | ||
export ENABLE_GCS_TEST=True; \ | ||
export ENABLE_AZ_TEST=True; \ | ||
nox --error-on-missing-interpreters -s "coverage-$(PYTHON_VERSION)"; \ | ||
else \ | ||
nox --error-on-missing-interpreters -s "tests-$(PYTHON_VERSION)"; \ | ||
fi | ||
|
||
requirements: | ||
pip install --upgrade pip pip-compile | ||
pip-compile --extra=dev --output-file=requirements-dev.txt | ||
|
||
upgrade: | ||
pip install --upgrade pip pip-tools pre-commit | ||
pre-commit autoupdate | ||
pip-compile --upgrade --extra=dev --output-file=requirements-dev.txt | ||
pip install -r requirements-dev.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.