When writing the JSON file, print the top-level keys (version numbers) in SemVer order (not lexicographical order)#66
Closed
DilumAluthge wants to merge 7 commits into
Closed
When writing the JSON file, print the top-level keys (version numbers) in SemVer order (not lexicographical order)#66DilumAluthge wants to merge 7 commits into
DilumAluthge wants to merge 7 commits into
Conversation
1 task
Member
Author
|
This is ready for review, but I want to do a full build locally to make sure it looks right. |
OrderedDict)OrderedDict), and customize the sort order
31a120f to
8ac8137
Compare
…(by using `OrderedDict`), and customize the sort order
We haven't actually registered the package, so VersionsJSONUtil.jl v0.1.0 doesn't actually exist as a registered version of the package.
This is really just for convenience
8ac8137 to
51876ee
Compare
OrderedDict), and customize the sort order
Member
Author
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.
Currently, we use JSON.jl's default sorting, which is to sort every dict in lexicographical order when printing. This is fine for e.g. the
file_dict, but for the top-level keys (version numbers), this is less than optimal, because it means that the versions get printed in the order e.g.1.0, 1.1, 1.10, 1.11, 1.12, 1.13, 1.2, 1.3, 1.4, ....So, this PR turns off the default JSON.jl sorting, and then explicitly sorts things the way we want. For top-level keys (version numbers), we parse them as
VersionNumbers and sort them in SemVer order. For other dicts, we manually dosort!to sort them in lexicographical order.Other changes
I also included some smaller changes in this PR, let me know if you want me to split any of them out into their own separate PR:
Pkg.update().Project.toml: Change the version number from 0.1.0 to 0.1.0-DEV.Project.toml: Add[compat]entries for all non-stdlib direct deps.make versions.json(just for convenience).