-
Notifications
You must be signed in to change notification settings - Fork 261
markers: recognize empty python_version
markers
#849
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
markers: recognize empty python_version
markers
#849
Conversation
Reviewer's Guide by SourceryThis pull request fixes an issue where the intersection of certain Updated class diagram for markersclassDiagram
class Marker {
<<Abstract>>
+name: str
+value: str
}
class EmptyMarker {
+EmptyMarker()
}
Marker <|-- EmptyMarker
class _merge_single_markers {
+marker1: Marker
+marker2: Marker
+merge_class: type
+result_constraint: Constraint
+result_marker: Marker
}
note for _merge_single_markers "Modified to detect empty python_version intersections"
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:
- The added tests cover a good range of scenarios for empty marker intersections.
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.
('python_version == "3.6"', 'python_version == "3.7"'), | ||
('python_version > "3.6"', 'python_version <= "3.6"'), | ||
('python_version >= "3.6"', 'python_version < "3.6"'), | ||
('python_version > "3.6"', 'python_version < "3.7"'), |
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.
The last test is the relevant one but since I did not find such a basic test function that tests for empty single marker intersections, I just added some additional tests.
( | ||
'python_version > "3.6" and python_full_version < "3.6.2"', | ||
'python_version > "3.6" and python_version < "3.7"', | ||
'python_version > "3.6" and python_version < "3.7"', | ||
), |
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.
The test does not make sense because both markers are empty. Similar (but correct) tests are above and below.
@@ -2260,16 +2271,16 @@ def test_intersection_no_endless_recursion() -> None: | |||
' and extra != "postgis"' | |||
) | |||
m2 = parse_marker( | |||
'python_version > "3.12" and python_version < "3.13" or extra != "databricks"' | |||
'python_version >= "3.12" and python_version < "3.13" or extra != "databricks"' |
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.
The original marker is actually empty and does not trigger a potential endless recursion anymore. I checked that the changed marker triggers the recursion error without the fix from #832.
Without this fix, the intersection of `python_version > "3.8"` and `python_version < "3.9"` is not detected as empty marker.
2676413
to
8a95477
Compare
Without this fix, the intersection of
python_version > "3.8"
andpython_version < "3.9"
is not detected as empty marker.Related to: python-poetry/poetry#10249
Summary by Sourcery
Tests: