-
Notifications
You must be signed in to change notification settings - Fork 257
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
fix simplification of python_version
markers to AnyMarker
#838
Conversation
Fixes "Could not parse version constraint: ==*"
Reviewer's Guide by SourceryThis pull request fixes an issue where combining certain Updated class diagram for marker simplificationclassDiagram
class Marker
class SingleMarker
class AnyMarker
class MarkerUnion
class VersionUnion
Marker <|-- SingleMarker
Marker <|-- AnyMarker
Marker <|-- MarkerUnion
class _merge_single_markers {
+ _merge_single_markers(marker1: Marker, marker2: Marker, merge_class: type) : Marker
}
note for _merge_single_markers "Modified to correctly simplify python_version markers to AnyMarker when the resulting version constraints cover all possible versions."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @radoering - I've reviewed your changes - here's some feedback:
Overall Comments:
- It might be helpful to add a comment explaining why
result_constraint.is_any()
implies that the result marker should beAnyMarker()
.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Fixes
Could not parse version constraint: ==*
Resolves: python-poetry/poetry#10184
Summary by Sourcery
Fix the simplification of multiple overlapping
python_version
markers. Ensure that overlapping marker constraints are correctly merged into aMarkerUnion
instead of being incorrectly simplified to anAnyMarker
.Bug Fixes:
AnyMarker
when merging overlapping constraints. This addresses the issue where version constraints such aspython_version <= "3.6" or python_version >= "3.7"
were incorrectly simplified toAnyMarker
instead of remaining separate. This resolves parsing errors when evaluating overlapping constraints that should result in aMarkerUnion
rather than anAnyMarker
Tests:
MarkerUnion
when appropriate.