-
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
improve reduce_by_python_constraint
#841
improve reduce_by_python_constraint
#841
Conversation
Reviewer's Guide by SourceryThis pull request enhances the Sequence diagram for reduce_by_python_constraint methodsequenceDiagram
participant Marker as M
participant VersionConstraint as VC
M->>M: reduce_by_python_constraint(python_constraint: VC)
alt self.name in PYTHON_VERSION_MARKERS
M->>M: get_python_constraint_from_marker()
M->>VC: allows_any(python_constraint)
alt not constraint.allows_any(python_constraint)
M-->>M: return EmptyMarker()
else constraint.allows_any(python_constraint)
M->>M: create_nested_marker("python_version", python_constraint)
M->>M: parse_marker()
M->>M: intersect(python_marker)
alt isinstance(intersection, SingleMarker)
M-->>M: return intersection
end
end
end
M-->>M: return self
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 looks like you're importing
create_nested_marker
twice - you only need to import it once. - Consider adding a comment explaining the logic behind intersecting with
python_marker
.
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.
cacc856
to
5e46abc
Compare
Related to: python-poetry/poetry#10195
Summary by Sourcery
This pull request enhances the
reduce_by_python_constraint
function to improve its accuracy when dealing with Python version constraints. It also adds new test cases to ensure the correctness of the changes.Enhancements:
reduce_by_python_constraint
function to better handle version constraints, especially when intersecting withpython_version
markers.Tests: