Skip to content

Commit ab418ec

Browse files
committed
Move optional dependencies from dev_requirements to pyproject.toml
1 parent 15bdd34 commit ab418ec

18 files changed

+50
-190
lines changed

.github/workflows/formatting.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
pip install -r dev_requirements/requirements-formatting.txt
21+
pip install .[formatting]
2222
- name: ${{ matrix.tool }} Code Formatter
2323
run: |
2424
${{ matrix.tool }} . --check

.github/workflows/python-publish.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ jobs:
5151
5252
build-n-publish:
5353
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
54-
runs-on: ubuntu-latest
54+
runs-on: ${{ matrix.os }}
55+
strategy:
56+
matrix:
57+
python-version: [ "3.12" ]
58+
os: [ ubuntu-latest ]
5559
# Specifying a GitHub environment, # Specifying a GitHub environment, which PyPI strongly recommends: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
5660
# you have to create an environment in your repository settings and add the environment name here
5761
environment: release
@@ -62,14 +66,14 @@ jobs:
6266
# Once your downstream code relies on a broken but released version of a library, you're in trouble.
6367
steps:
6468
- uses: actions/checkout@v4
65-
- name: Set up Python
69+
- name: Set up Python ${{ matrix.python-version }}
6670
uses: actions/setup-python@v5
6771
with:
6872
python-version: ${{ matrix.python-version }}
6973
- name: Install dependencies
7074
run: |
7175
python -m pip install --upgrade pip
72-
pip install -r dev_requirements/requirements-packaging.txt
76+
pip install .[packaging]
7377
- name: Build wheel and source distributions
7478
run: |
7579
python -m build

dev_requirements/requirements-coverage.in

-2
This file was deleted.

dev_requirements/requirements-coverage.txt

-8
This file was deleted.

dev_requirements/requirements-formatting.in

-3
This file was deleted.

dev_requirements/requirements-formatting.txt

-20
This file was deleted.

dev_requirements/requirements-linting.in

-2
This file was deleted.

dev_requirements/requirements-linting.txt

-20
This file was deleted.

dev_requirements/requirements-packaging.in

-3
This file was deleted.

dev_requirements/requirements-packaging.txt

-74
This file was deleted.

dev_requirements/requirements-spell_check.in

-1
This file was deleted.

dev_requirements/requirements-spell_check.txt

-8
This file was deleted.

dev_requirements/requirements-tests.in

-3
This file was deleted.

dev_requirements/requirements-tests.txt

-18
This file was deleted.

dev_requirements/requirements-type_check.in

-3
This file was deleted.

dev_requirements/requirements-type_check.txt

-12
This file was deleted.

pyproject.toml

+34-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,42 @@ classifiers = [
1616
"Programming Language :: Python :: 3.11",
1717
"Programming Language :: Python :: 3.12",
1818
]
19-
dependencies = ["pydantic>=2.0.0", "aiohttp[speedups]>=3.9.3", "maus>=0.4.2", "pyjwt", "aioauth_client"] # add all the dependencies here
19+
dependencies = [
20+
"pydantic>=2.0.0",
21+
"aiohttp[speedups]>=3.9.3",
22+
"maus>=0.4.2",
23+
"pyjwt",
24+
"aioauth_client"
25+
] # add all the dependencies here
2026
dynamic = ["readme", "version"]
2127

28+
[project.optional-dependencies]
29+
coverage = [
30+
"coverage==7.4.4"
31+
]
32+
formatting = [
33+
"black==24.8.0",
34+
"isort==5.13.2"
35+
]
36+
linting = [
37+
"pylint==3.2.6"
38+
]
39+
packaging = [
40+
"build==1.2.1",
41+
"twine==5.1.1"
42+
]
43+
spellcheck = [
44+
"codespell==2.3.0"
45+
]
46+
tests = [
47+
"pytest==8.3.1",
48+
"pytest-asyncio==0.23.6"
49+
]
50+
type_check = [
51+
"mypy[pydantic]==1.8.0",
52+
"types-pytz==2024.1.0.20240203"
53+
]
54+
2255
[project.urls]
2356
Changelog = "https://github.com/Hochfrequenz/TransformerBeeClient.py/releases"
2457
Homepage = "https://github.com/Hochfrequenz/TransformerBeeClient.py"

tox.ini

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ commands = python -m pip install --upgrade pip
1414
# the tests environment is called by the Github action that runs the unit tests
1515
deps =
1616
-r requirements.txt
17-
-r dev_requirements/requirements-tests.txt
17+
.[tests]
1818
setenv = PYTHONPATH = {toxinidir}/src
1919
commands = python -m pytest --basetemp={envtmpdir} {posargs} --ignore integrationtests
2020

@@ -24,15 +24,15 @@ passenv = AUTH0_TEST_CLIENT_ID,AUTH0_TEST_CLIENT_SECRET
2424
# other than the (unit) tests, this requires a docker container with transformer.bee to be running
2525
deps =
2626
-r requirements.txt
27-
-r dev_requirements/requirements-tests.txt
27+
.[tests]
2828
setenv = PYTHONPATH = {toxinidir}/src
2929
commands = python -m pytest --basetemp={envtmpdir} {posargs} --ignore unittests
3030

3131
[testenv:linting]
3232
# the linting environment is called by the Github Action that runs the linter
3333
deps =
3434
{[testenv:tests]deps}
35-
-r dev_requirements/requirements-linting.txt
35+
.[linting]
3636
# add your fixtures like e.g. pytest_datafiles here
3737
setenv = PYTHONPATH = {toxinidir}/src
3838
commands =
@@ -46,7 +46,7 @@ commands =
4646
setenv = PYTHONPATH = {toxinidir}/src
4747
deps =
4848
{[testenv:tests]deps}
49-
-r dev_requirements/requirements-type_check.txt
49+
.[type_check]
5050
commands =
5151
mypy --show-error-codes src/transformerbeeclient
5252
mypy --show-error-codes unittests
@@ -58,7 +58,7 @@ commands =
5858
setenv = PYTHONPATH = {toxinidir}/src
5959
deps =
6060
-r requirements.txt
61-
-r dev_requirements/requirements-spell_check.txt
61+
.[spellcheck]
6262
commands =
6363
codespell --ignore-words=domain-specific-terms.txt src
6464
codespell --ignore-words=domain-specific-terms.txt README.md
@@ -70,7 +70,7 @@ passenv = AUTH0_TEST_CLIENT_ID,AUTH0_TEST_CLIENT_SECRET
7070
changedir = integrationtests
7171
deps =
7272
{[testenv:tests]deps}
73-
-r dev_requirements/requirements-coverage.txt
73+
.[coverage]
7474
setenv = PYTHONPATH = {toxinidir}/src
7575
# note, that we collect the coverage from the integration test path here!
7676
commands =
@@ -87,7 +87,7 @@ deps =
8787
{[testenv:type_check]deps}
8888
{[testenv:coverage]deps}
8989
{[testenv:spell_check]deps}
90-
-r dev_requirements/requirements-formatting.txt
90+
.[formatting]
9191
pip-tools
9292
pre-commit
9393
commands =
@@ -99,7 +99,7 @@ commands =
9999
[testenv:test_packaging]
100100
skip_install = true
101101
deps =
102-
-r dev_requirements/requirements-packaging.txt
102+
.[packaging]
103103
commands =
104104
python -m build
105105
twine check dist/*

0 commit comments

Comments
 (0)