Repository navigation
ci: Keep the ci/ tests standard-library only (no PyYAML) - #1199
Merged
Merged
Conversation
…#1196) The local gate runs every ci/test_*.py with `sys.executable -m unittest` and CI's "ci/ Self-Tests" step with `uv run python -m unittest discover`. Neither installs packages, and neither reads the dependencies in inline script metadata, which apply only to `uv run --script <file>`. test_ccache_launcher_installed.py imports yaml and declares pyyaml inline, so the lint lane fails on any host whose Python lacks PyYAML (Debian 13's system Python, a uv-managed Python on macOS). CI passes only because its runner's Python has PyYAML. This check fails on that file: "imports yaml" and "inline script dependencies that the test runners ignore". Metadata without dependencies (test_no_dict_access.py: requires-python only) passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…obs-rust#1196) test_ccache_launcher_installed.py now splits build-project.yaml into jobs and steps with regular expressions, as test_soldr_toolchain_cache.py does, and drops `import yaml` and its inline dependency. The result is the same as with yaml.safe_load: the same 15 jobs, the same number of steps per job, and the same two ccache steps ("Build Touched Linux Targets", "Build Frontend and Run Qt Tests"), both after an install. Against the workflow from before obs-rust#1183's fix (0d09f75^) it still fails on "Build Touched Linux Targets". test_ci_tests_stdlib_only.py passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6 of 7 tasks
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.
Fixes #1196
What and why
On master, the lint lane of the local gate failed on any host whose Python has no PyYAML:
test_ccache_launcher_installed.py(#1183/#1184) importedyamland declaredpyyamlas an inline script dependency. Both test runners ignore that metadata: the gate runs eachci/test_*.pywithsys.executable -m unittest(ci/local_gate.py), and CI's "ci/ Self-Tests" step runsuv run python -m unittest discover(check-format.yaml). Inline dependencies apply only touv run --script <file>. CI passed only because its runner's Python has PyYAML.This PR follows option 1 of the issue and keeps the ci/ tests standard-library only:
ci/test_ci_tests_stdlib_only.py(new) parses everyci/test_*.pywithastand allows onlysys.stdlib_module_names,__future__and theci/modules. It also rejects a non-empty inlinedependencieslist. Inline metadata without dependencies (test_no_dict_access.py:requires-pythononly) is allowed.test_ccache_launcher_installed.pysplitsbuild-project.yamlinto jobs and steps with regular expressions, astest_soldr_toolchain_cache.pydoes, and dropsimport yamland its inline dependency.RED → GREEN
test_ccache_launcher_installed.py("imports yaml", "inline script dependencies that the test runners ignore") and on nothing else.yaml.safe_loadand with the new split. Against the workflow from before ci: Fast Gate 'Build Touched Linux Targets' fails every plugin PR: ccache not found #1183's fix (0d09f75e0^), the rewritten test still fails on "Build Touched Linux Targets".import yamlfails),./lintfails on the RED commit and passes on the GREEN commit (96 ci tests, fmt, clippy, dylint). On macOS with a uv-managed Python 3.13, both tests pass.Checklist
master(or the description starts with a Stacked: note)-W..., ratchets): built with scripting ON (a flag change under cmake/ or build-aux/ runs the full builds) and cross-checked with clang and MSVC (not applicable: no flag changes)🤖 Generated with Claude Code