markers: recognize empty python_version markers#849
markers: recognize empty python_version markers#849radoering merged 1 commit intopython-poetry:mainfrom
python_version markers#849Conversation
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.
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.
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.
The test does not make sense because both markers are empty. Similar (but correct) tests are above and below.
| ) | ||
| 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.
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: