You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR I wonder if the dependency resolution consider two different specification types (P and Q types) for a targeted dependency. If P is satisfied, then Q will be installed. One type (P type) is for environment where the dependency will be install in and the other (Q type), the identification of the dependency (e.g. its version, its installation source).
I came across this issue long time ago when I tried to specify a dependency library in different platforms. When specifying one version or source for installation the library in, say, Windows, I expect this spec will be ignored when I install my project in Mac. But it was not the case. I vaguely remember the awesome but a bit long explanation from the development team. That suggests me that it is hard to understand and remember.
A concrete example of the issue is the following
[tool.poetry.dependencies]
torch = [
# P type: platform. Q type: version and source.
{platform = "win32", version = "^2.0.1+cu118", source = "pytorch-gpu-src"},
# P type: platform. Q type: version and source.
{platform = "darwin", version = "^2.0.1", source = "pypi"},
]
and version "^2.0.1+cu118" of torch was always picked when I install my project in a Mac.
I wonder whether the dependency resolution considers two different specification types.
(P spec) One is to specify the environment surrounding the dependency, and
(Q spec) the other is the identification of the dependency (e.g. via version number or via installation source).
In analogy to logical deduction, the resolution will be: if environment satisfies the specified "conditions", then the specified "version or source" of that dependency will be chosen. That is: If P is satisfied, then Q will be installed.
Could someone point me to whether this is the case in Poetry dependency resolution?
p.s. This problem seems to be solved in poetry 1.8 anecdotally (I have not extensively tested my situation but one instance seems to work fine).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
TL;DR I wonder if the dependency resolution consider two different specification types (P and Q types) for a targeted dependency. If P is satisfied, then Q will be installed. One type (P type) is for environment where the dependency will be install in and the other (Q type), the identification of the dependency (e.g. its version, its installation source).
I came across this issue long time ago when I tried to specify a dependency library in different platforms. When specifying one version or source for installation the library in, say, Windows, I expect this spec will be ignored when I install my project in Mac. But it was not the case. I vaguely remember the awesome but a bit long explanation from the development team. That suggests me that it is hard to understand and remember.
A concrete example of the issue is the following
and version "^2.0.1+cu118" of
torch
was always picked when I install my project in a Mac.I wonder whether the dependency resolution considers two different specification types.
In analogy to logical deduction, the resolution will be: if environment satisfies the specified "conditions", then the specified "version or source" of that dependency will be chosen. That is: If P is satisfied, then Q will be installed.
Could someone point me to whether this is the case in Poetry dependency resolution?
p.s. This problem seems to be solved in poetry 1.8 anecdotally (I have not extensively tested my situation but one instance seems to work fine).
Beta Was this translation helpful? Give feedback.
All reactions