-
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
Solver fails when dependency has multiple (constrained) dependency definitions for same package #5378
Comments
The dependency on `python-vlc` is (somewhat) duplicated in `setup.cfg`. This causes the Poetry package manager to bail out when adding PsychoPy as a dependency (likely due to a bug in Poetry, see python-poetry/poetry#5378). This commit simplifies/unifies the `python-vlc` dependency definitions, retaining the semantics of the original ones. See: python-poetry/poetry#5378 See: 8692b9c See: psychopy#4613 See: d5c366e See: psychopy#4059
I'm having a similar (but less easily fixable) issue with installing different versions of numpy depending on the python version ( The issue can be seen here, which is part of this commit to this pull request to pyserde. The current version of this test (in the links above) is
But I've also tried splitting up the python versions to separate lines, as well as using, e.g.,
When running update, poetry attempts to install two versions of numpy (1.21.6 and 1.22.3) simultaneously, at least with the first example. With other variations, the behavior varies, but is never what I want (1.21.x on 3.7, 1.22.x on >3.8) If you feel this is a different issue, please let me know and I'll open a new issue. |
Your first example is not solvable. Unfortunately, poetry solves it anyway. From PEP 440:
Thus, numpy < 1.22 is required for python 3.7, 3.8 and so on. However, numpy >= 1.22 is required for python 3.8, 3.9, ... That's a conflict! At the moment poetry is not good at handling multiple constraints with overlapping markers. There is already an issue about that: #5066. Your second example looks better but is running into this issue: #3444 |
Thanks--I had forgotten the details of numpy = [
{ version = "<1.22.0", markers = "python_version ~= '3.7.0' and (extra == 'numpy' or extra == 'all')", optional = true },
{ version = "^1.22.0", markers = "python_version ~= '3.8' and (extra == 'numpy' or extra == 'all')", optional = true },
] seems like it should work, but it still tries to to upgrade to 1.22 on python 3.7, despite the [[package]]
name = "numpy"
version = "1.21.1"
description = "NumPy is the fundamental package for array computing with Python."
category = "main"
optional = false
python-versions = ">=3.7"
[[package]]
name = "numpy"
version = "1.21.6"
description = "NumPy is the fundamental package for array computing with Python."
category = "main"
optional = false
python-versions = ">=3.7,<3.11"
[[package]]
name = "numpy"
version = "1.22.3"
description = "NumPy is the fundamental package for array computing with Python."
category = "main"
optional = false
python-versions = ">=3.8" I'll also note that |
Considering your updated example without any other dependencies everything seems fine. That's what I get when running
I tried The |
Thanks. I'll try to explore further why I'm getting different behavior. Just to check, what version of poetry are you using? I'm using |
I used |
@radoering the That said, it doesn't make sense that I have |
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).pip
)Just including the file (which is the output of a simple `poetry init` accepting all defaults):
Issue
When trying to
poetry add psychopy
, which currently (rightfully) selects version 2022.1.2, the solver bails out:(verbose backtrace below)
This is (likely) caused by a bit of a weird dependency listing for
python-vlc
in the package (from https://github.com/psychopy/psychopy/blob/2022.1.2/setup.cfg):Of course this reduces to
and indeed, when making this change in a local fork and
poetry add
'ing this directory,poetry
is able to resolve all dependencies and install the package.Hence, it appears odd is going on when the same package is declared as a dependency with platform constraints multiple times.
Full backtrace
The text was updated successfully, but these errors were encountered: