Add support for uv-based venvs/install via PRE_COMMIT_USE_UV#3131
Closed
akx wants to merge 1 commit intopre-commit:mainfrom
Closed
Add support for uv-based venvs/install via PRE_COMMIT_USE_UV#3131akx wants to merge 1 commit intopre-commit:mainfrom
uv-based venvs/install via PRE_COMMIT_USE_UV#3131akx wants to merge 1 commit intopre-commit:mainfrom
Conversation
Member
|
please discuss features first before wasting time on implementation this is unlikely to make a significant difference but greatly increases complexity so I am declining it |
Author
Sorry, I didn't see that discussion was required for PRs (can't seem to find that in the contribution guidelines either). If it makes you feel better, I only spent 20 minutes on this. 😄
I'd disagree on "greatly", but as you like. |
Member
|
the issue tracker is not an advertisement portal for unsupported hacks |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 adds opt-in support for creating Python virtualenvs (and installing dependencies within them) using uv, using the environment variable
PRE_COMMIT_USE_UV(in the vein ofPRE_COMMIT_USE_MAMBAorPRE_COMMIT_USE_MICROMAMBA).There are some caveats related to uv's freshness (see comments in code), but this seems to work.
On my machine, this seems to make setting up Python environments quite a bit faster (which, of course, should not happen very often, but when it does, it's nice that it happens a bit quicker).