Skip to content

uv add fails if UV_GIT_LFS=1 #17083

@kod-kristoff

Description

@kod-kristoff

Summary

I can't add dependencies with uv add, all fails with trying to resolve the name as a Git repository.

> uv init uv-import
> cd uv-import
> uv add setuptools
error: `setuptools` did not resolve to a Git repository, but a Git extension (`--lfs`) was provided.
> uv add pandas
error: `pandas` did not resolve to a Git repository, but a Git extension (`--lfs`) was provided.

UPDATE: If I run unset UV_GIT_LFS, the problem is resolved.

With -vvv:

> uv add -vvv setuptools
DEBUG uv 0.9.17 (2b5d65e61 2025-12-09)
TRACE Checking lock for `/home/-/.cache/uv` at `/home/-/.cache/uv/.lock`
DEBUG Acquired shared lock for `/home/-/.cache/uv`
DEBUG Found project root: `/home/-/projekt/work/uv-test`
DEBUG No workspace root found, using project root
TRACE Checking lock for `/home/-/projekt/work/uv-test` at `/tmp/uv-43e8c4775b984fd5.lock`
DEBUG Acquired exclusive lock for `/home/-/projekt/work/uv-test`
DEBUG Reading Python requests from version file at `/home/-/projekt/work/uv-test/.python-version`
DEBUG Using Python request `3.11` from version file at `.python-version`
DEBUG Checking for Python environment at: `.venv`
TRACE Found cached interpreter info for Python 3.11.6, skipping query of: .venv/bin/python3
DEBUG The project environment's Python version satisfies the request: `Python 3.11`
TRACE The project environment's Python version meets the Python requirement: `>=3.11`
TRACE The virtual environment's Python interpreter meets the Python preference: `prefer managed`
DEBUG Released lock at `/tmp/uv-43e8c4775b984fd5.lock`
TRACE Checking lock for `.venv` at `.venv/.lock`
DEBUG Acquired exclusive lock for `.venv`
DEBUG Released lock at `/home/-/projekt/work/uv-test/.venv/.lock`
DEBUG Released lock at `/home/-/.cache/uv/.lock`
TRACE Error trace: `setuptools` did not resolve to a Git repository, but a Git extension (`--lfs`) was provided.
error: `setuptools` did not resolve to a Git repository, but a Git extension (`--lfs`) was provided.

Expected behavoiur: The given package is added to pyproject.toml and installed in .venv.

Workaround: Add it manually to pyproject.toml and run uv sync

Platform

Linux 6.17.9-arch1-1 x86_64 GNU/Linux (Arch Linux)

Version

uv 0.9.17 (2b5d65e 2025-12-09)

Python version

Python 3.11.6, Python 3.13.11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions