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
#168)

* Move optional dependencies from `dev_requirements` to `pyproject.toml`

* rename
  • Loading branch information
FreddyFox892 authored Sep 26, 2024
1 parent f007154 commit 72fb737
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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.

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

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

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

36 changes: 32 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,44 @@ classifiers = [
]
dependencies = [
"bomf",
"pvframework>=0.0.8",
"ibims>=0.3.6",
"python-dateutil",
"pydantic[email]",
"more_itertools",
"pydantic[email]",
"pvframework>=0.0.8",
"python-dateutil",
"pytz",
"schwifty",
"schwifty"
] # add all the dependencies from requirements.in here, too
dynamic = ["readme", "version"]

[project.optional-dependencies]
coverage = [
"coverage==7.6.1"
]
formatting = [
"black==24.8.0",
"isort==5.13.2"
]
linting = [
"pylint==3.3.0"
]
spellcheck = [
"codespell==2.3.0"
]
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",
"types-python-dateutil==2.9.0.20240906",
"types-pytz==2024.2.0.20240913"
]

[project.urls]
Changelog = "https://github.com/Hochfrequenz/pedantic-validator-tool/releases"
Homepage = "https://github.com/Hochfrequenz/pedantic-validator-tool"
Expand Down
8 changes: 0 additions & 8 deletions requirements.in

This file was deleted.

18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
# pip-compile pyproject.toml
#
annotated-types==0.7.0
# via pydantic
Expand All @@ -12,7 +12,7 @@ bidict==0.22.1
# pvframework
bomf==0.11.0
# via
# -r requirements.in
# -r pyproject.toml
# ibims
dnspython==2.4.2
# via email-validator
Expand All @@ -23,39 +23,39 @@ frozendict==2.3.8
# bomf
# pvframework
ibims==0.3.6
# via -r requirements.in
# via -r pyproject.toml
idna==3.4
# via email-validator
injector==0.21.0
# via bomf
more-itertools==10.5.0
# via -r requirements.in
# via -r pyproject.toml
networkx==3.1
# via
# bomf
# pvframework
pvframework==0.0.8
# via
# -r requirements.in
# -r pyproject.toml
# bomf
pycountry==22.3.5
# via schwifty
pydantic[email]==2.9.2
# via
# -r requirements.in
# -r pyproject.toml
# bomf
pydantic-core==2.23.4
# via pydantic
python-dateutil==2.9.0.post0
# via -r requirements.in
# via -r pyproject.toml
python-generics==0.0.2
# via bomf
pytz==2024.2
# via -r requirements.in
# via -r pyproject.toml
rstr==3.2.2
# via schwifty
schwifty==2024.9.0
# via -r requirements.in
# via -r pyproject.toml
six==1.16.0
# via python-dateutil
typeguard==4.1.5
Expand Down
13 changes: 6 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/pvtool
mypy --show-error-codes unittests
Expand All @@ -46,7 +46,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 @@ -61,19 +61,18 @@ deps =
{[testenv:linting]deps}
{[testenv:type_check]deps}
{[testenv:coverage]deps}
-r dev_requirements/requirements-formatting.txt
.[formatting]
pip-tools
pre-commit
commands =
python -m pip install --upgrade pip
pip-compile requirements.in
pip install -r requirements.txt
pre-commit install

[testenv:test_packaging]
skip_install = true
deps =
-r dev_requirements/requirements-packaging.txt
.[packaging]
commands =
python -m build
twine check dist/*

0 comments on commit 72fb737

Please sign in to comment.