Replace tox and pip with uv - #507
Open
dweindl wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #507 +/- ##
=======================================
Coverage 75.30% 75.30%
=======================================
Files 64 64
Lines 7353 7353
Branches 1327 1327
=======================================
Hits 5537 5537
Misses 1310 1310
Partials 506 506 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tox and pip split dependency/environment management across two tools: pip installs packages, tox orchestrates per-purpose virtualenvs (quality/unit/doc) on top of it. uv replaces both with a single fast tool that handles dependency resolution/installation, Python version management, virtualenv creation, and building sdists - fewer moving parts for contributors to learn, and noticeably faster CI installs. - CI (`ci_tests.yml`): `astral-sh/setup-uv` installs uv + the matrix Python version (with built-in caching); `tox -e quality` becomes `uvx pre-commit run --all-files`; `tox -e unit` becomes `uv sync --group ci` + `uv run pytest`. The `"3.x"` matrix wildcard is replaced with an explicit `"3.14"`, since `setup-uv` needs exact versions. - Release (`deploy.yml`): `pip install setuptools wheel build && python -m build -s` becomes `uv build --sdist`. - The CI-only git dependencies previously listed in `tox.ini`'s `unit` env `deps=` (`petabtests`, `benchmark_models_petab`), plus the `tests`/`reports`/`combine`/`vis` extras, now live in a single PEP 735 `[dependency-groups]` `ci` group in `pyproject.toml` (via a self-referential `petab[tests,reports,combine,vis]` entry) - dependency-groups are excluded from built distribution metadata, so PyPI's rejection of direct/VCS references doesn't apply here. - No `uv.lock` is committed - this is a library, so CI keeps resolving against current constraints each run, matching the previous un-pinned tox/pip behavior. - Added `[tool.uv] constraint-dependencies = ["pysb>=1.17.0"]`: uv resolves one dependency graph across all declared extras, not just the ones requested for a given sync, so the unit-test job was transitively pulling in pysb via the unrelated `doc` extra and landing on 1.16.0, whose legacy build bootstrap hits a dead URL. Pinning the resolver to >=1.17.0 avoids it without changing the public `tests`/`doc` extras' declared ranges. - Removed `tox.ini` and `requirements-dev.txt` (only contained `tox>=3.26.0`). - Updated `doc/development.rst` dev-workflow commands to use `uv sync`/`uv run`/`uvx`. - Fixed `README.md`'s stated Python requirement (`>=3.11` -> `>=3.12`) to match `pyproject.toml`'s `requires-python`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
dweindl
force-pushed
the
replace-tox-pip-with-uv
branch
from
August 10, 2026 17:24
b0aafd9 to
cd854e6
Compare
dweindl
marked this pull request as ready for review
August 10, 2026 17:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
toxandpipsplit dependency/environment management across two tools:pipinstalls packages,toxorchestrates per-purpose virtualenvs(quality/unit/doc) on top of it.
uvreplaces both with a single fasttool that handles dependency resolution/installation, Python version
management, virtualenv creation, and building sdists — fewer moving
parts for contributors to learn, and noticeably faster CI installs.
Summary
tox+pipwithuvacross dev tooling, CI, and the release workflow.ci_tests.yml):astral-sh/setup-uvinstalls uv + the matrix Python version (with built-in caching);tox -e quality->uvx pre-commit run --all-files;tox -e unit->uv sync --group ci+uv run pytest. The"3.x"matrix wildcard is replaced with an explicit"3.14", sincesetup-uvneeds exact versions.deploy.yml):pip install setuptools wheel build && python -m build -s->uv build --sdist.tox.ini'sunitenvdeps=(petabtests,benchmark_models_petab), plus thetests/reports/combine/visextras, now live in a single PEP 735[dependency-groups]cigroup inpyproject.toml(via a self-referentialpetab[tests,reports,combine,vis]entry) — confirmed dependency-groups are excluded from built distribution metadata, so PyPI's rejection of direct/VCS references doesn't apply here.uv.lockis committed — this is a library, so CI keeps resolving against current constraints each run, matching the previous un-pinned tox/pip behavior.tox.iniandrequirements-dev.txt(only containedtox>=3.26.0).doc/development.rstdev-workflow commands to useuv sync/uv run/uvx.README.md's stated Python requirement (>=3.11->>=3.12) to matchpyproject.toml'srequires-python.[tool.uv] constraint-dependencies = ["pysb>=1.17.0"]: uv resolves one dependency graph across all declared extras (not just the ones requested for a given sync), so the unit-test job was transitively pulling inpysbvia the unrelateddocextra and landing on1.16.0, whose legacy build bootstrap hits a dead URL. Pinning the resolver to>=1.17.0avoids it without changing the publictests/docextras' declared ranges.Not changed (flagged, out of scope)
.readthedocs.yamlstays onpip— Read the Docs'python.installonly supportspip/setuptoolsnatively; usinguvthere needs custombuild.commandsoverrides.tox -e <name>entrypoint in favor of directuv run/uvxcommands.Test plan
uv build --sdistproduces an equivalent sdist to the previouspython -m build -s.uv sync --group ciresolves and installs correctly (verifiedpetabtestsandbenchmark_models_petabinstall from git, and the full test suite passes locally: 378 passed, 4 skipped).uvx pre-commit run --all-filesbehaves like the oldtox -e quality.ci_tests.yml) passes across the full OS x Python-version matrix on this PR.deploy.ymlsucceeds on the next release (can't be tested pre-merge).🤖 Generated with Claude Code