-
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
enviroment markers ignored when multiple version options coexist with legacy source #6710
enviroment markers ignored when multiple version options coexist with legacy source #6710
Comments
Duplicates #5205 (comment). Will be fixed in upcoming 1.3 via #6679 |
#6679 does not appear to resolve this. This morning I installed Poetry from master:
The self-reported version is only Using the same pyproject.toml linked in the original comment:
The lockfile format has changed a lot and it does seem to keep them separate as indicated in #6679, but the net effect is the same. poetry.lock
|
So at install time when looking in the lockfile for something that satisfies I don't see anything much to be done about this. |
But shouldn't we consider the locked package source? |
At installation time poetry is presented with the following puzzle: "install Considering only version constraints and markers the |
I agree that PyTorch's packaging is a bit odd and the whole Edit to respond:
It doesn't seem to be considering the markers, because |
The intention was to keep them separate as per #6679 -- they are interchangeable versions, but I should be able to specify two identical package specs from different sources, and get the correct version from the specified source based on my multiple constraint markers. |
hmm, maybe some sort of fix around https://github.com/python-poetry/poetry/blob/master/src/poetry/puzzle/provider.py#L860-L864 could work |
maybe as simple as --- a/src/poetry/puzzle/provider.py
+++ b/src/poetry/puzzle/provider.py
@@ -859,7 +859,7 @@ class Provider:
# the complete_name (including features).
dependency.name == package.name
and (
- dependency.source_type is None
+ (dependency.source_type is None and dependency.source_name is None)
or dependency.is_same_source_as(package)
)
and dependency.constraint.allows(package.version) ?? where the condition being tweaked represents "the dependency doesn't care from what source it is satisfied" But I'll leave it to someone more motivated to add a unit test proving the point |
actually I think it's all a bigger mess than that
ugh... |
The other PR is still required for a fix. |
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) and have included the output below.Possibly related: #3561, #6215, #5506,
Issue
When I attempt
poetry install
on macOS, Poetry tries to installtorch=1.11.0+cpu
, which does not have appropriate native builds:If I remove the non-Darwin option and leave only this one:
Poetry installs it without issue.
If I instead replace the non-PyPI option with some other, distinct option and remove the
pytorch
legacy source:(note the version and source are different from the original non-Darwin option)
I can then freely change around the
markers
on both versions and reinstall and it will always select the intended version according to the rules.The behavior of apparently ignoring
markers
only seems to happen when the source is not PyPI.The non-Darwin source is used in a Docker build, and, if I remove the multiple options and simply set
torch = "1.11.0+cpu"
, I am able to correctly installtorch==1.11.0+cpu
in my Docker build using this source configuration.The text was updated successfully, but these errors were encountered: