-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Git LFS support to
uv-git
crate (#10335)
## Summary Closes #3312. This PR adds Git LFS support to the `uv-git` crate by using the `git-lfs` CLI to fetch required LFS objects for a revision following the call to `git fetch`. The LFS fetch step is disabled by default and only enabled if the environment variable `UV_GIT_LFS` is set. When enabled, the LFS fetch step is run for all repositories regardless of whether they have associated LFS objects. The step is skipped if the `git-lfs` CLI tool isn't installed. ## Test Plan I verified that the minimal example in the linked issue passes, i.e. this command now succeeds: ```sh UV_GIT_LFS=1 uv pip install git+https://github.com/grebnetiew/lfs-py.git ``` I also verified that non-LFS repositories still work, with or without `git-lfs` installed. ### To Replicate Attempt to use uv to install a Git dependency that contains LFS objects (e.g. `uv pip install git+https://github.com/grebnetiew/lfs-py.git`). This should fail with a smudge filter error. Re-run the same command with the added environment variable `UV_GIT_LFS=1`. The install should now succeed. ## Potential Changes / Improvements ~With this change LFS objects in a given revision will always be downloaded if the user has Git LFS installed, which may not always be desired behavior. It might be helpful to add a field to the `uv` settings and/or an environment variable so that the LFS step can be disabled if needed.~ Enabling/disabled via environment variable has now been implemented. --------- Co-authored-by: Sydney Duckworth <sydduckworth@users.noreply.github.com> Co-authored-by: Zanie Blue <contact@zanie.dev>
- Loading branch information
1 parent
b6aa40b
commit 97c1877
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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