Skip to content

✨ feat(pkg): cache external packaging env build across envs#3790

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix/2729-external-pkg-run-once
Feb 20, 2026
Merged

✨ feat(pkg): cache external packaging env build across envs#3790
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix/2729-external-pkg-run-once

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

When using package = external with a shared package_env, the build commands run once per test environment that depends on it, rebuilding an identical package each time. For projects compiling C extensions or running complex build pipelines, this wastes significant time — often several minutes per redundant build.

🚀 The built package path is now cached after the first successful build within a session. Subsequent test environments that share the same external packaging env skip the build entirely and reuse the already-built artifact. Per-environment extras and dependencies are still resolved individually, so environments with different extras configurations continue to get the correct dependency set.

This mirrors the caching behavior that wheel_build_env already provides for PEP-517 wheel builds, extending the same optimization to external packaging workflows.

Fixes #2729

@gaborbernat gaborbernat added feature:change something exists already but should behave differently area:package-building labels Feb 20, 2026
@gaborbernat gaborbernat enabled auto-merge (squash) February 20, 2026 04:13
@gaborbernat gaborbernat merged commit 326e14a into tox-dev:main Feb 20, 2026
28 checks passed
@gaborbernat gaborbernat deleted the fix/2729-external-pkg-run-once branch February 20, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:package-building bot:chronographer:provided feature:change something exists already but should behave differently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make external packaging environments only run once.

1 participant