forked from fetchai/agents-aea
-
Notifications
You must be signed in to change notification settings - Fork 16
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 deflection to custom __lt__
and add functools.total_ordering
#447
Merged
Merged
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
36cf832
fix: deflection in __lt__ method
Karrenbelt 05dbb00
fix: add functools.total_ordering to PublicId and PackageId
Karrenbelt f564c43
chore: linters
Karrenbelt 09f7179
fix: error message in code and type in test
Karrenbelt 4c118f4
tests: package_version_strategy
Karrenbelt 75549e5
fix: test_self_type_comparison
Karrenbelt 45e1c7a
chore: linters
Karrenbelt 85c0c74
fix: delegate comparison to PackageVersionLike
Karrenbelt 3b5a411
fix: remove `sorted` from DependencyNotFound.print_error
Karrenbelt 64f19d0
fix: remove `sorted` from DependencyTree
Karrenbelt 15b128c
fix: test_package_version_lt
Karrenbelt 4784ac1
fix: remove sorted() from queue initialization
Karrenbelt f269b13
Merge branch 'fix/data_types__eq__' into fix/data_types__lt__
Karrenbelt 779c951
Merge branch 'fix/data_types__lt__' into fix/delegate_to_PackageVersi…
Karrenbelt 97e612a
tests: fix test_type_comparison
Karrenbelt 1e08814
chore: linters
Karrenbelt f4aea8d
fix: sorted(roots, key=str)
Karrenbelt 9276d3a
Merge pull request #448 from valory-xyz/fix/delegate_to_PackageVersio…
DavidMinarsch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -61,14 +61,12 @@ def all_comparisons_operations_equal(pair_a, pair_b) -> bool: | |||||||||||||||||||||||||||||||||||||||||||||||||
return version_comparison == package_comparison | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
@pytest.mark.parametrize("self_type", [PublicId, PackageId, Dependency]) | ||||||||||||||||||||||||||||||||||||||||||||||||||
@pytest.mark.parametrize("self_type", [PackageVersion, PublicId, PackageId]) | ||||||||||||||||||||||||||||||||||||||||||||||||||
def test_self_type_comparison(self_type): | ||||||||||||||||||||||||||||||||||||||||||||||||||
"""Test comparison to self""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
self = st.from_type(self_type).example() | ||||||||||||||||||||||||||||||||||||||||||||||||||
copy_self = copy.deepcopy(self) | ||||||||||||||||||||||||||||||||||||||||||||||||||
other = st.from_type(self_type).example() | ||||||||||||||||||||||||||||||||||||||||||||||||||
assert self == copy_self | ||||||||||||||||||||||||||||||||||||||||||||||||||
other = copy.deepcopy(self) | ||||||||||||||||||||||||||||||||||||||||||||||||||
for f in COMPARISON_OPERATORS: | ||||||||||||||||||||||||||||||||||||||||||||||||||
assert isinstance(f(self, other), bool) | ||||||||||||||||||||||||||||||||||||||||||||||||||
assert isinstance(f(other, self), bool) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
71
to
75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should copy, we don't want to test raising a open-aea/tests/test_configurations/test_data_types.py Lines 75 to 98 in 75549e5
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
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.
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 old docstring was nice?
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.
bloat imo