question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve intersection and union of markers

See original GitHub issue

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:

  • python-poetry/poetry-core#226
  • python-poetry/poetry-core#255
  • python-poetry/poetry-core#282
  • python-poetry/poetry-core#283
  • python-poetry/poetry-core#293
  • python-poetry/poetry-core#294
  • python-poetry/poetry-core#297
  • python-poetry/poetry-core#299
  • python-poetry/poetry-core#308
  • python-poetry/poetry-core#352
  • python-poetry/poetry-core#380
  • python-poetry/poetry-core#382
  • python-poetry/poetry-core#383
  • python-poetry/poetry-core#384
  • python-poetry/poetry-core#388
  • python-poetry/poetry-core#390
  • to be continued…

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 to AnyMarker. 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 exported requirements.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.)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dimblebycommented, Feb 13, 2022

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!

0reactions
radoeringcommented, Aug 28, 2022

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 sys_platform and platform_system.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[poetry-core] intersection of markers not recognized as empty
The intersection of multi markers and marker unions is not recognized as empty for some cases. E.g., the following intersections which are empty ......
Read more >
Is there a way to reform this so that I get the INTERSECTION of ...
This means that all the markers of all selected groups are displayed, which is union of the marker groups. To have only intersection...
Read more >
Easiest/most robust to detect shape for OpenCV for ...
I want to calculate the Intersecion over Union / Jaccard Index of the actual marker and virtual marker. For the first picture it...
Read more >
Intersection tests for single marker QTL analysis can be ... - NCBI
The study was designed to reveal whether two marker tests are always more powerful than intersection tests, or whether there are cases when...
Read more >
Type Assignment for Intersections and Unions in ... - CiteSeerX
We develop a system of type assignment with intersection types, union types, indexed types, and universal and existential depen- ... tactic markers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found