feat: add support for container_engine=none#38
Draft
mayeut wants to merge 1 commit into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Linux mode where CIBW_CONTAINER_ENGINE=none disables OCI container usage and runs the Linux build “natively” (e.g., inside a manylinux runner/container), with corresponding path-handling and test/CI adjustments.
Changes:
- Allow
OCIContainerEngineConfig.from_config_string("none")to resolve toNone, and thread this throughBuildOptions/Linux build steps. - Introduce a Linux “builder” abstraction to support both
OCIContainerand a newLocalBuilderexecution path. - Update unit/integration tests and CI workflow to exercise/skip container-image-specific behavior when
container_engine=none.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
unit_test/options_test.py |
Adjusts assertions for container_engine typing in options parsing tests. |
unit_test/option_prepare_test.py |
Updates monkeypatching to target create_builder rather than OCIContainer directly. |
unit_test/oci_container_test.py |
Updates tests to use remote-path types and narrows engine config typing via assertions. |
unit_test/linux_build_steps_test.py |
Updates test typing to allow container_engine to be optional. |
test/utils.py |
Tweaks test helpers to skip musllinux expectations/builds when container engine is disabled. |
test/test_musllinux_X_Y_only.py |
Skips musllinux image test when CIBW_CONTAINER_ENGINE=none. |
test/test_manylinuxXXXX_only.py |
Skips manylinux image test when CIBW_CONTAINER_ENGINE=none. |
test/test_linux_python.py |
Skips interpreter-existence test when CIBW_CONTAINER_ENGINE=none. |
test/test_container_images.py |
Skips container image tests when CIBW_CONTAINER_ENGINE=none. |
test/test_container_engine.py |
Skips create-args container test when CIBW_CONTAINER_ENGINE=none; keeps podman gating. |
test/test_before_build.py |
Makes Linux-specific cwd assertion conditional on actually using a container. |
test/test_before_all.py |
Makes Linux-specific cwd assertion conditional on actually using a container. |
test/conftest.py |
Skips docker warmup/cleanup fixtures when CIBW_CONTAINER_ENGINE=none. |
cibuildwheel/util/file.py |
Adds RemotePosixPath/RemoteWindowsPath marker path types for “remote FS” operations. |
cibuildwheel/typing.py |
Adds PathT TypeVar used for typed path-preserving glob methods. |
cibuildwheel/platforms/linux.py |
Implements Builder protocol, LocalBuilder, and create_builder; adapts build flow to optional container usage. |
cibuildwheel/options.py |
Makes BuildOptions.container_engine optional. |
cibuildwheel/oci_container.py |
Supports container_engine=none and strengthens remote path typing for copy/glob operations. |
bin/run_tests.py |
Avoids running docker unit tests when CIBW_CONTAINER_ENGINE=none. |
.github/workflows/test.yml |
Adds a CI job to run Linux tests/build with CIBW_CONTAINER_ENGINE=none. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+82
to
+85
| if os.environ.get("CIBW_CONTAINER_ENGINE", "docker") == "none": | ||
| skip = env.get("CIBW_SKIP", "") | ||
| env["CIBW_SKIP"] = f"{skip} *-musllinux_*".strip() | ||
|
|
Comment on lines
+151
to
+154
| if os.environ.get("CIBW_CONTAINER_ENGINE", "docker") == "none": | ||
| skip = env.get("CIBW_SKIP", "") | ||
| env["CIBW_SKIP"] = f"{skip} *-musllinux_*".strip() | ||
|
|
| options = Options(platform="linux", command_line_arguments=args, env={}) | ||
| parsed_container_engine = options.build_options(None).container_engine | ||
|
|
||
| assert parsed_container_engine is not None |
Comment on lines
488
to
491
| engine_config = OCIContainerEngineConfig.from_config_string(config) | ||
| assert engine_config is not None | ||
| assert engine_config.name == name | ||
| assert engine_config.create_args == create_args |
Comment on lines
104
to
107
| name = " ".join(config_dict["name"]) | ||
| if name == "none": | ||
| return None | ||
| if name not in {"docker", "podman"}: |
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.
No description provided.