Skip to content

Commit

Permalink
Declare optional dependencies in pyproject.toml
Browse files Browse the repository at this point in the history
And thus get rid of requirements.txt files.
  • Loading branch information
dlax committed Nov 18, 2024
1 parent ee3d380 commit ce9fc49
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
python-version: 3.11
- name: Install dependencies
run: python -m pip install -r requirements-ci.txt -e .
run: python -m pip install -e ".[doc]"
- name: Check documentation
run: |
rst2html --strict README.rst > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: python -m pip install tox
- name: Test with pytest
run: |
tox -e tests
tox -e tests-ci
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v3
3 changes: 2 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ python:
install:
- method: pip
path: .
- requirements: requirements-ci.txt
extra_requirements:
- doc
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ recursive-include tests/data *.conf *.includeme *.log pgpass*
exclude .editorconfig
exclude .readthedocs.yaml
exclude Makefile
exclude requirements/dev.txt
prune .circleci
prune rpm
prune debian
Expand Down
2 changes: 1 addition & 1 deletion debian/source/options
Original file line number Diff line number Diff line change
@@ -1 +1 @@
extend-diff-ignore = "(^[^/]*[.]egg-info/|.circleci|.coverage|.editorconfig|.github|.mypy_cache|.pytest_cache|.readthedocs.yaml|.venv|Makefile|docs/_build|dist|rpm|setup.cfg|scripts|tox.ini|requirements/)"
extend-diff-ignore = "(^[^/]*[.]egg-info/|.circleci|.coverage|.editorconfig|.github|.mypy_cache|.pytest_cache|.readthedocs.yaml|.venv|Makefile|docs/_build|dist|rpm|setup.cfg|scripts|tox.ini)"
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,32 @@ classifiers = [
]
dynamic = ["version"]

[project.optional-dependencies]
dev = [
"pgtoolkit[lint,typing,test,doc]",
]
lint = [
"black",
"check-manifest",
"flake8",
"isort",
]
typing = [
"mypy",
]
test = [
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"psycopg2-binary",
]
doc = [
"sphinx",
"sphinx-autobuild",
"sphinx_rtd_theme",
]

[project.urls]
Repository = "https://github.com/dalibo/pgtoolkit"
Documentation = "https://pgtoolkit.readthedocs.io/"
Expand Down
15 changes: 0 additions & 15 deletions requirements-ci.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/dev.txt

This file was deleted.

11 changes: 8 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@ commands=
check-manifest
isort --check --diff .
deps =
-r requirements/dev.txt
flake8
black
check-manifest
isort
skip_install = true

[testenv:tests]
[testenv:tests{,-ci}]
allowlist_externals =
./tests/datatests.sh
commands =
pytest -ra --cov --cov-report=term-missing pgtoolkit/ tests/
./tests/datatests.sh
deps =
-r requirements-ci.txt
ci: codecov
extras =
test

[testenv:typing]
commands=
Expand Down

0 comments on commit ce9fc49

Please sign in to comment.