-
Notifications
You must be signed in to change notification settings - Fork 11
warning: VIRTUAL_ENV ignored #36
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
Comments
Maybe something like a hidden uv option |
How is the uv command being invoked? Can the |
I don't think so. :-( If I just naively modify the hook entry here uv-pre-commit/.pre-commit-hooks.yaml Line 14 in 6ebd8b3
to entry: VIRTUAL_ENV= uv lock pre-commit will fail even before the actual invocation since it does a bunch of cmd normalization that assumes that the first entry argument is an executable. e.g. |
I think you'd use
|
Ah, sorry, should have searched better. But as the last commenter on that issue mentions, is that portable? I briefly went through theany related iasues on the pre-commit issue tracker and haven't seen a workaround that would be portable (but my knowledge of how Windows does things is minimal so I might be wrong) |
I'm not sure, but that seems like a pre-commit issue? Not letting people set environment variables in a cross-platform way seems problematic and I'm hesitant to go out of my way to account for that. I suppose if I land astral-sh/uv#11189 I can add a |
Oh yeah, totally agree, and I am not trying to push for a solution from a
uv side, just documenting my findings. At the same time, it's quite clear
that the feature has been requested, and rejected, on the pre-commit issue
tracker many times, so that's a dead end, sigh.
…On Mon, Feb 3, 2025, 23:37 Zanie Blue ***@***.***> wrote:
I'm not sure, but that seems like a pre-commit issue?
I suppose if I land astral-sh/uv#11189
<astral-sh/uv#11189> I can add a --no-active
option which would silence the warning.
—
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACIY64PJ7OD3S4NPHORACY32N74SPAVCNFSM6AAAAABU6YMDP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZSGQYTSNBSGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…ive` (#11251) Follow-up to #11189 Closes astral-sh/uv-pre-commit#36
Add `--no-active` option to `uv-sync` to ignore the pre-commit virtual env. Closes #36. As far as I can tell, the other hooks don't support/need this option, but would like that confirmed. ### Testing To test this PR, add the following to `.pre-commit-config.yaml` ``` - repo: https://github.com/danielhollas/uv-pre-commit rev: fc377b7 hooks: - id: uv-sync verbose: true stages: [pre-commit] ``` and run ```console pre-commit run -a uv-sync ``` No warning should be printed.
When running uv 0.5.16 using this pre-commit hook I get the following warning:
I understand why the warning is there, but I suspect it could be quite confusing for new users. It would be great if this warning could be somehow disabled when uv is run within pre-commit virtual environment.
The text was updated successfully, but these errors were encountered: