WIP: Add uv project requirements #14113
Open
+3,792
−0
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.
This PR serves as an introduction to UV as our new project and package manager. Initially I would like to add uv compatibility alongside our current dependency management to allow us to migrate smoothly.
This contains the following:
pyproject.toml- Replacement for setup.py. Defines project information, dependencies, scripts, etc.requirements.in- Not necessary for uv going forward but was used to add our base requirements to uvuv.lock- Managed entirely by uv, lockfile which ensures that environments that run our code throughuv runwill be utilizing the correct dependency versions.python-version- Generated by uv as a part of the init process, specifies the version we wish uv to execute withInitial performance comparison:
I wanted to display the difference between pip installing our requirements and installing them through uv. This was done by performing the following experiment:
uv pip compile pyproject.toml -o requirements.lockpython -m venv .venv-pippython -m venv .venv-uvtime pip install -r requirements.locktime uv pip install -r requirements.lockOne example of the results:
pip install -r requirements.lock 41.09s user 2.82s system 86% cpu 50.728 totaluv pip install -r requirements.lock 0.12s user 1.09s system 333% cpu 0.362 totalI performed this experiment several times and on average uv was over 300 times faster than pip.