Skip to content

Commit 06adf5e

Browse files
RonnyPfannschmidtCursor AIclaude
committed
experiment: use uv and dependency-groups in build pipelines
This is an experimental change to modernize the build infrastructure: - Add uv.lock for reproducible dependency resolution - Migrate from optional-dependencies to dependency-groups (PEP 735) - Configure tox to use tox-uv for faster dependency installation - Update all GitHub Actions workflows to install tox-uv - Update minimum version pins to sensible modern values: - iniconfig>=2, packaging>=24, pygments>=2.15, tomli>=2 - attrs>=23.1, hypothesis>=6.75, numpy>=1.26, pytest-xdist>=3.5 - coverage>=7.5, pexpect>=4.9, pre-commit>=4 - Remove py library from dev deps (pytest vendors its own minimal version) Usage: uv sync --group dev # Install with dev dependencies uv run pytest # Run tests uvx --with tox-uv tox # Run tox with uv backend Co-authored-by: Cursor AI <ai@cursor.sh> Co-authored-by: Anthropic Claude <claude@anthropic.com>
1 parent 67a174f commit 06adf5e

8 files changed

Lines changed: 819 additions & 22 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install tox
5656
run: |
5757
python -m pip install --upgrade pip
58-
pip install tox
58+
pip install tox tox-uv
5959
6060
- name: Generate release notes
6161
env:

.github/workflows/doc-check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install tox
3232
run: |
3333
python -m pip install --upgrade pip
34-
pip install tox
34+
pip install tox tox-uv
3535
3636
- name: Run sphinx linkcheck via tox
3737
run: tox -e docs-checklinks

.github/workflows/prepare-release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Install tox
4242
run: |
4343
python -m pip install --upgrade pip
44-
pip install tox
44+
pip install tox tox-uv
4545
4646
- name: Prepare release PR (minor/patch release)
4747
if: github.event.inputs.major == 'no'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ jobs:
291291
- name: Install tox
292292
run: |
293293
python -m pip install --upgrade pip
294-
pip install tox
294+
pip install tox tox-uv
295295
296296
- name: Test without coverage
297297
if: "! matrix.use_coverage"

.github/workflows/update-plugin-list.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Install tox
5252
run: |
5353
python -m pip install --upgrade pip
54-
pip install tox
54+
pip install tox tox-uv
5555
5656
- name: Update Plugin List
5757
run: tox -e update-plugin-list

pyproject.toml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ dynamic = [
4949
dependencies = [
5050
"colorama>=0.4; sys_platform=='win32'",
5151
"exceptiongroup>=1; python_version<'3.11'",
52-
"iniconfig>=1.0.1",
53-
"packaging>=22",
52+
"iniconfig>=2",
53+
"packaging>=24",
5454
"pluggy>=1.5,<2",
55-
"pygments>=2.7.2",
56-
"tomli>=1; python_version<'3.11'",
55+
"pygments>=2.15",
56+
"tomli>=2; python_version<'3.11'",
5757
]
5858
optional-dependencies.dev = [
5959
"argcomplete",
60-
"attrs>=19.2",
61-
"hypothesis>=3.56",
60+
"attrs>=23.1",
61+
"hypothesis>=6.75",
6262
"mock",
6363
"requests",
6464
"setuptools",
@@ -73,6 +73,26 @@ urls.Tracker = "https://github.com/pytest-dev/pytest/issues"
7373
scripts."py.test" = "_pytest.config:_console_main"
7474
scripts.pytest = "_pytest.config:_console_main"
7575

76+
[dependency-groups]
77+
dev = [
78+
# Core test dependencies
79+
"argcomplete",
80+
"asynctest; python_version<'3.11'",
81+
"attrs>=23.1",
82+
# Test execution and coverage
83+
"coverage>=7.5",
84+
"hypothesis>=6.75",
85+
"mock",
86+
"numpy>=1.26",
87+
"pexpect>=4.9",
88+
"pytest-xdist>=3.5",
89+
# Additional test dependencies
90+
"pyyaml",
91+
"requests",
92+
"setuptools",
93+
"xmlschema",
94+
]
95+
7696
[tool.setuptools.package-data]
7797
"_pytest" = [
7898
"py.typed",

tox.ini

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tox]
22
requires =
33
tox >= 4
4+
tox-uv >= 1.25
45
envlist =
56
linting
67
py310
@@ -98,19 +99,13 @@ setenv =
9899
lsof: _PYTEST_TOX_POSARGS_LSOF=--lsof
99100

100101
xdist: _PYTEST_TOX_POSARGS_XDIST=-n auto
101-
extras = dev
102+
dependency_groups = dev
102103
deps =
103-
coverage: coverage>=7.10
104-
doctesting: PyYAML
105-
exceptiongroup: exceptiongroup>=1.0.0rc8
106-
numpy: numpy>=1.19.4
107-
pexpect: pexpect>=4.8.0
104+
exceptiongroup: exceptiongroup>=1.2
108105
pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git
109-
pylib: py>=1.8.2
106+
pylib: py>=1.11
110107
twisted24: twisted<25
111108
twisted25: twisted>=25
112-
asynctest: asynctest
113-
xdist: pytest-xdist>=2.1.0
114109
# Can use the same wheel for all environments.
115110
package = wheel
116111
wheel_build_env = .pkg
@@ -119,7 +114,8 @@ wheel_build_env = .pkg
119114
description =
120115
run pre-commit-defined linters under `{basepython}`
121116
skip_install = True
122-
deps = pre-commit>=2.9.3
117+
dependency_groups =
118+
deps = pre-commit>=4
123119
commands = pre-commit run --all-files --show-diff-on-failure {posargs:}
124120
setenv =
125121
# pre-commit and tools it launches are not clean of this warning.
@@ -131,6 +127,7 @@ description =
131127
`{toxinidir}{/}doc{/}en{/}_build{/}html` with `{basepython}`
132128
basepython = python3.14 # Sync with .readthedocs.yaml to get errors.
133129
usedevelop = True
130+
dependency_groups =
134131
deps =
135132
-r{toxinidir}/doc/en/requirements.txt
136133
commands =
@@ -148,6 +145,7 @@ description =
148145
check the links in the documentation with `{basepython}`
149146
usedevelop = True
150147
changedir = doc/en
148+
dependency_groups =
151149
deps = -r{toxinidir}/doc/en/requirements.txt
152150
commands =
153151
sphinx-build -W -q --keep-going -b linkcheck . _build
@@ -159,6 +157,7 @@ setenv =
159157
description =
160158
regenerate documentation examples under `{basepython}`
161159
changedir = doc/en
160+
dependency_groups =
162161
deps =
163162
PyYAML
164163
regendoc>=0.8.1
@@ -181,12 +180,13 @@ description =
181180
# use latest versions of all plugins, including pre-releases
182181
pip_pre=true
183182
changedir = testing/plugins_integration
183+
dependency_groups =
184184
deps = -rtesting/plugins_integration/requirements.txt
185185
allowlist_externals = pip
186186
setenv =
187187
PYTHONPATH=.
188188
commands =
189-
pip check
189+
uv pip check
190190
pytest bdd_wallet.py
191191
pytest --cov=. simple_integration.py
192192
pytest --ds=django_settings simple_integration.py
@@ -203,6 +203,7 @@ commands =
203203
description =
204204
test pytest frozen with `pyinstaller` under `{basepython}`
205205
changedir = testing/freeze
206+
dependency_groups =
206207
deps =
207208
pyinstaller
208209
commands =
@@ -213,6 +214,7 @@ commands =
213214
description = do a release, required posarg of the version number
214215
usedevelop = True
215216
passenv = *
217+
dependency_groups =
216218
deps =
217219
colorama
218220
pre-commit>=2.9.3
@@ -223,19 +225,22 @@ commands = python scripts/release.py {posargs}
223225
description = prepare a release PR from a manual trigger in GitHub actions
224226
usedevelop = {[testenv:release]usedevelop}
225227
passenv = {[testenv:release]passenv}
228+
dependency_groups = {[testenv:release]dependency_groups}
226229
deps = {[testenv:release]deps}
227230
commands = python scripts/prepare-release-pr.py {posargs}
228231

229232
[testenv:generate-gh-release-notes]
230233
description = generate release notes that can be published as GitHub Release
231234
usedevelop = True
235+
dependency_groups =
232236
deps =
233237
pypandoc_binary
234238
commands = python scripts/generate-gh-release-notes.py {posargs}
235239

236240
[testenv:update-plugin-list]
237241
description = update the plugin list
238242
skip_install = True
243+
dependency_groups =
239244
deps =
240245
packaging
241246
requests

0 commit comments

Comments
 (0)