Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b68cead

Browse files
committedMar 20, 2025·
Use the PEP 735 [dependency-groups] table
1 parent 9191c34 commit b68cead

File tree

5 files changed

+57
-19
lines changed

5 files changed

+57
-19
lines changed
 

‎.github/workflows/builddoc.yml

+1-1
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/lint.yml

+3-3
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 --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 --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

‎.github/workflows/main.yml

+7-7
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:

‎pyproject.toml

+38
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,41 @@ 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+
test = [
142+
"pytest>=8.0",
143+
"pytest-xdist[psutil]>=3.4",
144+
"cython>=3.0", # for Cython compilation
145+
"defusedxml>=0.7.1", # for secure XML/HTML parsing
146+
"setuptools>=70.0", # for Cython compilation
147+
"typing_extensions>=4.9", # for typing_extensions.Unpack
148+
]
149+
types = [
150+
"mypy==1.15.0",
151+
"pyright==1.1.397",
152+
{ include-group = "type-stubs" },
153+
]
154+
type-stubs = [
155+
# align with versions used elsewhere
156+
"betterproto==2.0.0b6",
157+
"pypi-attestations==0.0.22",
158+
"pytest>=8.0",
159+
"types-colorama==0.4.15.20240311",
160+
"types-defusedxml==0.7.0.20240218",
161+
"types-docutils==0.21.0.20241128",
162+
"types-Pillow==10.2.0.20240822",
163+
"types-Pygments==2.19.0.20250305",
164+
"types-requests==2.32.0.20250306",
165+
"types-urllib3==1.26.25.14",
166+
]
167+
133168
[tool.flit.module]
134169
name = "sphinx"
135170

@@ -420,3 +455,6 @@ reportUnusedFunction = "none"
420455
reportUnusedImport = "none"
421456
reportUnusedVariable = "none"
422457
reportWildcardImportFromLibrary = "none"
458+
459+
[tool.uv]
460+
default-groups = "all"

‎tox.ini

+8-8
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
description =
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)
Please sign in to comment.