Skip to content

Commit 37d352c

Browse files
Move from extras to dependency-groups (#240)
* Move from extras to dependency-groups * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ba034d6 commit 37d352c

File tree

3 files changed

+44
-31
lines changed

3 files changed

+44
-31
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: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,43 @@ dependencies = [
4949
"packaging>=25",
5050
"tomli>=2.3; python_version<'3.11'",
5151
]
52-
optional-dependencies.docs = [
53-
"furo>=2025.9.25",
54-
"sphinx-autodoc-typehints>=3.5.1",
55-
]
56-
optional-dependencies.testing = [
52+
urls.Changelog = "https://github.com/tox-dev/pyproject-api/releases"
53+
urls.Homepage = "https://pyproject-api.readthedocs.io"
54+
urls.Source = "https://github.com/tox-dev/pyproject-api"
55+
urls.Tracker = "https://github.com/tox-dev/pyproject-api/issues"
56+
57+
[dependency-groups]
58+
dev = [
59+
{ include-group = "docs" },
60+
{ include-group = "lint" },
61+
{ include-group = "pkg-meta" },
62+
{ include-group = "test" },
63+
{ include-group = "type" },
64+
]
65+
test = [
5766
"covdefaults>=2.3",
5867
"pytest>=8.4.2",
5968
"pytest-cov>=7",
6069
"pytest-mock>=3.15.1",
6170
"setuptools>=80.9",
6271
]
63-
urls.Changelog = "https://github.com/tox-dev/pyproject-api/releases"
64-
urls.Homepage = "https://pyproject-api.readthedocs.io"
65-
urls.Source = "https://github.com/tox-dev/pyproject-api"
66-
urls.Tracker = "https://github.com/tox-dev/pyproject-api/issues"
72+
type = [
73+
"ty>=0.0.17",
74+
{ include-group = "docs" },
75+
{ include-group = "test" },
76+
]
77+
docs = [
78+
"furo>=2025.9.25",
79+
"sphinx-autodoc-typehints>=3.5.1",
80+
]
81+
lint = [
82+
"pre-commit-uv>=4.1.5",
83+
]
84+
pkg-meta = [
85+
"check-wheel-contents>=0.6.3",
86+
"twine>=6.2",
87+
"uv>=0.9",
88+
]
6789

6890
[tool.hatch]
6991
build.hooks.vcs.version-file = "src/pyproject_api/_version.py"

tox.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ skip_missing_interpreters = true
66
description = "run the unit tests with pytest under {env_name}"
77
package = "wheel"
88
wheel_build_env = ".pkg"
9-
extras = [ "testing" ]
9+
dependency_groups = [ "test" ]
1010
pass_env = [ "DIFF_AGAINST", "PYTEST_*" ]
1111
set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage.{env_name}" }
1212
set_env.COVERAGE_PROCESS_START = "{tox_root}/pyproject.toml"
@@ -37,26 +37,25 @@ commands = [
3737

3838
[env.docs]
3939
description = "build documentation"
40-
extras = [ "docs" ]
40+
dependency_groups = [ "docs" ]
4141
commands = [
4242
[
4343
"sphinx-build",
4444
"-d",
4545
"{env_tmp_dir}{/}doc_tree",
4646
"docs",
47-
"{work_dir}{/}docs_out",
4847
"--color",
4948
"-b",
5049
"html",
51-
{ replace = "posargs", extend = true, default = [ "-W" ] },
50+
{ replace = "posargs", extend = true, default = [ "-W", "{work_dir}{/}docs_out" ] },
5251
],
5352
[ "python", "-c", 'print(r"documentation available under file://{work_dir}{/}docs_out{/}index.html")' ],
5453
]
5554

5655
[env.fix]
5756
description = "run static analysis and style check using flake8"
5857
package = "skip"
59-
deps = [ "pre-commit-uv>=4.1.5" ]
58+
dependency_groups = [ "lint" ]
6059
pass_env = [ "HOMEPATH", "PROGRAMDATA" ]
6160
commands = [
6261
[ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ],
@@ -66,7 +65,7 @@ commands = [
6665
[env.pkg_meta]
6766
description = "check that the long description is valid"
6867
skip_install = true
69-
deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.9" ]
68+
dependency_groups = [ "pkg-meta" ]
7069
commands = [
7170
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
7271
[ "twine", "check", "{env_tmp_dir}{/}*" ],
@@ -75,14 +74,13 @@ commands = [
7574

7675
[env.type]
7776
description = "run type check on code base"
78-
deps = [ "ty>=0.0.17" ]
79-
extras = [ "docs", "testing" ]
77+
dependency_groups = [ "type" ]
8078
commands = [ [ "ty", "check", "--output-format", "concise", "--error-on-warning", "." ] ]
8179

8280
[env.dev]
8381
description = "generate a DEV environment"
8482
package = "editable"
85-
extras = [ "testing" ]
83+
dependency_groups = [ "dev" ]
8684
commands = [
8785
[ "uv", "pip", "tree" ],
8886
[ "python", "-c", "import sys; print(sys.executable)" ],

0 commit comments

Comments
 (0)