-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Handle .x in version sorting #6012
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
Handle .x in version sorting #6012
Conversation
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.
This solution is good to me. It does not affect anything that it's already working 👍
|
||
versions = list(Version.objects.filter(project=self.project)) | ||
self.assertEqual( | ||
['latest', 'carrot', 'banana', 'apple'], |
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.
I know that this is not a behavior that you changed, but I'd like to sort alphanumeric versions from A to Z instead at some point. Feels more human-readable when you have a many of these.
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.
Do we have any examples of projects that use something like this? I can think of Ubuntu off the top of my head, but that's about it.
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.
test-builds, which may not apply as a real project but shows the sorting problem when building alphanumeric branch names
A side comment that isn't exactly related to this PR is that the readthedocs.org/readthedocs/projects/version_handling.py Lines 76 to 101 in a370ade
|
I'm 👍 adding a comment explaining this where you consider necessary. |
I added the comments explaining comparable versions. This is ready to merge, I believe. |
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.
Good change.
I wish this was present in the upstream, but that's a fight for another day :) |
.x
in version sorting (eg.1.0.x
or2.x
). A few projects use this in their branch names like Pallets and Django.Fixes: #6010