From 9c1cf3687c2188d09ab46be7b14004ce642492e5 Mon Sep 17 00:00:00 2001 From: Danny Guinther Date: Thu, 4 Apr 2024 17:48:25 -0400 Subject: [PATCH] Move flake8 config to pyproject.toml and replace pytest-watch with pytest-watcher --- .pre-commit-config.yaml | 4 +-- pyproject.toml | 17 +++++---- requirements.txt | 10 ++---- .../application/entry_point_spec.py | 4 +-- setup.cfg | 4 --- setup.py | 35 ++++++++++--------- 6 files changed, 36 insertions(+), 38 deletions(-) delete mode 100644 setup.cfg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72610c1..c82d361 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,12 +11,12 @@ repos: name: black language: system entry: black - args: ["service_oriented", "service_oriented_test"] + args: ["--preview"] types: [python] - id: flake8 name: flake8 language: python - entry: flake8 + entry: flake8p args: ["service_oriented", "service_oriented_test"] types: [python] additional_dependencies: diff --git a/pyproject.toml b/pyproject.toml index d7d05f4..964f56c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,16 @@ [build-system] -requires = ["setuptools>=69"] build-backend = "setuptools.build_meta" - -[tool.pytest.ini_options] -markers = ["integration_test: marks tests as integration tests (deselect with '-m \"not integration_test\")"] +requires = ["setuptools>=69"] [tool.black] +include = "service_oriented(_test)?/.*\\.py$" line-length = 88 target-version = ["py39"] -include = "service_oriented(_test)?/.*\\.py$" + +[tool.flake8] +ignore = ["E203", "E251", "E701", "N805", "W503", "DAR101", "DAR201", "DAR301", "DAR401"] +max-line-length = 88 +min_python_version = "3.10.0" [tool.isort] include_trailing_comma = true @@ -17,7 +19,7 @@ line_length = 88 lines_after_imports = 2 multi_line_output = 3 profile = "black" -sections = ["FUTURE","STDLIB","THIRDPARTY","FIRSTPARTY","LOCALFOLDER"] +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] use_parentheses = true [tool.mypy] @@ -33,3 +35,6 @@ warn_unused_ignores = true [tool.pydantic-mypy] init_forbid_extra = true + +[tool.pytest.ini_options] +markers = ["integration_test: marks tests as integration tests (deselect with '-m \"not integration_test\"')"] diff --git a/requirements.txt b/requirements.txt index f00bb6f..86c3974 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,20 +1,17 @@ annotated-types==0.6.0 -appdirs==1.4.4 attrs==23.2.0 -black==23.12.1 +black==24.2.0 build==1.0.3 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 charset-normalizer==3.3.2 click==8.1.7 -colorama==0.4.6 coverage==7.4.4 coverage-badge==1.1.0 cryptography==42.0.5 distlib==0.3.8 dlint==0.14.1 -docopt==0.6.2 docutils==0.20.1 dparse==0.6.3 eradicate==2.3.0 @@ -23,6 +20,7 @@ filelock==3.13.1 flake8==7.0.0 flake8-comprehensions==3.14.0 flake8-eradicate==1.5.0 +Flake8-pyproject==1.2.3 flake8-spellcheck==0.28.0 flake8-typing-imports==1.15.0 identify==2.5.33 @@ -55,16 +53,14 @@ pydantic-settings==2.1.0 pydantic_core==2.14.6 pyflakes==3.2.0 Pygments==2.17.2 -pyparsing==3.1.1 pyproject_hooks==1.0.0 pytest==7.4.4 pytest-mock==3.12.0 -pytest-watch==4.2.0 +pytest-watcher==0.4.2 python-dotenv==1.0.0 python-json-logger==2.0.7 PyYAML==6.0.1 readme-renderer==42.0 -regex==2023.12.25 requests==2.31.0 requests-toolbelt==1.0.0 rfc3986==2.0.0 diff --git a/service_oriented/application/entry_point_spec.py b/service_oriented/application/entry_point_spec.py index ce9a066..f2e2b4b 100644 --- a/service_oriented/application/entry_point_spec.py +++ b/service_oriented/application/entry_point_spec.py @@ -16,10 +16,10 @@ class _EntryPointClass(Protocol[P]): def __init__(self, config: C, *args: P.args, **kwargs: P.kwargs) -> None: - ... # pragma: no cover + pass # pragma: no cover def run(self) -> None: - ... # pragma: no cover + pass # pragma: no cover class EntryPointSpec: diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7de3ed0..0000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -ignore = E203, E251, E701, N805, W503, DAR101, DAR201, DAR301, DAR401 -max-line-length = 88 -min_python_version = 3.9 diff --git a/setup.py b/setup.py index df8e90b..3a5046b 100644 --- a/setup.py +++ b/setup.py @@ -10,32 +10,33 @@ VERSION = f.read().strip() _dependencies = [ - "PyYaml~=6.0.1", "pydantic-settings~=2.1.0", "pydantic~=2.5.3", "python-json-logger==2.0.7", + "pyyaml~=6.0.1", ] _dev_dependencies = [ - "black~=23.12.1", - "build==1.0.3", - "coverage==7.4.4", - "coverage-badge==1.1.0", - "dlint==0.14.1", - "flake8-comprehensions==3.14.0", - "flake8-eradicate==1.5.0", - "flake8-spellcheck==0.28.0", - "flake8-typing-imports==1.15.0", - "flake8==7.0.0", - "isort==5.13.2", + "black~=24.2.0", + "build~=1.0.3", + "coverage-badge~=1.1.0", + "coverage~=7.4.4", + "dlint~=0.14.1", + "flake8-comprehensions~=3.14.0", + "flake8-eradicate~=1.5.0", + "flake8-pyproject~=1.2.3", + "flake8-spellcheck~=0.28.0", + "flake8-typing-imports~=1.15.0", + "flake8~=7.0.0", + "isort~=5.13.2", "mypy~=1.8.0", - "pep8-naming==0.13.3", - "pre-commit==3.6.0", + "pep8-naming~=0.13.3", + "pre-commit~=3.6.0", "pytest-mock~=3.12.0", - "pytest-watch~=4.2.0", + "pytest-watcher~=0.4.2", "pytest~=7.4.0", - "safety==2.3.4", - "twine==4.0.2", + "safety~=2.3.4", + "twine~=4.0.2", "wheel>=0.42.0", ]