-
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 doesn't handle transitive dependencies correctly if they are Python version dependant #2405
Comments
I think I have a similar issue. Let me know if I should file it separately or not.
|
Same here. FYI @stephsamson @sdispater |
and here |
@peterdeme @psaghelyi Could you try with the latest prerelease of poetry |
Similar issue with version 1.1.4 - fails on
The same command succeeds if you lock, and then install:
|
PTAL @dimbleby @radoering |
can't reproduce the original problem, subsequent comments are nothing to do with that original problem. Recommend closing out with an invitation to open a new issue if needed. (And in that case please provide a concrete reproduction, all this "package A", "package B", "package C" stuff is a real pain for anyone else to work with - let's have an actual (non)working |
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. |
-vvv
option).Issue
Let's say you have package_A that depends on package_B, which depends on different version's of package_C depending on Python's version, like so:
package_A's pyproject.toml:
package_B's setup.py (I've come across this problem where the dependency uses setup.py, but there shouldn't be a difference if the dependency uses Poetry):
Now, if you try to
poetry install
package_A, package_C will not get installed along with the other dependencies, but the installation still might be successful, because when Poetry installs the root package after the dependencies, it issuespip install -e
, which will install package_C then. However, if package_C is in a private package index, the installation will fail as the--extra-index-url
is not used to install the root package, and pip will not find the package on PyPi.What happens under the hood is, that Poetry will try to solve the dependency graph first for Python 2 and in order to save resources it will cache packages in memory. This package object stores its requirements in a list (
.requires
). package_C will be a duplicate in this list for package_B. When it solves the graph the incompatible one will get removed, and the new, cleaned dependency list will be put back to the package's.requires
field without cloning the original package, therefore the cached package's requirements will be overwritten as well.By the next iteration when Poetry tries to solve for Python 3, it will find an incomplete requirement list for package_B, and package_C will not get installed.
Solution
Cloning the package object around here should solve the problem.
The text was updated successfully, but these errors were encountered: