From b5f796541de8c276efacb0bc289c314887a0ef27 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 12:31:08 +1300 Subject: [PATCH 1/8] feat: Sort string overrides alphabetically Improves consistency and readability. Helps with #1320. --- .github/workflows/ci.yml | 2 +- overrides/build-systems.json | 68 ++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d5a2acf9..59d2d08ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: actions/checkout@v3 - name: Check format - run: nix-shell --packages jq --pure --run 'diff overrides/build-systems.json <(jq --raw-output --sort-keys < overrides/build-systems.json)' + run: nix-shell --packages jq --pure --run 'diff overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else null end)" < overrides/build-systems.json)' nixpkgs-fmt: runs-on: ubuntu-latest diff --git a/overrides/build-systems.json b/overrides/build-systems.json index 7a560245a..67f213f7d 100644 --- a/overrides/build-systems.json +++ b/overrides/build-systems.json @@ -1292,8 +1292,8 @@ "setuptools" ], "autoflake": [ - "setuptools", - "hatchling" + "hatchling", + "setuptools" ], "autograd": [ "setuptools" @@ -3700,11 +3700,11 @@ "setuptools" ], "dask": [ - "setuptools", { "buildSystem": "versioneer", "from": "2.0.0" - } + }, + "setuptools" ], "dask-gateway": [ "setuptools" @@ -4198,11 +4198,11 @@ "setuptools" ], "distributed": [ - "setuptools", { "buildSystem": "versioneer", "from": "2.0.0" - } + }, + "setuptools" ], "distro": [ "setuptools" @@ -5250,8 +5250,8 @@ "setuptools" ], "execnet": [ - "hatchling", "hatch-vcs", + "hatchling", "setuptools", "setuptools-scm" ], @@ -6893,8 +6893,8 @@ "setuptools" ], "gunicorn": [ - "setuptools", - "packaging" + "packaging", + "setuptools" ], "guppy3": [ "setuptools" @@ -7305,8 +7305,8 @@ "setuptools" ], "human-readable": [ - "hatchling", - "hatch-vcs" + "hatch-vcs", + "hatchling" ], "humanfriendly": [ "setuptools" @@ -8865,8 +8865,8 @@ "setuptools" ], "llama-cpp-python": [ - "setuptools", - "scikit-build" + "scikit-build", + "setuptools" ], "llfuse": [ "cython", @@ -9749,9 +9749,9 @@ "setuptools-scm" ], "mpremote": [ - "hatchling", "hatch-requirements-txt", - "hatch-vcs" + "hatch-vcs", + "hatchling" ], "mpv": [ "setuptools" @@ -11129,12 +11129,12 @@ "setuptools" ], "pandas": [ - "cython", - "setuptools", { "buildSystem": "versioneer", "from": "2.0.0" - } + }, + "cython", + "setuptools" ], "pandas-datareader": [ "setuptools" @@ -11615,8 +11615,8 @@ "setuptools" ], "pip-licenses": [ - "setuptools", - "pytest-runner" + "pytest-runner", + "setuptools" ], "pip-requirements-parser": [ "setuptools", @@ -13290,8 +13290,8 @@ "setuptools" ], "pylint-plugin-utils": [ - "setuptools", - "poetry" + "poetry", + "setuptools" ], "pylint-venv": [ "poetry-core" @@ -14360,8 +14360,8 @@ "setuptools-scm" ], "pytest-bdd": [ - "setuptools", - "poetry-core" + "poetry-core", + "setuptools" ], "pytest-benchmark": [ "setuptools" @@ -14992,8 +14992,8 @@ "setuptools" ], "python-multipart": [ - "setuptools", - "hatchling" + "hatchling", + "setuptools" ], "python-mystrom": [ "setuptools" @@ -15171,8 +15171,8 @@ "setuptools" ], "python-ubersmithclient": [ - "setuptools", - "pbr" + "pbr", + "setuptools" ], "python-uinput": [ "setuptools" @@ -16494,7 +16494,6 @@ "setuptools" ], "scikit-build": [ - "cython", { "buildSystem": "setuptools", "until": "0.17.0" @@ -16514,7 +16513,8 @@ { "buildSystem": "hatch-vcs", "from": "0.17.0" - } + }, + "cython" ], "scikit-fmm": [ "setuptools" @@ -17532,11 +17532,11 @@ "setuptools" ], "sqlglot": [ - "setuptools", { "buildSystem": "setuptools-scm", "from": "13.0.2" - } + }, + "setuptools" ], "sqlite-fts4": [ "setuptools" @@ -17941,8 +17941,8 @@ "setuptools" ], "tacacs-plus": [ - "setuptools", - "pytest-runner" + "pytest-runner", + "setuptools" ], "tadasets": [ "setuptools" From e40f2180c0bf5235eb644a61b0981d2896ac0280 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 12:38:02 +1300 Subject: [PATCH 2/8] feat: Print unified diff between sorted and unsorted JSON Easier to read, and can be piped directly into `patch -p0`. --- .github/workflows/ci.yml | 2 +- README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59d2d08ff..172401809 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: actions/checkout@v3 - name: Check format - run: nix-shell --packages jq --pure --run 'diff overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else null end)" < overrides/build-systems.json)' + run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else null end)" < overrides/build-systems.json)' nixpkgs-fmt: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 7365dbc9d..2f121e38e 100644 --- a/README.md +++ b/README.md @@ -392,6 +392,8 @@ To test with a specific channel: nix-build --expr 'with import {}; callPackage ./tests/default.nix {}' ``` +To sort `overrides/build-systems.json` according to the [`sort-build-systems` job](.github/workflows/ci.yml), patch the source with the output of the "Check format" step, like this: `nix-shell [omitted] | patch -p0`. + ## Contact We have a Matrix room at [#poetry2nix:blad.is](https://matrix.to/#/#poetry2nix:blad.is). From 63e3465982145f99795d049b8e613787fbf4d491 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 12:49:13 +1300 Subject: [PATCH 3/8] feat: Sort entries with an `until` field above entries with a `from` field Improves consistency. Most entries are already sorted this way. Improves readability, since entries are now sorted in increasing chronological order. Helps with #1320. --- .github/workflows/ci.yml | 2 +- overrides/build-systems.json | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 172401809..cbbf2a67e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: actions/checkout@v3 - name: Check format - run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else null end)" < overrides/build-systems.json)' + run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else .from end)" < overrides/build-systems.json)' nixpkgs-fmt: runs-on: ubuntu-latest diff --git a/overrides/build-systems.json b/overrides/build-systems.json index 67f213f7d..6fc458670 100644 --- a/overrides/build-systems.json +++ b/overrides/build-systems.json @@ -7270,6 +7270,10 @@ "setuptools" ], "httpx": [ + { + "buildSystem": "setuptools", + "until": "0.23.1" + }, { "buildSystem": "hatch-fancy-pypi-readme", "from": "0.23.1" @@ -7277,10 +7281,6 @@ { "buildSystem": "hatchling", "from": "0.23.1" - }, - { - "buildSystem": "setuptools", - "until": "0.23.1" } ], "httpx-auth": [ @@ -8147,6 +8147,14 @@ "setuptools" ], "jsonschema": [ + { + "buildSystem": "setuptools", + "until": "4.6.0" + }, + { + "buildSystem": "setuptools-scm", + "until": "4.6.0" + }, { "buildSystem": "hatch-fancy-pypi-readme", "from": "4.11.0" @@ -8158,14 +8166,6 @@ { "buildSystem": "hatchling", "from": "4.6.0" - }, - { - "buildSystem": "setuptools", - "until": "4.6.0" - }, - { - "buildSystem": "setuptools-scm", - "until": "4.6.0" } ], "jsonschema-3": [ @@ -8222,13 +8222,13 @@ } ], "jupyter-core": [ - { - "buildSystem": "hatchling", - "from": "4.11.0" - }, { "buildSystem": "setuptools", "until": "4.11.0" + }, + { + "buildSystem": "hatchling", + "from": "4.11.0" } ], "jupyter-events": [ From 5597b84d5e83d2570b301ba34da73568527e71e7 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 13:05:50 +1300 Subject: [PATCH 4/8] refactor: Pull `jq` filter into a file and format it Makes the filter much easier to read, now that it's getting more complex. --- .github/workflows/ci.yml | 2 +- overrides/sort-build-systems.jq | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 overrides/sort-build-systems.jq diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbbf2a67e..98613ab3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: actions/checkout@v3 - name: Check format - run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else .from end)" < overrides/build-systems.json)' + run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --from-file overrides/sort-build-systems.jq --raw-output --sort-keys < overrides/build-systems.json)' nixpkgs-fmt: runs-on: ubuntu-latest diff --git a/overrides/sort-build-systems.jq b/overrides/sort-build-systems.jq new file mode 100644 index 000000000..1a46a7113 --- /dev/null +++ b/overrides/sort-build-systems.jq @@ -0,0 +1,8 @@ +.[] |= sort_by( + if type == "string" + then + . + else + .from + end +) From 33f3ad5d790168d20ccb91a585468d2da3d963f6 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 13:08:35 +1300 Subject: [PATCH 5/8] docs: Document build systems sorting filter --- overrides/sort-build-systems.jq | 3 +++ 1 file changed, 3 insertions(+) diff --git a/overrides/sort-build-systems.jq b/overrides/sort-build-systems.jq index 1a46a7113..baa36b836 100644 --- a/overrides/sort-build-systems.jq +++ b/overrides/sort-build-systems.jq @@ -1,8 +1,11 @@ +# Sort each entry in the top-level dictionary .[] |= sort_by( if type == "string" then + # Sort string overrides alphabetically . else + # Sort entries with an `until` field above entries with a `from` field .from end ) From bc44c1d75309a0414f0a4233ae178ca1965c7a9d Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 13:29:02 +1300 Subject: [PATCH 6/8] feat: Sort entries with both `from` and `until` between other entries Doesn't change build-systems.json, because this is already the case. Helps with #1320. --- overrides/sort-build-systems.jq | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/overrides/sort-build-systems.jq b/overrides/sort-build-systems.jq index baa36b836..fc0b5476d 100644 --- a/overrides/sort-build-systems.jq +++ b/overrides/sort-build-systems.jq @@ -6,6 +6,7 @@ . else # Sort entries with an `until` field above entries with a `from` field - .from + .from, + .until end ) From ae35a2e48cdeca8cc93a3362298b75030af47cba Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 13:35:15 +1300 Subject: [PATCH 7/8] feat: Sort build systems alphabetically within objects After sorting by the `from` and `until` versions. Helps with #1320. --- overrides/build-systems.json | 64 ++++++++++++++++----------------- overrides/sort-build-systems.jq | 4 ++- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/overrides/build-systems.json b/overrides/build-systems.json index 6fc458670..dfacd8e1e 100644 --- a/overrides/build-systems.json +++ b/overrides/build-systems.json @@ -933,15 +933,15 @@ "until": "23.1.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "23.1.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatch-vcs", "from": "23.1.0" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "23.1.0" } ], @@ -1226,7 +1226,7 @@ "until": "23.1.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "23.1.0" }, { @@ -1234,7 +1234,7 @@ "from": "23.1.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatchling", "from": "23.1.0" } ], @@ -2243,7 +2243,7 @@ "until": "22.10.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "22.10.0" }, { @@ -2251,7 +2251,7 @@ "from": "22.10.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatchling", "from": "22.10.0" } ], @@ -5521,11 +5521,11 @@ "until": "3.9.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-vcs", "from": "3.9.0" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "3.9.0" } ], @@ -6403,11 +6403,11 @@ "until": "0.19" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-vcs", "from": "0.19" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "0.19" } ], @@ -6417,11 +6417,11 @@ "until": "0.19" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-vcs", "from": "0.19" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "0.19" } ], @@ -7321,11 +7321,11 @@ "until": "4.6.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-vcs", "from": "4.6.0" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "4.6.0" } ], @@ -7620,11 +7620,11 @@ "until": "2.0.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-vcs", "from": "2.0.0" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "2.0.0" } ], @@ -8304,11 +8304,11 @@ "until": "4" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-jupyter-builder", "from": "4" }, { - "buildSystem": "hatch-jupyter-builder", + "buildSystem": "hatchling", "from": "4" } ], @@ -9543,11 +9543,11 @@ ], "mkdocs-material": [ { - "buildSystem": "hatchling", + "buildSystem": "hatch-nodejs-version", "from": "8.5.3" }, { - "buildSystem": "hatch-nodejs-version", + "buildSystem": "hatchling", "from": "8.5.3" }, "setuptools" @@ -10103,11 +10103,11 @@ "until": "5.6.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-nodejs-version", "from": "5.6.0" }, { - "buildSystem": "hatch-nodejs-version", + "buildSystem": "hatchling", "from": "5.6.0" } ], @@ -12666,11 +12666,11 @@ "until": "2.0.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "2.0.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatchling", "from": "2.0.0" } ], @@ -16503,15 +16503,15 @@ "until": "0.17.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "0.17.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatch-vcs", "from": "0.17.0" }, { - "buildSystem": "hatch-vcs", + "buildSystem": "hatchling", "from": "0.17.0" }, "cython" @@ -16743,7 +16743,7 @@ "until": "23.1.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "23.1.0" }, { @@ -16751,7 +16751,7 @@ "from": "23.1.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatchling", "from": "23.1.0" } ], @@ -17973,7 +17973,7 @@ "until": "22.12.0" }, { - "buildSystem": "hatchling", + "buildSystem": "hatch-fancy-pypi-readme", "from": "22.12.0" }, { @@ -17981,7 +17981,7 @@ "from": "22.12.0" }, { - "buildSystem": "hatch-fancy-pypi-readme", + "buildSystem": "hatchling", "from": "22.12.0" } ], diff --git a/overrides/sort-build-systems.jq b/overrides/sort-build-systems.jq index fc0b5476d..8c50ea5b5 100644 --- a/overrides/sort-build-systems.jq +++ b/overrides/sort-build-systems.jq @@ -7,6 +7,8 @@ else # Sort entries with an `until` field above entries with a `from` field .from, - .until + .until, + # Sort build systems with the same `from` and `until` values + .buildSystem end ) From d5ea9cde1352c82a712a453abe2eaa9fc4659a4c Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 26 Sep 2023 14:14:12 +1300 Subject: [PATCH 8/8] feat: Put all string values before objects String entries apply to _all_ versions, so it makes sense for them to be first in the build systems lists. --- overrides/build-systems.json | 66 ++++++++++++++++----------------- overrides/sort-build-systems.jq | 2 + 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/overrides/build-systems.json b/overrides/build-systems.json index dfacd8e1e..49b93b22c 100644 --- a/overrides/build-systems.json +++ b/overrides/build-systems.json @@ -3221,11 +3221,11 @@ "setuptools" ], "colorama": [ + "setuptools", { "buildSystem": "hatchling", "from": "0.4.6" - }, - "setuptools" + } ], "colorcet": [ "setuptools" @@ -3700,11 +3700,11 @@ "setuptools" ], "dask": [ + "setuptools", { "buildSystem": "versioneer", "from": "2.0.0" - }, - "setuptools" + } ], "dask-gateway": [ "setuptools" @@ -4198,11 +4198,11 @@ "setuptools" ], "distributed": [ + "setuptools", { "buildSystem": "versioneer", "from": "2.0.0" - }, - "setuptools" + } ], "distro": [ "setuptools" @@ -4653,11 +4653,11 @@ "setuptools-scm" ], "docformatter": [ + "setuptools", { "buildSystem": "poetry-core", "from": "1.5.0" - }, - "setuptools" + } ], "docker": [ "setuptools", @@ -9496,11 +9496,11 @@ "setuptools" ], "mkdocs": [ + "setuptools", { "buildSystem": "hatchling", "from": "1.4.1" - }, - "setuptools" + } ], "mkdocs-autorefs": [ "pdm-pep517", @@ -9542,6 +9542,7 @@ "setuptools" ], "mkdocs-material": [ + "setuptools", { "buildSystem": "hatch-nodejs-version", "from": "8.5.3" @@ -9549,15 +9550,14 @@ { "buildSystem": "hatchling", "from": "8.5.3" - }, - "setuptools" + } ], "mkdocs-material-extensions": [ + "setuptools", { "buildSystem": "hatchling", "from": "1.1" - }, - "setuptools" + } ], "mkdocs-minify": [ "setuptools" @@ -10069,11 +10069,11 @@ "setuptools" ], "nbclient": [ + "setuptools", { "buildSystem": "hatchling", "from": "0.7.1" - }, - "setuptools" + } ], "nbconflux": [ "setuptools" @@ -10369,6 +10369,7 @@ "setuptools" ], "notebook-shim": [ + "jupyter-packaging", { "buildSystem": "setuptools", "until": "0.2.0" @@ -10376,8 +10377,7 @@ { "buildSystem": "hatchling", "from": "0.2.0" - }, - "jupyter-packaging" + } ], "notedown": [ "setuptools" @@ -11129,12 +11129,12 @@ "setuptools" ], "pandas": [ + "cython", + "setuptools", { "buildSystem": "versioneer", "from": "2.0.0" - }, - "cython", - "setuptools" + } ], "pandas-datareader": [ "setuptools" @@ -16494,6 +16494,7 @@ "setuptools" ], "scikit-build": [ + "cython", { "buildSystem": "setuptools", "until": "0.17.0" @@ -16513,8 +16514,7 @@ { "buildSystem": "hatchling", "from": "0.17.0" - }, - "cython" + } ], "scikit-fmm": [ "setuptools" @@ -17532,11 +17532,11 @@ "setuptools" ], "sqlglot": [ + "setuptools", { "buildSystem": "setuptools-scm", "from": "13.0.2" - }, - "setuptools" + } ], "sqlite-fts4": [ "setuptools" @@ -17931,11 +17931,11 @@ "setuptools-scm" ], "tabulate": [ + "setuptools", { "buildSystem": "setuptools-scm", "from": "0.9.0" - }, - "setuptools" + } ], "tabview": [ "setuptools" @@ -18548,6 +18548,7 @@ "setuptools" ], "traitlets": [ + "setuptools", { "buildSystem": "flit-core", "until": "5.2.1" @@ -18555,8 +18556,7 @@ { "buildSystem": "hatchling", "from": "5.2.1" - }, - "setuptools" + } ], "traits": [ "setuptools" @@ -19218,6 +19218,7 @@ "setuptools" ], "urllib3": [ + "setuptools", { "buildSystem": "flit-core", "until": "2.0.2" @@ -19225,8 +19226,7 @@ { "buildSystem": "hatchling", "from": "2.0.2" - }, - "setuptools" + } ], "urlman": [ "setuptools" @@ -19407,6 +19407,7 @@ "setuptools" ], "virtualenv": [ + "cython", { "buildSystem": "setuptools-scm", "until": " 20.18" @@ -19414,8 +19415,7 @@ { "buildSystem": "hatch-vcs", "from": " 20.18" - }, - "cython" + } ], "virtualenv-clone": [ "setuptools" diff --git a/overrides/sort-build-systems.jq b/overrides/sort-build-systems.jq index 8c50ea5b5..25de9e219 100644 --- a/overrides/sort-build-systems.jq +++ b/overrides/sort-build-systems.jq @@ -1,5 +1,7 @@ # Sort each entry in the top-level dictionary .[] |= sort_by( + # Put all strings before objects + type == "object", if type == "string" then # Sort string overrides alphabetically