Skip to content

ci: cut fixed setup overhead in test jobs#3269

Merged
messense merged 1 commit into
PyO3:mainfrom
messense:ci-setup-overhead
Jul 19, 2026
Merged

ci: cut fixed setup overhead in test jobs#3269
messense merged 1 commit into
PyO3:mainfrom
messense:ci-setup-overhead

Conversation

@messense

Copy link
Copy Markdown
Member

Summary

Third round for #2189. After #3267 and #3268, warm-run step timings show the test phase is no longer the bottleneck in several cells — fixed setup steps are. Per matrix cell the remaining overhead concentrates in exactly two steps; this PR addresses both.

zig cross-compile step: use the prebuilt maturin (was 1m39–3m54 per cell)

The step ran cargo run build ..., which rebuilt maturin with default features — the cargo test step builds it with --features password-storage,faster-tests, so the feature sets differ and cargo rebuilds the binary and its dependency tree. The PYO3_CONFIG_FILE and maturin new steps that follow already use target/debug/maturin directly; the zig step now does the same (zig is in the default feature set via cross-compile, so the nextest-built binary supports --zig). Most of the step's time was this rebuild, not the zig builds themselves.

setup-miniconda → setup-micromamba (was up to 2m on Windows)

setup-micromamba in binary-only mode installs in seconds. The test harness now falls back to micromamba when conda is absent: conda and micromamba share the create -n NAME python=X.Y -q -y --json CLI, and micromamba's JSON output has the same top-level prefix/success fields the harness already parses. An explicit --root-prefix under test-crates/venvs keeps it working when MAMBA_ROOT_PREFIX isn't set.

Verified locally with conda removed from PATH: develop_pyo3_pure_conda passes through the micromamba path — and runs ~2.5× faster (36s vs ~90s), since micromamba also creates the conda envs much faster than conda does. Repeat create over an existing env is idempotent.

Expected effect

Windows 3.9 (currently the long pole at ~17m53 warm with only 6m36 of actual tests): roughly −2m from the zig step rebuild and −1m40 from miniconda, plus faster conda env creation inside the conda tests. Similar cuts on the other cells running those steps.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NNNLg7XZnxM8Aiqrzo6c5q

Warm-run step timings show the remaining fixed overhead per matrix cell
is concentrated in two steps:

- The zig cross-compile step ran 'cargo run build', which rebuilt
  maturin with default features because the nextest step builds it with
  --features password-storage,faster-tests. Use the already-built
  target/debug/maturin instead, like the subsequent steps do (zig is in
  the default feature set). This was 1m39-3m54 per cell.
- setup-miniconda took up to 2 minutes on Windows. Switch to
  setup-micromamba (binary-only install, seconds) and teach the test
  harness to fall back to micromamba when conda is absent; conda and
  micromamba share the create CLI and the --json output fields the
  harness parses, and micromamba also creates the test envs ~2.5x
  faster. An explicit --root-prefix under test-crates keeps it working
  when MAMBA_ROOT_PREFIX is not set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NNNLg7XZnxM8Aiqrzo6c5q
@messense
messense merged commit f7c38a0 into PyO3:main Jul 19, 2026
85 checks passed
@messense
messense deleted the ci-setup-overhead branch July 19, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant