-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Opt-out tool.uv.sources
support for uv add
#4406
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
Conversation
4d0713f
to
d6865e0
Compare
7ce7ef0
to
6d478ad
Compare
6d478ad
to
4dd414c
Compare
url: url.to_url(), | ||
subdirectory: subdirectory | ||
.map(|path| { | ||
let path = path.to_str().ok_or(SourceError::InvalidPath)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We normally just do to_string_lossy
and skip the error handling
source = "git+https://github.com/astral-test/uv-public-pypackage?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979" | ||
source = "git+https://github.com/astral-test/uv-public-pypackage?tag=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd that the lockfile is different, shouldn't we disambiguate before locking (or merge all to rev)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #4417.
Summary
After this change,
uv add
will try to usetool.uv.sources
for all source requirements. If a source cannot be resolved, i.e. an ambiguous Git reference is provided, it will error. Git references can be specified with the--tag
,--branch
, or--rev
arguments. Editables are also supported with--editable
.Users can opt-out of
tool.uv.sources
support with the--raw
flag, which will force uv to useproject.dependencies
.Part of #3959.