-
Notifications
You must be signed in to change notification settings - Fork 256
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
add has_upper_bound
method to VersionConstraint
#833
base: main
Are you sure you want to change the base?
add has_upper_bound
method to VersionConstraint
#833
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.
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 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
@sourcery-ai review |
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:
- 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.
b8be63c
to
87da248
Compare
Required for python-poetry/poetry#10146
Summary by Sourcery
Tests:
has_upper_bound
method.