-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Poetry installs successfully a dependency via URL, but fails via local path #8682
Comments
installing a source distribution as a direct dependency seems to have been broken for years, if indeed it ever worked. I guess no-one is doing that, and I recommend that you don't either! |
I see. Thanks for clarifying that. It should be reflected in the documentation with a warning because it currently contains clear examples for doing just that. |
this has also been true for years, but feel free to submit a merge request |
I reckon this should fix it, if anyone wants this enough to write a testcase and submit a merge request: diff --git a/src/poetry/inspection/info.py b/src/poetry/inspection/info.py
index 2e6875aa..9d317933 100644
--- a/src/poetry/inspection/info.py
+++ b/src/poetry/inspection/info.py
@@ -319,6 +319,8 @@ class PackageInfo:
# now this is an unpacked directory we know how to deal with
new_info = cls.from_directory(path=sdist_dir)
+ new_info._source_type = "file"
+ new_info._source_url = path.resolve().as_posix()
if not info:
return new_info |
@dimbleby I ran into the same issue recently and I tried using the fixed code and somehow it doesn't help. Moreover, even if use a local wheel instead of sdist, it fails with the same AssertionError for me. It only happens on some MacOS hosts, somehow. Works fine on Linux. The command which fails is |
@dimbleby, @radoering, @aaaaahaaaaa - here are my findings and some FYI: Env is MacOS 14.x. I have found that if path contains symlinks, then the command fails no matter if I provide sdist or wheel, with the same
None .
I should mention that my use case is a testing scenario where the dependency is already present as a normal dependency, but I'm overriding it by "adding" a different version of it from a file, as a dev dependency (because adding to normal dependencies from a file is not allowed). This is part of a compatibility testing workflow I'm working on. I think the code should be changed somewhere to always resolve path before comparing, maybe For my use case I have modified my script to resolve the path before calling poetry, which solved the problem for me. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
1.7.0
3.10.12
-vvv
option) and have included the output below.Issue
Poetry successfully installs a
tar.gz
served via a URL, but if the exact same dep/file is downloaded locally, then Poetry fails to install it. I'm very confused, I'm not sure I'm missing something blatantly obvious here.Here is very straightforward way to reproduce:
Successful:
Fails:
And succesful again:
The text was updated successfully, but these errors were encountered: