-
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
Multiple constraints dependencies collapsing with groups #10034
Comments
seems like you have been relying on an implementation detail that happened to land one way at some point the solution that poetry finds seems completely correct per the metadata for the associated packages, no? if you have stronger constraints about which versions of pandas etc should be installed at which versions of python - eg lower bounds - then you should express those constraints in your dependencies. |
I agree that pandas poetry gracefully resolving per-version is one of its best features, so it's a shame to see it fall over like this |
"a little strange" is about the strongest thing one could say about it. It has always been the case that the solver takes choices during its search and different solutions are possible according to quite arbitrary things. And the answer has always been: if you wanted a different solution, set constraints to tell the solver what you want. |
My apologies, I didn't mean to incite anything, just checking whether I've finally gone crazy :) Checking the output of With extras:
Without extras:
I'm going to see if I can track down that implementation detail |
# Too complicated to handle with overrides,
# fallback to basic handling without overrides. Sounds about right, a general solution for this would probably be very complicated. At least the feature the implementation change enabled is very cool: I wonder if it's possible to harmlessly adjust the |
Replacing this: if all(len(d) == 1 for d in duplicates_by_extras.values()) and all(
d1[0].marker.intersect(d2[0].marker).is_empty()
for d1, d2 in itertools.combinations(
duplicates_by_extras.values(), 2
)
):
# Since all markers are mutually exclusive,
# we can trigger overrides.
deps = list(itertools.chain(*duplicates_by_extras.values())) with this: if True:
# Proceed at your own risk.
deps = list(itertools.chain(*duplicates_by_extras.values())) Brings back the results I'm used to, at the cost of a few orders of magnitude in puzzle solving time, ( |
Description
A
pyproject.toml
using Poetry style dependencies, with a single requirement having different extras across multiple groups, will unhelpfully collapse all the version-specific requirements.Before version 2, the different versions would all be expressed in the
poetry.lock
, but after version 2 only the lowest version is kept in the lockfile.This causes a lot of issues downstream when installing to multiple Python versions, because the test pipeline assumes that wheels will be available for the locked version.
Failing example
pyproject.toml
:Failing
poetry.lock
:Changing the requirements to remove the hdf:
Expected
poetry.lock
:Workarounds
Remove extras, not much of a workaround though...
Poetry Installation Method
pipx
Operating System
MacOS 15.2
Poetry Version
Poetry (version 2.0.1)
Poetry Configuration
Python Sysconfig
sysconfig.log
Example pyproject.toml
Poetry Runtime Logs
poetry-runtime.log
The text was updated successfully, but these errors were encountered: