-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
uv compile now shows annotations for -c and -r paths that causes issues cross platform #3800
Comments
Hmm, I think the annotation should match whatever form is used verbatim. What is the exact form used in |
Can you include a |
Oh sorry I see. You're using a relative path. Hmm... |
Simplified version of my setup:
requirements.in:
dependencies.txt
compile.bat (it contains just the commands so I use it both as a bat and sh file)
|
I would be ok with the -c being verbatim. Althought it woud be less correct i guess |
Funny thing that I just noticed: you already use |
I agree that it would be nice to be consistent here. Will look into it. |
Marking as a bug. |
I think this could be solved in the user_display method (or maybe the origin.path()). I am having issues with the rust debugger on Windows right now, but I think at this point it should be possible to acquire the path separator. uv/crates/distribution-types/src/annotation.rs Lines 31 to 36 in 3e43653
Lines 52 to 63 in bc963d1
uv/crates/pep508-rs/src/origin.rs Lines 16 to 21 in 3e43653
Here is the original PR published in v0.1.43 |
I just tried release v0.2.3 and it works perfectly. Thank you! |
Since uv 0.2.x the pip compile tool adds -r and -c annotations on the "via" part of the code, but uses windows-style paths when running on Windows, not respecting the command line on "-c".
tested both
uv 0.2.1 (1fc71ea 2024-05-22)
uv 0.2.2 (e52ae0e 2024-05-22)
See diff below

my command line is (I run from the project root):
uv pip compile ./requirements/requirements.in -o ./requirements/requirements-win.txt --python-platform=windows
I run the same command line on Windows and on my Linux CI, I make sure to always use forward slashes so outputs are compatible.
In my "requirements.in" file there is a line
-c dependencies.txt
since the file is in the same directory, I cannot prefix it with "-c requirements/dependencies.txt" so UV gets to chose how to build the path.I like having the annotations and wouldn't want to switch to "--no-annotate", but running the same command in 2 different OSs now accuses a diff in the files.
Since UV already respects the forward slashes when I pass "requirements/requirements.in", could it use the same prefix of the file containing the value when prefixing names that are relative?
The text was updated successfully, but these errors were encountered: