-
-
Notifications
You must be signed in to change notification settings - Fork 784
Build: add dependency groups for tox/pyproject to simplify dev, docs,… #3767
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Added dependency groups to pyproject.toml and tox.ini for reproducible dev/docs/test environments. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -108,3 +108,40 @@ type = [ | |||||
| # We're not doing anything Python-related at the root level of the repo, but if this | ||||||
| # declaration isn't here, tox commands run from the root directory raise a warning that | ||||||
| # pyproject.toml doesn't contain a setuptools_scm section. | ||||||
| # ------------------------------------------------------------------- | ||||||
| # PEP 735 dependency groups (root): used by tox & contributors. | ||||||
| # These do NOT ship in built wheels. | ||||||
| # ------------------------------------------------------------------- | ||||||
| [dependency-groups] | ||||||
|
|
||||||
| "pre-commit" = [ | ||||||
| "pre-commit == 4.3.0", | ||||||
| ] | ||||||
|
|
||||||
| "town-crier" = [ | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Towncrier is a single word:
Suggested change
|
||||||
| "towncrier == 24.8.0", | ||||||
| ] | ||||||
|
|
||||||
| dev = [ | ||||||
| "coverage[toml] == 7.10.6", | ||||||
| "coverage-conditional-plugin == 0.9.0", | ||||||
| "Pillow == 11.3.0", | ||||||
| "pytest == 8.4.1", | ||||||
| "pytest-asyncio == 1.1.0", | ||||||
| "pytest-freezer == 0.4.9", | ||||||
| "pytest-xdist == 3.8.0", | ||||||
| "setuptools-scm == 9.2.0", | ||||||
| ] | ||||||
|
|
||||||
| docs = [ | ||||||
| "sphinx == 8.2.3", | ||||||
| "furo == 2025.7.19", | ||||||
| "sphinx_tabs == 3.4.5", | ||||||
| "sphinx-autobuild == 2024.10.3", | ||||||
| "sphinx-csv-filter == 0.4.2", | ||||||
| "sphinx-copybutton == 0.5.2", | ||||||
| "sphinx-toolbox == 4.0.0", | ||||||
| "sphinxcontrib-spelling == 8.0.1", | ||||||
| "pyenchant == 3.2.2", | ||||||
| "Pillow == 11.3.0", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems a little weird that Pillow is defined twice. We probably want to define a |
||||||
| ] | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,9 +15,10 @@ skip_missing_interpreters = True | |
|
|
||
| [testenv:pre-commit] | ||
| skip_install = True | ||
| dependency_groups = pre-commit | ||
| deps = | ||
| {tox_root}{/}travertino | ||
| {tox_root}{/}core[dev] | ||
| -e{tox_root}{/}core | ||
| -e{tox_root}{/}travertino | ||
|
Comment on lines
+20
to
+21
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason these have been changed to editable installs? |
||
| commands = pre-commit run --all-files --show-diff-on-failure --color=always | ||
|
|
||
| # The leading comma generates the "py" environment | ||
|
|
@@ -33,11 +34,10 @@ allowlist_externals = | |
| bash | ||
| commands = | ||
| # TOGA_INSTALL_COMMAND is set to a bash command by the CI workflow | ||
| {env:TOGA_INSTALL_COMMAND:python -m pip install {tox_root}{/}core[dev] {tox_root}{/}dummy {tox_root}{/}travertino} | ||
| {env:TOGA_INSTALL_COMMAND:python -m pip install -e {tox_root}{/}core -e {tox_root}{/}dummy -e {tox_root}{/}travertino} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again - is there a reason these have been switched to editable installs? Also - it's not clear to me how/why this will be installing the dev dependencies for core. The |
||
| !fast-!cov : python -m pytest {posargs:-vv --color yes} | ||
| cov : python -m coverage run -m pytest {posargs:-vv --color yes} | ||
| fast : python -m pytest {posargs:-vv --color yes -n auto} | ||
|
|
||
| cov : python -m coverage run -m pytest {posargs:-vv --color yes} | ||
| fast : python -m pytest {posargs:-vv --color yes -n auto} | ||
| [testenv:coverage{,310,311,312,313,314}{,-trav}{,-html}{,-keep}{,-platform}] | ||
| depends = | ||
| !trav: pre-commit,py3{10-14}{,-cov} | ||
|
|
@@ -61,10 +61,11 @@ setenv = | |
| PROJECT_RCFILE = --rcfile {tox_root}{/}pyproject.toml | ||
| # disable conditional coverage exclusions for Python version | ||
| {platform}: COVERAGE_EXCLUDE_PYTHON_VERSION=disable | ||
| dependency_groups = dev | ||
| commands_pre = python --version | ||
| commands = | ||
| # TOGA_INSTALL_COMMAND is set to a bash command by the CI workflow | ||
| {env:TOGA_INSTALL_COMMAND:python -m pip install {tox_root}{/}core[dev] {tox_root}{/}travertino} | ||
| {env:TOGA_INSTALL_COMMAND:python -m pip install -e {tox_root}{/}core -e {tox_root}{/}travertino} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again - why editable installs? |
||
| -python -m coverage combine {env:PACKAGE_RCFILE} {env:COMBINE_KEEP} | ||
| html: python -m coverage html {env:PROJECT_RCFILE} --skip-covered --skip-empty | ||
| python -m coverage report {env:PROJECT_RCFILE} --fail-under=100 | ||
|
|
@@ -85,8 +86,8 @@ commands = | |
|
|
||
| [testenv:towncrier{,-check}] | ||
| skip_install = True | ||
| deps = | ||
| towncrier==25.8.0 | ||
| dependency_groups = | ||
| town-crier | ||
| commands = | ||
| check : python -m towncrier.check --compare-with origin/main | ||
| !check : python -m towncrier {posargs} | ||
|
|
@@ -102,9 +103,10 @@ base_python = py312 | |
| skip_install = True | ||
| # give sphinx-autobuild time to shutdown http server | ||
| suicide_timeout = 1 | ||
| dependency_groups = docs | ||
| deps = | ||
| # editable install so docstrings can be updated for 'all' and 'live' | ||
| -e {tox_root}{/}core[docs] | ||
| -e {tox_root}{/}core | ||
| -e {tox_root}{/}travertino | ||
| # Docs requirements are *mostly* handled by the `docs` extra; but we can't include | ||
| # the theme that way, so the theme is installed using a requirements.txt file, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to document what dependency groups are.