Skip to content
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

Make Enums sortable. #1470

Merged
merged 3 commits into from
Sep 26, 2021

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Sep 25, 2021

Upcoming lock file work will benefit from this. Instead of just sorting
by the string value of an Enum.Value, introduce an ordinal to sort by
and take the opportunity to dry up the values method.

Work towards #1401 and #1414.

This will be used for error messages when introducing sortability to
`Enum` and in lock file parsing.

Work towards pex-tool#1401 and pex-tool#1414.
Upcoming lock file work will benefit from this. Instead of just sorting
by the string value of an `Enum.Value`, introduce an ordinal to sort by
and take the opportunity to dry up the values method.

Work towards pex-tool#1401 and pex-tool#1414.
@jsirois
Copy link
Member Author

jsirois commented Sep 25, 2021

The 1st commit (57645f9) is from #1469 which this PR depends on. Please just review the second commit (65a8a6e).

@@ -71,7 +71,8 @@ commands =
[testenv:typecheck]
deps =
attrs==21.2.0 # This version should track the version in pex/vendor/__init__.py.
mypy==0.800
mypy[python2]==0.910
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mistakenly thought this upgrade was needed to support @total_ordering used in Enum.Value in this PR.

@jsirois jsirois merged commit d6235f5 into pex-tool:main Sep 26, 2021
@jsirois jsirois deleted the issues/1401/Enum/simplify-and-sortable branch September 26, 2021 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants