-
Notifications
You must be signed in to change notification settings - Fork 950
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
uv doesn't correctly checkout Git dependencies with Git LFS assets #3312
Comments
Same issue here. Makes uv unfortunately unusable for us since we have lfs in a private github repo. |
We actually stopped using the git2 crate so we may be able to support this easier now? cc @ibraheemdev |
Still running into this issue using uv 0.3.0.
Sample command:
Cloning the repo locally and then installing from a local path works fine too. |
Adding another workaround here. Running |
Just for reference, I tried setting the respective settings @vfilter suggested in #3312 (comment) as environment variables $ env | grep -e ^GIT_CONFIG
GIT_CONFIG_KEY_0=filter.lfs.smudge
GIT_CONFIG_VALUE_0=git-lfs smudge --skip -- %f
GIT_CONFIG_COUNT=1 which is also picked up by git
However when running @zanieb could it be that uv does not pass on the environment variables to the underlying git process? (Setting them via the config file works). |
No clue how, but setting the environment variable This old comment suggests that certain local checkouts might trigger these problems git-lfs/git-lfs#2518 (comment). Not sure whether that is the case here though. |
Hi! This issue is blocking me from adopting pixi, is there any news on this? |
This just turns off getting LFS assets btw. Also very keen for this feature |
Someone want to share a minimal reproduction for this? |
Sure.
The workaround above works, though it might not actually get the lfs-file I checked in (I didn't check). Packages that use LFS likely need their LFS files ;)
|
Another workaround option if you need LFS for other repos and don't want to manually set environment variables: Create a new file
Create or modify
This updates your Git config to skip LFS just for uv dependencies. |
Thanks!
For anyone else, if these don't work: Get you uv path using command Edit: No need to remove |
I've investigated this a bit more and I think I now understand the actual source of the error. When getting a Git revision I think it's possible to fix this by just adding a step where after the initial fetch but before the local clone The biggest issue I see with that approach is that since LFS has to check every file in a revision when fetching, it's possible that for large repositories the overhead could become non-trivial.
|
I'm working on a project that depends on a private Git repository where some of the project's assets are stored in Git LFS (in this case Pytorch models).
My project uses Rye as its package manager. When configured to use Pip, everything works as expected. When configured to use uv, the LFS objects aren't checked out correctly.
I assume a blocker for uv supporting LFS is the fact that the
git2
crate also doesn't support LFS (rust-lang/git2-rs#956) and there's no indication support will be added in the future.Platform: Ubuntu 22.04
uv version: 0.1.39
The text was updated successfully, but these errors were encountered: