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

Move optional dependencies from dev_requirements to pyproject.toml #118

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
8 changes: 6 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:

build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.12" ]
os: [ ubuntu-latest ]
# Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
# you have to create an environment in your repository settings and add the environment name here
environment: release
Expand All @@ -52,7 +56,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements/requirements-packaging.txt
pip install .[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.

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.

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

This file was deleted.

40 changes: 0 additions & 40 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.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,35 @@ dependencies = [
] # add all the dependencies here
dynamic = ["readme", "version"]

[project.optional-dependencies]
coverage = [
"coverage==7.6.0"
]
formatting = [
"black==24.8.0",
"isort==5.13.2"
]
linting = [
"pylint==3.2.6",
"pylint-pydantic==0.3.2"
]
packaging = [
"build==1.2.1",
"twine==5.1.1"
]
spellcheck = [
"codespell==2.3.0"
]
tests = [
"aioresponses==0.7.6",
"pytest==8.3.2",
"pytest-asyncio==0.23.8"
]
type_check = [
"mypy[pydantic]==1.8.0",
"types-pytz==2024.1.0.20240203"
]

[project.urls]
Changelog = "https://github.com/Hochfrequenz/tmdsclient.py/releases"
Homepage = "https://github.com/Hochfrequenz/tmdsclient.py"
Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ 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}

[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 @@ -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/tmdsclient
mypy --show-error-codes unittests
Expand All @@ -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
Expand All @@ -58,7 +58,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}
Expand All @@ -74,7 +74,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 @@ -86,7 +86,7 @@ commands =
[testenv:test_packaging]
skip_install = true
deps =
-r dev_requirements/requirements-packaging.txt
.[packaging]
commands =
python -m build
twine check dist/*