Platforms stage#19
Draft
henryiii wants to merge 3 commits into
Draft
Conversation
Add find_built_wheel, which locates the wheel in a directory that was previously built for a specific identifier. Unlike find_compatible_wheel (cross-compatible abi3/none wheels only), it also matches a wheel built for the identifier's own interpreter, including free-threaded builds, and covers all platforms (incl. pyodide). Factors out a shared _platform_tag_matches helper and adds unit tests. The shared driver's test-only path now uses it. This is groundwork for the --stage=test feature. Assisted-by: ClaudeCode:claude-opus-4.8
Add a --stage option (also CIBW_STAGE) with choices all/build/test: 'build' produces wheels into the output dir and skips tests; 'test' skips building and runs tests against wheels already in the output dir; 'all' (default) does both, identical to previous behavior. The selected stages (a frozenset[Stage]) are threaded from __main__ through PlatformModule.build into each platform. Host platforms already gate on stages via run_host_build; Linux's build_in_container now gates before_all/build/repair/audit/output on BUILD and the test block on TEST, and in test-only mode copies the matching pre-built wheel from the output dir into the container before testing. Note: the Linux test-only container path can't be exercised by the unit suite and needs integration testing. Assisted-by: ClaudeCode:claude-opus-4.8
Add unit tests for run_host_build using a fake backend, verifying that --stage=all runs build+test and moves the wheel, --stage=build skips tests, and --stage=test only runs tests against a pre-built wheel from the output dir (erroring clearly when none is present). Assisted-by: ClaudeCode:claude-opus-4.8
Reviewer's GuideAdds a stage-aware build/test pipeline with a new --stage CLI option, enabling build-only and test-only runs that reuse prebuilt wheels, and centralizes logic for matching previously built wheels to identifiers across platforms. Sequence diagram for the stage-aware build and test pipelinesequenceDiagram
actor User
participant main_inner
participant build_in_directory
participant platform_build as platform_module.build
participant run_host_build
participant find_prebuilt_wheel
participant find_built_wheel
User->>main_inner: cibuildwheel --stage=test
main_inner->>build_in_directory: build_in_directory(args)
build_in_directory->>build_in_directory: stages = {Stage.TEST}
build_in_directory->>platform_build: build(options, tmp_path, stages)
platform_build->>run_host_build: run_host_build(platform_module, options, tmp_path, stages)
loop per identifier
alt Stage.BUILD not in stages
run_host_build->>find_prebuilt_wheel: find_prebuilt_wheel(output_dir, identifier)
find_prebuilt_wheel->>find_built_wheel: find_built_wheel(wheels, identifier)
find_built_wheel-->>find_prebuilt_wheel: wheel
find_prebuilt_wheel-->>run_host_build: prebuilt wheel path
run_host_build->>run_host_build: run tests on prebuilt wheel
else Stage.BUILD in stages
run_host_build->>platform_build: build_in_container(..., stages)
platform_build->>platform_build: build wheel
platform_build-->>run_host_build: built wheel
run_host_build->>run_host_build: run tests on built wheel
end
end
run_host_build-->>platform_build: stage complete
platform_build-->>build_in_directory: stage complete
build_in_directory-->>main_inner: exit
main_inner-->>User: command finished
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
PR to PR to show a
--stagefeature.Assisted-by: ClaudeCode:claude-opus-4.8
Summary by Sourcery
Introduce stage-aware build and test execution, allowing separate build-only, test-only, or combined runs while reusing prebuilt wheels.
New Features:
Enhancements:
Tests: