fix(packages): a patch respin no longer sorts below the release it supersedes - #98
Merged
srpatcha merged 3 commits intoSep 1, 2026
Conversation
`import ebuild.cli.commands` raises NameError on master, so the `ebuild` command does not start and pytest cannot collect nine test modules -- the suite reports "9 errors during collection" and runs zero tests. Four PRs landed their tests while their implementation was discarded during conflict resolution, and the merges that did it were not gated by a run: f5209ac, current master, has no CI runs at all. embeddedos-org#64 (6a22e36) tests/unit/test_golden_path_commands.py landed; _workspace_repo_paths, _cached_repo_libraries, _record_board_selection, _EOS_PROJECT_CONFIG and the `configure --board` option did not. embeddedos-org#89 (32348f0) commands.py gained five `re.` uses, no `import re`. embeddedos-org#90 (d3958f7) the initramfs test kept its assertions but lost its `_newc_members` helper and its `os` / `stat` imports. embeddedos-org#92 registry.version_key was renamed version_sort_key without updating its caller in the tests. Restoring them, taken verbatim from the branches that were merged: * commands.py: `import re`; `_workspace_repo_paths`, `_cached_repo_libraries`, `_record_board_selection`, `_EOS_PROJECT_CONFIG`; the `--board` option on `configure` and the call that persists it; and the `{**_workspace_repo_paths(), **...}` merge at both `_install_packages` call sites. Without that last hunk a scaffolded project that `use`s eos or eboot gets no include or link paths from ~/.ebuild/repos, which is the "fatal error: eos/hal.h: No such file or directory" that embeddedos-org#64 fixed. Without the option, the documented golden path -- `configure --board` then a bare `build` -- fails with "no such option: --board". * the initramfs test: `os` / `stat` imports and the `_newc_members` newc parser the assertions call. * test_package_registry.py: import the name the module now exports. Collection goes from 9 errors / 0 tests to 446 passing. The 12 that still fail are pre-existing and out of scope here: `doctor` (embeddedos-org#72) and `package` (embeddedos-org#77) are two more features whose implementations the same merges dropped and which should be restored by their authors, and the rest are separate bugs -- see the PR description. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…persedes
version_sort_key("1.2.11b") sorted *below* version_sort_key("1.2.11"),
so a registry holding both resolved "latest" to the superseded release.
_component_key only recognises a component that is entirely digits. The
digits-then-letters form -- 1.2.11b after 1.2.11, which is how zlib and
OpenSSL number a patch respin -- fell through to the text branch and
returned (0, 0, "11b"), and the leading 0 ranks it below every numeric
component, including the (1, 11, "") it should follow.
Give that form the numeric rank of its digits and order on the letters
after them, so 1.2.11 < 1.2.11a < 1.2.11b while a genuinely textual
component keeps ranking below any numeric one. tests/unit already
asserted the first of these; it has been failing since the module was
renamed, which the suite could not report while collection was broken.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
srpatcha
approved these changes
Sep 1, 2026
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.
version_sort_key("1.2.11b")sorts belowversion_sort_key("1.2.11"), so a registry holding both resolveslatestto the superseded release.Cause
_component_keyrecognises a component only when it is entirely digits. The digits-then-letters form —1.2.11bafter1.2.11, how zlib and OpenSSL number a patch respin — falls through to the text branch and returns(0, 0, "11b"). The leading0ranks it below every numeric component, including the(1, 11, "")it should immediately follow.Fix
Give that form the numeric rank of its digits and order on the letters after them:
1.2.11 < 1.2.11a < 1.2.11b1.2.beta) still ranks below any numeric one, so the order stays total3.6.0-rc1 < 3.6.0and1.3.1 < 2.9.3 < 11.1.0are unchangedtest_letter_suffix_sorts_above_its_basealready asserted the first of these. It has been failing since the module renamedversion_key→version_sort_key— which the suite could not report while collection was broken (#97). Two further tests added for respin-vs-respin and respin-vs-text ordering.🤖 Generated with Claude Code