Skip to content

Commit 01e8f51

Browse files
Move from extras to dependency-groups (#3056)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fbbb97d commit 01e8f51

File tree

3 files changed

+66
-53
lines changed

3 files changed

+66
-53
lines changed

.readthedocs.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
version: 2
22
build:
3-
os: ubuntu-22.04
4-
tools:
5-
python: "3"
6-
python:
7-
install:
8-
- method: pip
9-
path: .
10-
extra_requirements:
11-
- docs
12-
sphinx:
13-
builder: html
14-
configuration: docs/conf.py
15-
fail_on_warning: true
3+
os: ubuntu-lts-latest
4+
tools: {}
5+
commands:
6+
- curl -LsSf https://astral.sh/uv/install.sh | sh
7+
- ~/.local/bin/uv tool install tox --with tox-uv -p 3.14 --managed-python
8+
- ~/.local/bin/tox run -e docs -- $READTHEDOCS_OUTPUT/html

pyproject.toml

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,38 +51,6 @@ dependencies = [
5151
"platformdirs>=3.9.1,<5",
5252
"typing-extensions>=4.13.2; python_version<'3.11'",
5353
]
54-
optional-dependencies.docs = [
55-
"furo>=2023.7.26",
56-
"pre-commit-uv>=4.1.4",
57-
"proselint>=0.13",
58-
"sphinx>=7.1.2,!=7.3",
59-
"sphinx-argparse>=0.4",
60-
"sphinx-autodoc-typehints>=3.6.2",
61-
"sphinx-copybutton>=0.5.2",
62-
"sphinx-inline-tabs>=2025.12.21.14",
63-
"sphinxcontrib-mermaid>=2",
64-
"sphinxcontrib-towncrier>=0.2.1a0",
65-
"towncrier>=23.6",
66-
]
67-
optional-dependencies.test = [
68-
"covdefaults>=2.3",
69-
"coverage>=7.2.7",
70-
"coverage-enable-subprocess>=1",
71-
"flaky>=3.7",
72-
"packaging>=23.1",
73-
"pytest>=7.4",
74-
"pytest-env>=0.8.2",
75-
"""\
76-
pytest-freezer>=0.4.8; platform_python_implementation=='PyPy' or platform_python_implementation=='GraalVM' or \
77-
(platform_python_implementation=='CPython' and sys_platform=='win32' and python_version>='3.13')\
78-
""",
79-
"pytest-mock>=3.11.1",
80-
"pytest-randomly>=3.12",
81-
"pytest-timeout>=2.1",
82-
"pytest-xdist>=3.5",
83-
"setuptools>=68",
84-
"time-machine>=2.10; platform_python_implementation=='CPython'",
85-
]
8654
urls.Documentation = "https://virtualenv.pypa.io"
8755
urls.Homepage = "https://github.com/pypa/virtualenv"
8856
urls.Source = "https://github.com/pypa/virtualenv"
@@ -108,6 +76,59 @@ entry-points."virtualenv.discovery".builtin = "virtualenv.discovery.builtin:Buil
10876
entry-points."virtualenv.seed".app-data = "virtualenv.seed.embed.via_app_data.via_app_data:FromAppData"
10977
entry-points."virtualenv.seed".pip = "virtualenv.seed.embed.pip_invoke:PipInvoke"
11078

79+
[dependency-groups]
80+
dev = [
81+
{ include-group = "docs" },
82+
{ include-group = "lint" },
83+
{ include-group = "pkg-meta" },
84+
{ include-group = "test" },
85+
{ include-group = "type" },
86+
]
87+
test = [
88+
"covdefaults>=2.3",
89+
"coverage>=7.2.7",
90+
"coverage-enable-subprocess>=1",
91+
"flaky>=3.7",
92+
"packaging>=23.1",
93+
"pytest>=7.4",
94+
"pytest-env>=0.8.2",
95+
"""\
96+
pytest-freezer>=0.4.8; platform_python_implementation=='PyPy' or platform_python_implementation=='GraalVM' or \
97+
(platform_python_implementation=='CPython' and sys_platform=='win32' and python_version>='3.13')\
98+
""",
99+
"pytest-mock>=3.11.1",
100+
"pytest-randomly>=3.12",
101+
"pytest-timeout>=2.1",
102+
"pytest-xdist>=3.5",
103+
"setuptools>=68",
104+
"time-machine>=2.10; platform_python_implementation=='CPython'",
105+
]
106+
type = [
107+
"ty>=0.0.15",
108+
{ include-group = "test" },
109+
]
110+
docs = [
111+
"furo>=2023.7.26",
112+
"pre-commit-uv>=4.1.4",
113+
"proselint>=0.13",
114+
"sphinx>=7.1.2,!=7.3",
115+
"sphinx-argparse>=0.4",
116+
"sphinx-autodoc-typehints>=3.6.2",
117+
"sphinx-copybutton>=0.5.2",
118+
"sphinx-inline-tabs>=2025.12.21.14",
119+
"sphinxcontrib-mermaid>=2",
120+
"sphinxcontrib-towncrier>=0.2.1a0",
121+
"towncrier>=23.6",
122+
]
123+
lint = [
124+
"pre-commit-uv>=4.1.4",
125+
]
126+
pkg-meta = [
127+
"check-wheel-contents>=0.6.2",
128+
"twine>=6.1",
129+
"uv>=0.8",
130+
]
131+
111132
[tool.hatch]
112133
build.hooks.vcs.version-file = "src/virtualenv/version.py"
113134
build.targets.sdist.include = [

tox.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ skip_missing_interpreters = true
2323
description = "run tests with {env_name}"
2424
package = "wheel"
2525
wheel_build_env = ".pkg"
26-
extras = [ "test" ]
26+
dependency_groups = [ "test" ]
2727
pass_env = [ "CI_RUN", "PYTEST_*", "TERM" ]
2828
set_env._COVERAGE_SRC = "{env_site_packages_dir}{/}virtualenv"
2929
set_env.COVERAGE_FILE = "{work_dir}{/}.coverage.{env_name}"
@@ -64,7 +64,7 @@ uv_seed = true
6464

6565
[env.docs]
6666
description = "build documentation"
67-
extras = [ "docs" ]
67+
dependency_groups = [ "docs" ]
6868
set_env.PYTHONUTF8 = "1"
6969
commands = [
7070
[ "pre-commit", "run", "docstrfmt", "--all-files" ],
@@ -74,11 +74,10 @@ commands = [
7474
"-d",
7575
"{env_tmp_dir}{/}doctree",
7676
"docs",
77-
"{work_dir}{/}docs_out",
7877
"--color",
7978
"-b",
8079
"html",
81-
{ replace = "posargs", extend = true, default = [ "-W" ] },
80+
{ replace = "posargs", extend = true, default = [ "-W", "{work_dir}{/}docs_out" ] },
8281
],
8382
[
8483
"python",
@@ -93,7 +92,7 @@ commands = [
9392
[env.fix]
9493
description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
9594
skip_install = true
96-
deps = [ "pre-commit-uv>=4.1.4" ]
95+
dependency_groups = [ "lint" ]
9796
commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ]
9897

9998
[env.graalpy]
@@ -112,7 +111,7 @@ commands = [
112111
[env.readme]
113112
description = "check that the long description is valid"
114113
skip_install = true
115-
deps = [ "check-wheel-contents>=0.6.2", "twine>=6.1", "uv>=0.8" ]
114+
dependency_groups = [ "pkg-meta" ]
116115
commands = [
117116
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
118117
[ "twine", "check", "{env_tmp_dir}{/}*" ],
@@ -121,7 +120,7 @@ commands = [
121120

122121
[env.type]
123122
description = "run type checker (ty) against Python 3.14"
124-
deps = [ "ty>=0.0.15" ]
123+
dependency_groups = [ "type" ]
125124
commands = [ [ "python", "-m", "ty", "check", "src/virtualenv", "--python-version", "3.14" ] ]
126125

127126
[env.upgrade]
@@ -142,7 +141,7 @@ commands = [ [ "python", "release.py", { replace = "posargs", extend = true } ]
142141
[env.dev]
143142
description = "generate a DEV environment"
144143
package = "editable"
145-
extras = [ "docs", "test" ]
144+
dependency_groups = [ "dev" ]
146145
commands = [
147146
[ "uv", "pip", "tree" ],
148147
[ "python", "-c", "import sys; print(sys.executable)" ],

0 commit comments

Comments
 (0)