Skip to content

ci: Keep the ci/ tests standard-library only (no PyYAML) - #1199

Merged
zackees merged 2 commits into
obs-rust:masterfrom
vpacher:fix/ci-tests-stdlib-only
Oct 17, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
vpacher:fix/ci-tests-stdlib-only

Conversation

@vpacher

@vpacher vpacher commented Oct 17, 2026

Copy link
Copy Markdown
Member

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) imported yaml and declared pyyaml as an inline script dependency. Both test runners ignore that metadata: the gate runs each ci/test_*.py with sys.executable -m unittest (ci/local_gate.py), and CI's "ci/ Self-Tests" step runs uv run python -m unittest discover (check-format.yaml). Inline dependencies apply only to uv 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:

  1. ci/test_ci_tests_stdlib_only.py (new) parses every ci/test_*.py with ast and allows only sys.stdlib_module_names, __future__ and the ci/ modules. It also rejects a non-empty inline dependencies list. Inline metadata without dependencies (test_no_dict_access.py: requires-python only) is allowed.
  2. test_ccache_launcher_installed.py 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.

RED → GREEN

  • RED commit: 8c94d36. The new check fails on test_ccache_launcher_installed.py ("imports yaml", "inline script dependencies that the test runners ignore") and on nothing else.
  • GREEN commit: c12bb2f. Both tests pass.
  • Same result as before: a comparison script with PyYAML found 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, with yaml.safe_load and 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".
  • Real hosts without PyYAML: on Debian 13 (system Python 3.13, import yaml fails), ./lint fails 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

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-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)
  • Intentional differences from C listed in the parity test header and rust/README.md (ports) (not applicable: not a port)

🤖 Generated with Claude Code

vpacher and others added 2 commits October 17, 2026 09:45
…#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]>
@vpacher
vpacher requested a review from zackees as a code owner October 17, 2026 07:47
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Merged via the queue into obs-rust:master with commit f861687 Oct 17, 2026
23 of 24 checks passed
@vpacher
vpacher deleted the fix/ci-tests-stdlib-only branch October 17, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci: the local gate's lint lane fails without a system PyYAML (test_ccache_launcher_installed.py)

2 participants