- All playbooks
- Caching and setup
- Restore compatible Python environments
Restore compatible Python environments
Restore the resolved virtual environment and keep the install step after it.
Company examples
How OpenAI used this technique
Read what OpenAI changed and follow the original sources.
Restore compatible Python environments
The Python SDK added a virtual-environment cache to three jobs, keyed by operating system, architecture, resolved Python version and both lockfiles, with dependency sync still running after the restore. The repository now uses uv's built-in cache (openai/openai-python#3653).
Environment cache keyed by OS, architecture, Python version and lockfiles Source
Repository moved to uv, with uv's built-in cache in CI Source
- Use it when
- Dependency installation repeats on fresh CI runners despite unchanged interpreter and lockfiles.
- Before applying it
- Virtual environments can hold interpreter-specific paths and binaries. Key on everything that changes them, and keep the install step so a stale cache is repaired.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed