uv add
silently ignores --editable
when used with a Git/VCS dependency
#10992
Labels
bug
Something isn't working
Summary
Hi
Currently
uv add
will silently drop the--editable
option when used with a VCS URL, rather than warning or erroring about it not being supported.This is low priority - I just happened to spot it as part of porting some of our existing pip/Poetry/Pipenv tests to uv.
Steps
uv init testcase && cd $_ && uv add --editable 'git+https://github.com/benoitc/gunicorn'
rg git pyproject.toml
Actual
uv add
silently ignores--editable
and adds the dependency to[tool.uv.sources]
inpyproject.toml
without theeditable = true
:I checked the docs here but they don't mention that editable mode isn't supported for VCS/Git dependencies:
https://docs.astral.sh/uv/concepts/projects/dependencies/#editable-dependencies
https://docs.astral.sh/uv/reference/cli/#uv-add
I only found out it wasn't supported by manually adding
editable = true
to the gunicorn entry in[tool.uv.sources]
, which then resulted in this error:After some GitHub issue searching I found this which suggests this combination is intentionally not supported (which makes sense; it is a bit of a counter-intuitive combination):
#5442
Expected
One of:
uv add
to fail, with an error message saying ~"--editable cannot be used with VCS/Git dependencies"
uv add
to succeed, and omit theeditable = true
from the entry added to[tool.uv.sources]
, but emit a warning saying ~"ignoring --editable since it's not supported when using VCS/Git dependencies"
For example, when using the
uv pip
interface, an error message is given:It would also be good to document that editable is only supported for path dependencies, at:
https://docs.astral.sh/uv/concepts/projects/dependencies/#editable-dependencies
https://docs.astral.sh/uv/reference/cli/#uv-add
https://docs.astral.sh/uv/pip/packages/#editable-packages
Plus it looks like this difference between
pip
anduv pip
is missing from:https://docs.astral.sh/uv/pip/compatibility/
Context
I'm writing initial testcases for our support of uv, based on those I have already for our pip/Poetry/Pipenv support - one of which tests editable VCS installations, since:
.pth
files, which has been known to need adjustments across package manager and/or setuptools version changes, so I'm extra cautious with testingPlatform
macOS 15.2 ARM
Version
uv 0.5.24 (Homebrew 2025-01-23)
Python version
3.12.8
The text was updated successfully, but these errors were encountered: