-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for the uv package and project manager #408
Conversation
…akefile. Is untested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
As a note: When we write the changelog entry for this, we should say that we've added support for the uv pip
interface.
We don't support the uv project interface yet, which @GatlenCulp mentioned in the PR description. This requires support for pyproject.toml (new issue #431). We may want to use PEP 735 dependency groups. It'll make sense to work on that in the near future—even regular Pip will be releasing support for them in their April release.
Summary
This PR integrates uv — a fast Python package and project manager written in Rust by the team that made the ruff linter — as an environment manager. Updates made to the Makefile and CLI to support this.
Key Changes
make create_environment
- Added a target to creates a virtual environment with uv and installs the requested python version using uvmake requirements
simply installs dependencies withuv pip install -r requirements.txt
which is faster than normal pip. This does not generate a lockfile and the dependencies will be removed ifuv sync
is run. (see below for more info)Testing
uv
added as an additional environment manager intest_creation.py
and a harness was added in similar style to the other environment managers. Tests passing locally.Recommendations
pyproject.toml
only. This allows for using the higher-level and convenientuv sync
oruv add
commands which generate a lockfile. This is also becoming more standard.uv add -r requirements.txt
after removing-e .
from the file will add the dependencies topyproject.toml
and generate the lockfile. This might be a better implementation formake requirements