-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Can't add relative path dependencies in virtual project #912
Comments
it's possible that #897 caused this bug |
I'm struggling to construct a
The only workaround I've found is to force using absolute path on Windows, as shown in the original commit of #897. |
I see. Maybe we should avoid using the Url type if it can't represent this on Windows, maybe we can do so only for relative paths? I could look into that kind of change. |
Uv supports relative paths directly, astral-sh/uv#1027 but that's a divergence from pip and requirements syntax I think |
Reverting just #897 doesn't help, there's also a change related to uv that contributes to this. The Using relative paths instead of these strange URLs is viable at least if using only uv in the future, otherwise these URLs seem like the most "portable" way to handle relative paths right now. One reason is that pip install from requirements files accepts lines like "foo @ file:///some/url" but not "foo @ /some/path" It would be good to update the pep508_rs crate and use VerbatimUrl in the new version (assuming it can do this better?), but it's not a trivial upgrade. |
Hey ! Just following up on this, I'm trying to add a module with a relative path, but I end up either with a broken path, or with an absolute path (which obviously can't be put inside of a git repository for anyone to work on). Here the details of what I want to do. Command :
Output :
The following command will work, but, as the parameter suggest, it will create an absolute path in the Command :
Pyproject content :
Would love for the solution that @bluss wrote in #928 to at least be reviewed if possible. In my case this feature is important for me, and I would love to use Rye on my project ! 🙏 Thanks! |
@redat00 The workaround I think you can use right now is to update the pyproject.toml directly, the problem here is with rye add and not other parts of needed steps (like rye sync) - at least I don't know of any problems there. Consider if you want to use a (non virtual) pdm build backend for the root instead, since then it should be more well defined how standard Python tools will treat your pyproject.toml-defined project. |
Indeed I was able to make it work with the latest version of Rye by manually adding the following :
Thanks ! |
Steps to Reproduce
Expected Result
In rye 0.29, it adds the dependency
"a @ file:///${PROJECT_ROOT}/../a",
to the virtual project (here "main2").Note that a virtual project like main2 or a build_system=pdm project behave the same way, they both use the PROJECT_ROOT relative paths.
Actual Result
Error message
Version Info
rye 0.30.0
commit: 0.30.0 (c7cbdd9 2024-03-19)
platform: linux (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true
Stacktrace
No response
The text was updated successfully, but these errors were encountered: