diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index f9074e6..c977d7b 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r dev_requirements/requirements-formatting.txt + pip install .[formatting] - name: ${{ matrix.tool }} Code Formatter run: | ${{ matrix.tool }} . --check diff --git a/dev_requirements/requirements-coverage.in b/dev_requirements/requirements-coverage.in deleted file mode 100644 index d1e1a80..0000000 --- a/dev_requirements/requirements-coverage.in +++ /dev/null @@ -1,2 +0,0 @@ -# specific requirements for the tox coverage env -coverage diff --git a/dev_requirements/requirements-coverage.txt b/dev_requirements/requirements-coverage.txt deleted file mode 100644 index c481bea..0000000 --- a/dev_requirements/requirements-coverage.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SHA1:6dafbcf610e9f81897b65ee9142715ab2e793f9e -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# -coverage==7.6.1 - # via -r dev_requirements/requirements-coverage.in diff --git a/dev_requirements/requirements-formatting.in b/dev_requirements/requirements-formatting.in deleted file mode 100644 index 41e6b86..0000000 --- a/dev_requirements/requirements-formatting.in +++ /dev/null @@ -1,3 +0,0 @@ -# specific requirements for the formatting envs -black -isort diff --git a/dev_requirements/requirements-formatting.txt b/dev_requirements/requirements-formatting.txt deleted file mode 100644 index ed1a620..0000000 --- a/dev_requirements/requirements-formatting.txt +++ /dev/null @@ -1,21 +0,0 @@ -# SHA1:2c7ffcd29222de3114c7f7994911f1b69d06b6b3 -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# -black==24.8.0 - # via -r dev_requirements/requirements-formatting.in -click==8.1.7 - # via black -isort==5.13.2 - # via -r dev_requirements/requirements-formatting.in -mypy-extensions==1.0.0 - # via black -packaging==24.0 - # via black -pathspec==0.12.1 - # via black -platformdirs==4.2.1 - # via black diff --git a/dev_requirements/requirements-linting.in b/dev_requirements/requirements-linting.in deleted file mode 100644 index 787ac85..0000000 --- a/dev_requirements/requirements-linting.in +++ /dev/null @@ -1,2 +0,0 @@ -# specific requirements for the tox linting env -pylint diff --git a/dev_requirements/requirements-linting.txt b/dev_requirements/requirements-linting.txt deleted file mode 100644 index c52f9ed..0000000 --- a/dev_requirements/requirements-linting.txt +++ /dev/null @@ -1,21 +0,0 @@ -# SHA1:0e15f8789b9d62fe90d1f1b0b6a7e32f13b99b19 -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# -astroid==3.2.4 - # via pylint -dill==0.3.8 - # via pylint -isort==5.13.2 - # via pylint -mccabe==0.7.0 - # via pylint -platformdirs==4.2.1 - # via pylint -pylint==3.2.7 - # via -r dev_requirements/requirements-linting.in -tomlkit==0.12.4 - # via pylint diff --git a/dev_requirements/requirements-packaging.in b/dev_requirements/requirements-packaging.in deleted file mode 100644 index 3aad7fa..0000000 --- a/dev_requirements/requirements-packaging.in +++ /dev/null @@ -1,3 +0,0 @@ -# requirements for the hatchling build ssystem -build -twine diff --git a/dev_requirements/requirements-packaging.txt b/dev_requirements/requirements-packaging.txt deleted file mode 100644 index 2fe2ffc..0000000 --- a/dev_requirements/requirements-packaging.txt +++ /dev/null @@ -1,79 +0,0 @@ -# SHA1:93e4fbf2b6cce1574fe3d5315360512fa9927699 -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# -build==1.2.1 - # via -r dev_requirements/requirements-packaging.in -certifi==2024.2.2 - # via requests -cffi==1.16.0 - # via cryptography -charset-normalizer==3.3.2 - # via requests -cryptography==42.0.7 - # via secretstorage -docutils==0.21.2 - # via readme-renderer -idna==3.7 - # via requests -importlib-metadata==7.1.0 - # via twine -jaraco-classes==3.4.0 - # via keyring -jaraco-context==5.3.0 - # via keyring -jaraco-functools==4.0.1 - # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage -keyring==25.2.0 - # via twine -markdown-it-py==3.0.0 - # via rich -mdurl==0.1.2 - # via markdown-it-py -more-itertools==10.2.0 - # via - # jaraco-classes - # jaraco-functools -nh3==0.2.17 - # via readme-renderer -packaging==24.0 - # via build -pkginfo==1.10.0 - # via twine -pycparser==2.22 - # via cffi -pygments==2.17.2 - # via - # readme-renderer - # rich -pyproject-hooks==1.1.0 - # via build -readme-renderer==43.0 - # via twine -requests==2.31.0 - # via - # requests-toolbelt - # twine -requests-toolbelt==1.0.0 - # via twine -rfc3986==2.0.0 - # via twine -rich==13.7.1 - # via twine -secretstorage==3.3.3 - # via keyring -twine==5.1.1 - # via -r dev_requirements/requirements-packaging.in -urllib3==2.2.1 - # via - # requests - # twine -zipp==3.18.1 - # via importlib-metadata diff --git a/dev_requirements/requirements-spell_check.in b/dev_requirements/requirements-spell_check.in deleted file mode 100644 index e3da9e4..0000000 --- a/dev_requirements/requirements-spell_check.in +++ /dev/null @@ -1 +0,0 @@ -codespell diff --git a/dev_requirements/requirements-spell_check.txt b/dev_requirements/requirements-spell_check.txt deleted file mode 100644 index 5f6029e..0000000 --- a/dev_requirements/requirements-spell_check.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SHA1:a7062511e9640ed2a5c2dea1da5c8b5f59c0f0d7 -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# -codespell==2.3.0 - # via -r dev_requirements/requirements-spell_check.in diff --git a/dev_requirements/requirements-tests.in b/dev_requirements/requirements-tests.in deleted file mode 100644 index 5497961..0000000 --- a/dev_requirements/requirements-tests.in +++ /dev/null @@ -1,2 +0,0 @@ -# specific requirements for the tox tests env -pytest diff --git a/dev_requirements/requirements-tests.txt b/dev_requirements/requirements-tests.txt deleted file mode 100644 index c30b3ef..0000000 --- a/dev_requirements/requirements-tests.txt +++ /dev/null @@ -1,15 +0,0 @@ -# SHA1:0eaa389e1fdb3a1917c0f987514bd561be5718ee -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# -iniconfig==2.0.0 - # via pytest -packaging==24.0 - # via pytest -pluggy==1.5.0 - # via pytest -pytest==8.3.2 - # via -r dev_requirements/requirements-tests.in diff --git a/dev_requirements/requirements-type_check.in b/dev_requirements/requirements-type_check.in deleted file mode 100644 index 4446a91..0000000 --- a/dev_requirements/requirements-type_check.in +++ /dev/null @@ -1,2 +0,0 @@ -# specific requirements for the tox type_check environment -mypy diff --git a/dev_requirements/requirements-type_check.txt b/dev_requirements/requirements-type_check.txt deleted file mode 100644 index b64d0e7..0000000 --- a/dev_requirements/requirements-type_check.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile requirements-type_check.in -# -mypy==1.11.2 - # via -r dev_requirements/requirements-type_check.in -mypy-extensions==1.0.0 - # via mypy -typing-extensions==4.12.2 - # via mypy diff --git a/pyproject.toml b/pyproject.toml index 7522b7b..59a8dd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,15 @@ dependencies = [ ] dynamic = ["readme", "version"] +[project.optional-dependencies] +coverage = ["coverage==7.6.1"] +formatting = ["black==24.8.0", "isort==5.13.2"] +linting = ["pylint==3.2.6"] +spellcheck = ["codespell==2.3.0"] +test_packaging = ["build==1.2.1", "twine==5.1.1"] +tests = ["pytest==8.3.2"] +type_check = ["mypy==1.11.2"] + [project.urls] Changelog = "https://github.com/Hochfrequenz/python_template_repository/releases" Homepage = "https://github.com/Hochfrequenz/python_template_repository" diff --git a/tox.ini b/tox.ini index 22ce83a..a19d3f4 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ commands = python -m pip install --upgrade pip # the tests environment is called by the Github action that runs the unit tests deps = -r requirements.txt - -r dev_requirements/requirements-tests.txt + .[tests] setenv = PYTHONPATH = {toxinidir}/src commands = python -m pytest --basetemp={envtmpdir} {posargs} @@ -22,7 +22,7 @@ commands = python -m pytest --basetemp={envtmpdir} {posargs} # the linting environment is called by the Github Action that runs the linter deps = {[testenv:tests]deps} - -r dev_requirements/requirements-linting.txt + .[linting] # add your fixtures like e.g. pytest_datafiles here setenv = PYTHONPATH = {toxinidir}/src commands = @@ -35,7 +35,7 @@ commands = setenv = PYTHONPATH = {toxinidir}/src deps = {[testenv:tests]deps} - -r dev_requirements/requirements-type_check.txt + .[type_check] commands = mypy --show-error-codes src/ebd_toolchain --strict mypy --show-error-codes unittests --strict @@ -46,7 +46,7 @@ commands = setenv = PYTHONPATH = {toxinidir}/src deps = -r requirements.txt - -r dev_requirements/requirements-spell_check.txt + .[spellcheck] commands = codespell --ignore-words=domain-specific-terms.txt src codespell --ignore-words=domain-specific-terms.txt README.md @@ -57,7 +57,7 @@ commands = changedir = unittests deps = {[testenv:tests]deps} - -r dev_requirements/requirements-coverage.txt + .[coverage] setenv = PYTHONPATH = {toxinidir}/src commands = coverage run -m pytest --basetemp={envtmpdir} {posargs} @@ -78,7 +78,7 @@ deps = {[testenv:type_check]deps} {[testenv:coverage]deps} {[testenv:spell_check]deps} - -r dev_requirements/requirements-formatting.txt + .[formatting] pip-tools pre-commit commands = @@ -90,7 +90,7 @@ commands = [testenv:test_packaging] skip_install = true deps = - -r dev_requirements/requirements-packaging.txt + .[test_packaging] commands = python -m build twine check dist/*