[3006.x] Add onedir package test for libyaml-linked PyYAML - #70000
Merged
Conversation
Regression cover for saltstack#69907 / PR saltstack#69950 (3006.x) / saltstack#69949 (3008.x). Spawns the onedir python and asserts yaml.CSafeLoader/CSafeDumper and the _yaml C extension are present, plus salt.utils.yamlloader.SafeLoader resolves to yaml.CSafeLoader. Linux-only; Windows/macOS onedirs already pick libyaml-linked wheels because they do not pass --no-binary=:all: to pip.
twangboy
previously approved these changes
Aug 10, 2026
salt.utils.yamlloader exports BaseLoader (which resolves to yaml.CSafeLoader when libyaml is linked), not SafeLoader. The initial test used the wrong name and hit AttributeError on every Linux runner. Assert against BaseLoader instead.
Contributor
Author
|
Skip the two libyaml onedir tests on the downgrade flavor ( |
…owngrade Post-downgrade pytest re-enters the pkg/integration suite with the previous salt onedir on disk and no --downgrade flag, so the earlier install_salt.downgrade guard didn't trigger and the test still failed. Rewritten to key on install_salt.version: - >= 3006.28 -> assert libyaml present (guards the fix) - < 3006.28 -> assert libyaml absent (documents the pre-fix baseline so a silent regression on the old branch is also caught) Works uniformly across the three pkg-test flavors without skips.
The prior design compared install_salt.version >= Version("3006.28") to
predict whether libyaml should be present, but dev builds report
'3006.27+NNN.gSHA' which packaging.version orders BEFORE '3006.27' let
alone '3006.28' (PEP 440 local-version segment). That flipped the
expected-libyaml boolean to False on install jobs and turned every
Linux install matrix row red.
install_salt.use_prev_version is True iff the pytest run is executing
against the downgraded-to previous release (set by --use-prev-version in
the post-downgrade validation stage). That's the only flavor where the
onedir predates PR saltstack#69950 and libyaml is legitimately absent. Key the
expectation off that flag and drop the version-comparison plumbing.
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.
Follow-up to PR #69950 (3006.x) / #69949 (3008.x) — adds a package-level regression test so a slip back to a source-built PyYAML without libyaml (the class of bug reported in #69907) fails CI before release.
What it checks, from the shipped onedir python:
yaml.CSafeLoader,yaml.CSafeDumper,yaml.CLoader,yaml.CDumperare all presentimport _yamlsucceeds (PyYAML C extension is importable)salt.utils.yamlloader.SafeLoader is yaml.CSafeLoader— catches the case where the extension exists but Salt's shim is still resolving to the pure-Python loaderCSafeLoaderto make sure the extension is functional, not just importableLinux-only. Windows and macOS onedirs do not pass
--no-binary=:all:to pip, so they already pick libyaml-linked wheels.