-
-
Notifications
You must be signed in to change notification settings - Fork 106
Remove git env vars from uv pip install subprocess
#1355
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
Merged
j178
merged 2 commits into
j178:master
from
shaanmajid:fix/remove-git-env-from-uv-pip-install
Jan 15, 2026
Merged
Remove git env vars from uv pip install subprocess
#1355
j178
merged 2 commits into
j178:master
from
shaanmajid:fix/remove-git-env-from-uv-pip-install
Jan 15, 2026
Conversation
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
When prek runs inside a git worktree, git sets GIT_DIR pointing to the worktree's gitdir. This leaks into `uv pip install`, causing packages using setuptools_scm for file discovery to have their `git ls-files` query the wrong repository. This results in missing package data files (e.g., validate-pyproject's schema JSON files). Use the existing `remove_git_envs()` mechanism which removes all GIT_* vars except those needed for SSH/SSL/auth operations — consistent with how prek already handles its own git commands. Fixes j178#1354
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1355 +/- ##
=======================================
Coverage 90.11% 90.11%
=======================================
Files 80 80
Lines 15924 15927 +3
=======================================
+ Hits 14350 14353 +3
Misses 1574 1574 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (16.7 MiB → 16.7 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
Verifies that GIT environment variables (like GIT_DIR set in worktrees) do not leak into the uv pip install subprocess, which would break packages using setuptools_scm for file discovery. Test fails without the fix, passes with the fix.
uv pip install subprocess
Owner
|
Thanks! |
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.
Summary
uv pip installto prevent setuptools_scm file discovery failuresProblem
When prek runs inside a git worktree, git sets
GIT_DIRpointing to the worktree's gitdir. This leaks intouv pip install, causing packages usingsetuptools_scmfor file discovery to have theirgit ls-filesquery the wrong repository.This results in missing package data files (e.g.,
validate-pyproject's schema JSON files).Fixes #1354
Test Plan
mise run lintpassesvalidate-pyprojecthook now installs correctly with all 239 files in SOURCES.txt (was 44)git_env_vars_not_leaked_to_pip_install— verified it fails without the fix and passes with the fix