build: Adopt uv as the project package manager - #503
Open
kunaaaalcodes wants to merge 1 commit into
Open
Conversation
Problem The project uses pip and tox for installing dependencies and running tests, while uv is already used for the lock file and type-check job, leading to inconsistent tooling and slow dependency resolution. Solution Replace pip invocations with uv across all CI workflow jobs and in the docs deployment workflow. Update CONTRIBUTING.md to document uv-based setup and test running. Replace tox with uv, consolidating all dependencies into pyproject.toml (test extras, dev and docs dependency groups) and removing tox.ini and the requirements files. Regenerate uv.lock so all supported Python versions install pre-built wheels.
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.
Closes #469
Overview
This PR completes the migration to
uvas the project's single dependency management tool.While parts of the project had already adopted
uv(uv.lockand thetype-check-pythonworkflow), the rest of the repository still relied onpip,requirements.txt, andtox. This resulted in duplicated configuration, inconsistent developer workflows, and non-reproducible dependency installation.This change standardizes dependency management across local development, CI, and documentation.
What's Changed
Dependency Management
devfor development tools (e.g.ruff)docsfor documentation tooling (sphinx,mkdocs,pybind11-stubgen, etc.)coveragedependency to the test extras.tox.initopyproject.toml.cibuildwheel'stest-requiresrequirements file with explicit packages.uv.lockusing:uv lock --checkuv sync --lockedCI
Updated all Python workflows to use
uv.pip installwithuv sync --locked.uv run.lint-pythonprime-*-build-cachesrun-testsrun-tests-in-parallelrun-tests-with-address-sanitizerdeploy-docsOptional dependencies (such as TensorFlow and
google-cloud-storage) continue to be installed usinguv pip installso they remain outside the lock file.Documentation
Updated
CONTRIBUTING.mdto use the new workflow.pip3 install pybind11 tox→uv sync --all-extras --devtox→uv run pytestThe testing, documentation, style, ccache, and troubleshooting sections were updated accordingly.
Cleanup
Removed legacy dependency management files:
tox.inirequirements.txttest-requirements.txtdev-requirements.txtdocs-requirements.txtAlso:
uv.locktoMANIFEST.in.tox/entry from.gitignoreNotable Fix
Regenerating
uv.lockexposed a compatibility issue with Python 3.14.The previous lock file pinned
numpy==2.2.5, which has no pre-built wheels for Python 3.14 and would trigger a source build during CI.The lock file now pins an appropriate NumPy version for each supported Python release, ensuring wheel-based installation across the CI matrix.
Result
After this PR:
uvis the single dependency manager.pyproject.tomlis the single source of truth.uv.lockprovides fully reproducible installations.Testing
Verified locally:
Tested with:
Also verified:
--group docs)