Skip to content

Commit

Permalink
Move optional dependencies from dev_requirements to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyFox892 committed Sep 24, 2024
1 parent 110d273 commit e36d3a4
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 221 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements/requirements-packaging.txt
pip install .[test_packaging]
- name: Build wheel and source distributions
run: |
python -m build
Expand Down
2 changes: 0 additions & 2 deletions dev_requirements/requirements-coverage.in

This file was deleted.

8 changes: 0 additions & 8 deletions dev_requirements/requirements-coverage.txt

This file was deleted.

10 changes: 0 additions & 10 deletions dev_requirements/requirements-extra-aiostream.txt

This file was deleted.

3 changes: 0 additions & 3 deletions dev_requirements/requirements-formatting.in

This file was deleted.

24 changes: 0 additions & 24 deletions dev_requirements/requirements-formatting.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dev_requirements/requirements-linting.in

This file was deleted.

24 changes: 0 additions & 24 deletions dev_requirements/requirements-linting.txt

This file was deleted.

3 changes: 0 additions & 3 deletions dev_requirements/requirements-packaging.in

This file was deleted.

78 changes: 0 additions & 78 deletions dev_requirements/requirements-packaging.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev_requirements/requirements-spell_check.in

This file was deleted.

8 changes: 0 additions & 8 deletions dev_requirements/requirements-spell_check.txt

This file was deleted.

3 changes: 0 additions & 3 deletions dev_requirements/requirements-tests.in

This file was deleted.

22 changes: 0 additions & 22 deletions dev_requirements/requirements-tests.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dev_requirements/requirements-type_check.in

This file was deleted.

14 changes: 0 additions & 14 deletions dev_requirements/requirements-type_check.txt

This file was deleted.

29 changes: 28 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,34 @@ dependencies = [] # add all the dependencies here
dynamic = ["readme", "version"]

[project.optional-dependencies]
aiostream = ["aiostream"]
aiostream = [
"aiostream==0.5.2",
"typing-extensions==4.12.1"
]
coverage = [
"coverage==7.6.1"
]
formatting = [
"black==24.8.0",
"isort==5.13.2"
]
linting = [
"pylint==3.3.0"
]
spellcheck = [
"codespell==2.3.0"
]
test_packaging = [
"build==1.2.2",
"twine==5.1.1"
]
tests = [
"pytest==8.3.3",
"pytest-asyncio==0.24.0"
]
type_check = [
"mypy==1.11.2"
]

[project.urls]
Changelog = "https://github.com/Hochfrequenz/seviper/releases"
Expand Down
22 changes: 8 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ 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
-r dev_requirements/requirements-extra-aiostream.txt
.[tests]
.[aiostream]
setenv = PYTHONPATH = {toxinidir}/src
commands = python -m pytest --basetemp={envtmpdir} {posargs}

[testenv:linting]
# 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 =
Expand All @@ -36,7 +36,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/error_handler
mypy --show-error-codes unittests
Expand All @@ -47,7 +47,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
Expand All @@ -58,19 +58,13 @@ 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}
coverage html --omit .tox/*,unittests/*
coverage report --fail-under 90 --omit .tox/*,unittests/*

[testenv:compile_requirements]
deps =
pip-compile-multi
commands =
pip-compile-multi -d dev_requirements --autoresolve

[testenv:dev]
# the dev environment contains everything you need to start developing on your local machine.
deps =
Expand All @@ -79,7 +73,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 =
Expand All @@ -93,7 +87,7 @@ commands =
[testenv:test_packaging]
skip_install = true
deps =
-r dev_requirements/requirements-packaging.txt
.[test_packaging]
commands =
python -m build
twine check dist/*

0 comments on commit e36d3a4

Please sign in to comment.