Closed Xmaster6y closed 1 month ago
Thank you for the well-written report!
As a note, 7c3865d
is the head commit on main
and the upstream fork (but not the original repository)
Puzzling edit:
I previously add:
uv add git+https://github.com/astral-sh/ruff --branch sys-version-info
giving:
Updated https://github.com/astral-sh/ruff (bb12fe9d0)
Updated https://github.com/astral-sh/ruff (61a5a86a7)
...
But now:
uv add git+https://github.com/astral-sh/ruff --branch sys-version-info
giving:
Updated https://github.com/astral-sh/ruff (bb12fe9d0)
...
The difference in behavior appears to be because of https://github.com/astral-sh/uv/blob/cafc1f986a6efda0c2f384e63930333a812c9ea4/crates/uv/src/commands/project/add.rs#L241-L242
We only pass the requirements
in here and when you use the --branch
syntax the source is tracked separately from the package requirement.
[crates/uv/src/commands/project/add.rs:240:5] &requirements = [
Package(
"git+https://github.com/Xmaster6y/vec_noise",
),
]
Is this wanted/expected?
My later observation seems unrelated to my first issue
This happen when my uv.lock
is not sync.
Run (should break, otherwise interupt it mid-course):
uv add git+https://github.com/astral-sh/ruff --branch sys-version-info
Run the command again (not calling uv sync/lock
):
uv add git+https://github.com/astral-sh/ruff --branch sys-version-info
Does it deserve another issue?
We later fail at
If you name the dependency, the correct revision is resolved
❯ uv add vec_noise@git+https://github.com/Xmaster6y/vec_noise --branch refacto
Updated https://github.com/Xmaster6y/vec_noise (1e281ec)
Is this wanted/expected?
No, I don't think the behavior we're seeing is wanted or expected. I'm just debugging and sharing some notes.
Problem
uv
doesn't resolve the good commit when using--branch <branch>
but@<branch>
does (the repo: https://github.com/Xmaster6y/vec_noise)When I use:
I get (good rev):
But when I use:
I get:
Same for
--rev
Using
gives :
Specificities
What didn't work
Details
uv
version: uv 0.4.10 (690716484 2024-09-13)