-
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
Improve intersection and union of markers #5192
Comments
I think there's a good win to be had by teaching poetry-core that "python_version" and "python_full_version" are really the same thing. It's relatively common in my experience to end up with a marker like Conceptually I'd suggest: convert both into a |
From a technical perspective I agree this is the most obvious solution. From a user's point of view I would prefer By the way, a similar but maybe more challenging case is |
As you've seen I had a crack at the version / full_version case and it seems to have turned out fairly straightforward, albeit with room for still further improvement. I think I've probably run out of ideas and enthusiasm in this area for now; not to mention that I'm already beginning to risk merge conflicts between the various MRs that are currently queued up. Over to you if you have more that you want to do - and to the maintainers to get these merged! |
Time to call this one done? |
Yeah, should be quite good now. Closing since there haven't been much improvements/fixes anymore in the last time and I can't come up with a good solution for merging |
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. |
The handling of markers offers great potential for improvement. Even if marker simplifications seem intuitive to a human being, the subject is more complex than it might seem at first glance. Thus, it's best to proceed in small steps.
This is a meta issue to keep track of these steps:
Rationale
When resolving dependencies, markers play an important role. Especially, when multiple-constraints-dependencies come into play, overrides with contradicting markers should be ignored to avoid unnecessary failures in dependency resolution and speed up the resolution. See #4695 for details. In order to detect contradicting markers, intersections of markers that cannot be fulfilled have to be simplified to
EmptyMarker
. Analoguous, unions of markers that are always fulfilled have to be simplified toAnyMarker
. At the moment, markers are not always simplified enough so that poetry is not able to detect if a marker can never be fulfilled (empty marker) or is always fulfilled (any marker).Apart from this use case, simplifying markers seems to be mainly a cosmetic issue when looking into
poetry.lock
or an exportedrequirements.txt
. (When checking if a dependency has to be installed in the current environment, it does not matter if a marker has been simplified or not.)The text was updated successfully, but these errors were encountered: