Skip to content
Closed
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
1 change: 1 addition & 0 deletions changes/3634.misc.rst
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.
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
# -------------------------------------------------------------------
Comment on lines +111 to +114
Copy link
Member

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.

Suggested change
# -------------------------------------------------------------------
# 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" = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Towncrier is a single word:

Suggested change
"town-crier" = [
"towncrier" = [

"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",
Copy link
Member

Choose a reason for hiding this comment

The 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 optional group that includes Pillow, and then include optional as a sub-dependency of docs and dev.

]
22 changes: 12 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand All @@ -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}
Copy link
Member

Choose a reason for hiding this comment

The 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 [dev] group usage has been removed, but no equivalent dependency group has been added.

!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}
Expand All @@ -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}
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand All @@ -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}
Expand All @@ -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,
Expand Down
Loading