add has_upper_bound method to VersionConstraint#833
Merged
abn merged 1 commit intopython-poetry:mainfrom Feb 7, 2025
Merged
Conversation
Reviewer's Guide by SourceryThis pull request adds a Class diagram for VersionConstraint hierarchy with new has_upper_bound methodclassDiagram
class VersionConstraint {
<<abstract>>
+is_any(): bool
+is_simple(): bool
+has_upper_bound(): bool
+allows(version: Version): bool
}
class EmptyConstraint {
+is_any(): bool
+is_simple(): bool
+has_upper_bound(): bool
+allows(version: Version): bool
}
class VersionRangeConstraint {
+allowed_max(): Version
+has_upper_bound(): bool
+allows_lower(other: VersionRangeConstraint): bool
}
class VersionUnion {
-_ranges: List[VersionConstraint]
+is_any(): bool
+is_simple(): bool
+has_upper_bound(): bool
+allows(version: Version): bool
}
VersionConstraint <|-- EmptyConstraint
VersionConstraint <|-- VersionRangeConstraint
VersionConstraint <|-- VersionUnion
note for VersionConstraint "New abstract method has_upper_bound added"
note for EmptyConstraint "Always returns True"
note for VersionRangeConstraint "Returns True if max is not None"
note for VersionUnion "Returns True if all constraints have upper bounds"
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 and found some issues that need to be addressed.
Blocking issues:
- The has_upper_bound() implementation is incorrect - it returns True when any constraint has no upper bound (link)
Overall Comments:
- The
has_upper_bound()implementation in VersionUnion appears incorrect. It should return true only if ALL ranges have upper bounds, not if ANY range lacks an upper bound. The current logic is inverted. - Documentation is missing for the new
has_upper_bound()method. Please add docstrings explaining the method's purpose and behavior.
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue
- 🟢 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.
1b89b47 to
b8be63c
Compare
Member
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @radoering - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please add documentation (docstrings) for the new has_upper_bound method explaining what it means for a version constraint to have an upper bound
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.
abn
reviewed
Feb 4, 2025
2 tasks
b8be63c to
87da248
Compare
abn
approved these changes
Feb 7, 2025
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required for python-poetry/poetry#10146
Summary by Sourcery
Tests:
has_upper_boundmethod.