Skip to content

preserver marker order at union#383

Merged
neersighted merged 1 commit intopython-poetry:mainfrom
dimbleby:preserve-marker-order
May 30, 2022
Merged

preserver marker order at union#383
neersighted merged 1 commit intopython-poetry:mainfrom
dimbleby:preserve-marker-order

Conversation

@dimbleby
Copy link
Contributor

@dimbleby dimbleby commented May 30, 2022

per python-poetry/poetry#5721, use of a set made the representation of markers non-deterministic.

A set is really the appropriate data structure, and this change is a bit of an uglification. But the number of elements in a marker union is very rarely going to be more than, say, 5 - so I doubt that efficiency is an issue.

An alternative that I considered was to try and impose an ordering in the __str__, but:

  • markers don't order
  • could do it alphabetically, but that's going to cause significantly more damage to existing unit tests than I would like to have to deal with...

I also decided that unit test wasn't very useful: a regression in the exact same way doesn't seem very likely. Can add the testcase from python-poetry/poetry#5721 if anyone thinks it's worth the trouble

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@neersighted neersighted merged commit e016bd3 into python-poetry:main May 30, 2022
@dimbleby dimbleby deleted the preserve-marker-order branch May 30, 2022 20:43
@radoering radoering mentioned this pull request Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants