8000 Use the PEP 735 [dependency-groups] table · sphinx-doc/sphinx@070b92b · GitHub
[go: up one dir, main page]

Skip to content

Commit 070b92b

Browse files
committed
Use the PEP 735 [dependency-groups] table
1 parent 9191c34 commit 070b92b

File tree

7 files changed

+68
-26
lines changed

7 files changed

+68
-26
lines changed

.github/workflows/builddoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
version: latest
3737
enable-cache: false
3838
- name: Install dependencies
39-
run: uv pip install .[docs]
39+
run: uv pip install . --group docs
4040
- name: Render the documentation
4141
run: >
4242
sphinx-build

.github/workflows/create-release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ jobs:
4141
enable-cache: false
4242

4343
- name: Install build dependencies (pypa/build, twine)
44-
run: |
45-
uv pip install build "twine>=5.1"
46-
# resolution fails without betterproto
47-
uv pip install pypi-attestations==0.0.22 betterproto==2.0.0b6
44+
run: uv pip install --group package
4845

4946
- name: Build distribution
5047
run: python -m build

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
version: latest
5656
enable-cache: false
5757
- name: Install dependencies
58-
run: uv pip install ".[lint,test]"
58+
run: uv pip install -r pyproject.toml --group package --group test --group types
5959
- name: Type check with mypy
6060
run: mypy
6161

@@ -76,7 +76,7 @@ jobs:
7676
version: latest
7777
enable-cache: false
7878
- name: Install dependencies
79-
run: uv pip install ".[lint,test]"
79+
run: uv pip install -r pyproject.toml --group package --group test --group types
8080
- name: Type check with pyright
8181
run: pyright
8282

@@ -97,7 +97,7 @@ jobs:
9797
version: latest
9898
enable-cache: false
9999
- name: Install dependencies
100-
run: uv pip install --upgrade sphinx-lint
100+
run: uv pip install --group lint
101101
- name: Lint documentation with sphinx-lint
102102
run: make doclinter
103103

@@ -118,7 +118,7 @@ jobs:
118118
version: latest
119119
enable-cache: false
120120
- name: Install dependencies
121-
run: uv pip install --upgrade twine build
121+
run: uv pip install --group package
122122
- name: Lint with twine
123123
run: |
124124
python -m build .

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
version: latest
6868
enable-cache: false
6969
- name: Install dependencies
70-
run: uv pip install .[test]
70+
run: uv pip install . --group test
7171
- name: Install Docutils ${{ matrix.docutils }}
7272
run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
7373
- name: Test with pytest
@@ -198,7 +198,7 @@ jobs:
198198
version: latest
199199
enable-cache: false
200200
- name: Install dependencies
201-
run: uv pip install .[test]
201+
run: uv pip install . --group test
202202
- name: Test with pytest
203203
run: python -m pytest -vv --durations 25
204204
env:
@@ -227,7 +227,7 @@ jobs:
227227
version: latest
228228
enable-cache: false
229229
- name: Install dependencies
230-
run: uv pip install .[test]
230+
run: uv pip install . --group test
231231
- name: Test with pytest
232232
run: python -m pytest -vv --durations 25
233233
env:
@@ -262,7 +262,7 @@ jobs:
262262
version: latest
263263
enable-cache: false
264264
- name: Install dependencies
265-
run: uv pip install .[test]
265+
run: uv pip install . --group test
266266
- name: Install Docutils' HEAD
267267
run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils"
268268
- name: Test with pytest
@@ -296,7 +296,7 @@ jobs:
296296
enable-cache: false
297297
- name: Install dependencies
298298
run: |
299-
uv pip install .[test] --resolution lowest-direct
299+
uv pip install . --group test --resolution lowest-direct
300300
uv pip install alabaster==1.0.0
301301
- name: Test with pytest
302302
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
@@ -326,7 +326,7 @@ jobs:
326326
version: latest
327327
enable-cache: false
328328
- name: Install dependencies
329-
run: uv pip install .[test]
329+
run: uv pip install . --group test
330330
- name: Test with pytest
331331
run: python -m pytest -vv --durations 25
332332
env:
@@ -357,7 +357,7 @@ jobs:
357357
version: latest
358358
enable-cache: false
359359
- name: Install dependencies
360-
run: uv pip install .[test] pytest-cov
360+
run: uv pip install . --group test pytest-cov
361361
- name: Test with pytest
362362
run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml
363363
env:

.github/workflows/transifex.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
version: latest
4242
enable-cache: false
4343
- name: Install dependencies
44-
run: uv pip install --upgrade babel jinja2
44+
run: uv pip install --group translations
4545
- name: Extract translations from source code
4646
run: python utils/babel_runner.py extract
4747
- name: Push translations to transifex.com
@@ -77,7 +77,7 @@ jobs:
7777
version: latest
7878
enable-cache: false
7979
- name: Install dependencies
80-
run: uv pip install --upgrade babel jinja2
80+
run: uv pip install --group translations
8181
- name: Extract translations from source code
8282
run: python utils/babel_runner.py extract
8383
- name: Pull translations from transifex.com

pyproject.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,48 @@ sphinx-quickstart = "sphinx.cmd.quickstart:main"
130130
sphinx-apidoc = "sphinx.ext.apidoc:main"
131131
sphinx-autogen = "sphinx.ext.autosummary.generate:main"
132132

133+
[dependency-groups]
134+
docs = [
135+
"sphinxcontrib-websupport",
136+
]
137+
lint = [
138+
"ruff==0.11.0",
139+
"sphinx-lint>=0.9",
140+
]
141+
package = [
142+
"betterproto==2.0.0b6", # resolution fails without betterproto
143+
"build",
144+
"pypi-attestations==0.0.22",
145+
"twine>=5.1",
146+
]
147+
test = [
148+
"pytest>=8.0",
149+
"pytest-xdist[psutil]>=3.4",
150+
"cython>=3.0", # for Cython compilation
151+
"defusedxml>=0.7.1", # for secure XML/HTML parsing
152+
"setuptools>=70.0", # for Cython compilation
153+
"typing_extensions>=4.9", # for typing_extensions.Unpack
154+
]
155+
translations = [
156+
"babel>=2.13",
157+
"Jinja2>=3.1",
158+
]
159+
types = [
160+
"mypy==1.15.0",
161+
"pyright==1.1.397",
162+
{ include-group = "type-stubs" },
163+
]
164+
type-stubs = [
165+
# align with versions used elsewhere
166+
"types-colorama==0.4.15.20240311",
167+
"types-defusedxml==0.7.0.20240218",
168+
"types-docutils==0.21.0.20241128",
169+
"types-Pillow==10.2.0.20240822",
170+
"types-Pygments==2.19.0.20250305",
171+
"types-requests==2.32.0.20250306",
172+
"types-urllib3==1.26.25.14",
173+
]
174+
133175
[tool.flit.module]
134176
name = "sphinx"
135177

@@ -420,3 +462,6 @@ reportUnusedFunction = "none"
420462
reportUnusedImport = "none"
421463
reportUnusedVariable = "none"
422464
reportWildcardImportFromLibrary = "none"
465+
466+
[tool.uv]
467+
default-groups = "all"

tox.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ passenv =
2020
READTHEDOCS
2121
description =
2222
py{311,312,313,314}: Run unit tests against {envname}.
23-
extras =
23+
dependency_groups =
2424
test
2525
setenv =
2626
PYTHONWARNINGS = error
@@ -31,8 +31,9 @@ commands=
3131
[testenv:lint]
3232
descript 7802 ion =
3333
Run linters.
34-
extras =
34+
dependency_groups =
3535
lint
36+
types
3637
# If you update any of these commands, don't forget to update the equivalent
3738
# GitHub Workflow step
3839
commands =
@@ -43,7 +44,7 @@ commands =
4344
[testenv:docs]
4445
description =
4546
Build documentation.
46-
extras =
47+
dependency_groups =
4748
docs
4849
commands =
4950
python -c "import shutil; shutil.rmtree('./build/sphinx', ignore_errors=True) if '{env:CLEAN:}' else None"
@@ -52,7 +53,7 @@ commands =
5253
[testenv:docs-live]
5354
description =
5455
Build documentation.
55-
extras =
56+
dependency_groups =
5657
docs
5758
deps =
5859
sphinx-autobuild
@@ -70,7 +71,7 @@ commands =
7071
[testenv:ruff]
7172
description =
7273
Run ruff formatting and linting.
73-
extras =
74+
dependency_groups =
7475
lint
7576
commands =
7677
ruff format .
@@ -79,8 +80,7 @@ commands =
7980
[testenv:mypy]
8081
description =
8182
Run mypy type checking.
82-
extras =
83-
lint
84-
test
83+
dependency_groups =
84+
types
8585
commands =
8686
mypy {posargs}

0 commit comments

Comments
 (0)
0