-
Notifications
You must be signed in to change notification settings - Fork 958
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
pip interop for relative packages #2635
Comments
When I used |
We accept relative URLs for direct references, so you can do like |
I tried
The question is how to get a configuration which works with both pip and uv. |
Yeah, unfortunately |
Then I have to inject it each time or write a wrapper script. So the easiest way would be to ask pip to add a default for PROJECT_ROOT variable. |
When I use uv pip install -e .
error: Failed to build editables
Caused by: Failed to parse metadata from built wheel
Caused by: relative path without a working directory: localhost//abs/path/dir/package#egg=sub_package
package @ file://localhost//abs/path/dir/package#egg=sub_package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
I assume it is wrongly treated as a relative path by pep508-rs crate even though it is a pep440 link. uv/crates/pep508-rs/src/verbatim_url.rs Line 106 in 7a5571f
|
Why include |
It is an assumed default by pep 440 https://peps.python.org/pep-0440/#file-urls Without it - error in main-package setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid URL given P.S.: the value is |
Thanks, we're probably just missing handling for that, although I think the problem is your |
Actually yes. I removed it and it solved the problem. Thank you very much for your time and patience. P.S.: even the egg part works with uv --version 0.1.24 |
I filed an issue for the |
Now I don't know your project, but in general about ${PROJECT_ROOT}, there are package systems that support that variable in dependencies and can create packages using it that pip can install, and setuptools is not one of them. The general thinking would be to use a package builder that supports relative path references like that. But I'll be careful and say I don't know which way works simultaneously in both pip and uv. The way I would currently do that works in pip but falls afoul of #1808 in uv (for a file URL). (Edit: Now those problems seem to be fixed already 😉 @charliermarsh ) |
Hi!
FIrst, I wish to say that uv is an amazing tool and works blazingly fast.
I am working with an existing legacy setup and trying to use uv as a local replacement for pip.
The biggest complication with that legacy setup that it requires a package from a local relative path.
I have to use https://peps.python.org/pep-0440/#direct-references for it.
In the issues I have found that I can use
${PROJECT_ROOT}
for the uv. But it is not really an environment variable and it is not set at the time of loading 'setup.py' file.In the end I got something like this
Is there any better way to do this?
The text was updated successfully, but these errors were encountered: