Open eth3lbert opened 3 months ago
I believe this was added intentionally (per https://github.com/astral-sh/uv/issues/5339). Maybe what we need is a way to provide "no version specifier" on the command-line?
I believe this was added intentionally (per #5339). Maybe what we need is a way to provide "no version specifier" on the command-line?
Yes, that should work as well. I don't have a preference.
Here are some of my findings and thoughts that make sense to me:
Git source might better not specify a version and the actual version should be determined after resolving it?
uv pip install "httpx < 0.24.1 @ git+https://github.com/encode/httpx"
are already disallowed, it makes more sense to simply use the version resolved from the provided git source. Additionally, other package managers seem to work similarly, using the resolved version from the provided git source.In the second step, uv add "httpx < 0.24.1"
adds a version specifier onto an existing git source package. Perhaps we should consider converting it to a normal package with a version specifier, no longer treating it as a git source?
cargo
, poetry
, and pdm
.If we already added a package with a version specifier, for example, httpx < 0.24.1
, and then run uv add "httpx"
, what should happen? This behavior differs between package managers and requires further discussion. (This also applies to git source.)
poetry
would inform you that you already have it installed.pdm
would update it to the latest version using >=
.cargo
would keep the existing version, although it might display cargo add
but its the the same version constraint.What are your thoughts?
Let consider the following process:
After running
uv init
, perform the following actions:git URL
andtag
.version specifier
.git URL
(theversion specifier
is retained, and thetag
is removed from the source).In the end, the previously added
version specifier
is retained, and there's currently no way to overwrite it without manually editing the file or removing and re-adding the package.I'm not sure if this behavior is intentional or a bug.
Related #5339