Skip to content

Commit 69dae16

Browse files
authored
📦 build: move the testing extra to a dependency group (#243)
The `testing` dependencies were declared as a `[project.optional-dependencies]` extra, so they shipped in the published package metadata as an installable `pytest-env[testing]` extra even though no consumer of the plugin needs them. They exist only to develop and test the package itself, which is what PEP 735 dependency groups are for: dependency sets that stay in the source tree and never reach the wheel metadata. 📦 This moves the set into a `[dependency-groups]` `test` group and points the tox environments that used it at `dependency_groups = ["test"]` instead of `extras = ["testing"]`. The packages and their version constraints are unchanged. The published distribution no longer advertises a `testing` extra. Local workflows that installed `pytest-env[testing]` should use the `test` dependency group (`--group test`) or the tox environments instead. Runtime dependencies stay untouched.
1 parent 290c20d commit 69dae16

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ dependencies = [
4141
"python-dotenv>=1.2.2",
4242
"tomli>=2.4; python_version<'3.11'",
4343
]
44-
optional-dependencies.testing = [
45-
"covdefaults>=2.3",
46-
"coverage>=7.13.4",
47-
"pytest-mock>=3.15.1",
48-
]
4944
urls.Homepage = "https://github.com/pytest-dev/pytest-env"
5045
urls.Source = "https://github.com/pytest-dev/pytest-env"
5146
urls.Tracker = "https://github.com/pytest-dev/pytest-env/issues"
5247
entry-points.pytest11.env = "pytest_env.plugin"
5348

49+
[dependency-groups]
50+
test = [
51+
"covdefaults>=2.3",
52+
"coverage>=7.13.4",
53+
"pytest-mock>=3.15.1",
54+
]
55+
5456
[tool.hatch]
5557
version.source = "vcs"
5658
build.hooks.vcs.version-file = "src/pytest_env/version.py"

tox.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ skip_missing_interpreters = true
1818
description = "run the tests with pytest"
1919
package = "wheel"
2020
wheel_build_env = ".pkg"
21-
extras = [ "testing" ]
21+
dependency_groups = [ "test" ]
2222
pass_env = [ "DIFF_AGAINST", "PYTEST_*" ]
2323
set_env.COVERAGE_FILE = "{env:COVERAGE_FILE:{toxworkdir}{/}.coverage.{envname}}"
2424
commands = [
@@ -67,7 +67,7 @@ commands = [ [ "ty", "check", "--output-format", "concise", "--error-on-warning"
6767
[env.dev]
6868
description = "generate a DEV environment"
6969
package = "editable"
70-
extras = [ "testing" ]
70+
dependency_groups = [ "test" ]
7171
commands = [
7272
[ "uv", "pip", "tree" ],
7373
[ "python", "-c", "import sys; print(sys.executable)" ],

0 commit comments

Comments
 (0)