Skip to content

feat: add support for container_engine=none#38

Draft
mayeut wants to merge 1 commit into
mainfrom
native-linux2
Draft

feat: add support for container_engine=none#38
mayeut wants to merge 1 commit into
mainfrom
native-linux2

Conversation

@mayeut

@mayeut mayeut commented Jun 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

@mayeut mayeut requested a review from Copilot June 29, 2026 05:34
Comment thread .github/workflows/test.yml Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to None, and thread this through BuildOptions/Linux build steps.
  • Introduce a Linux “builder” abstraction to support both OCIContainer and a new LocalBuilder execution 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 thread test/utils.py
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 thread test/utils.py
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()

Comment thread cibuildwheel/platforms/linux.py Outdated
Comment thread unit_test/options_test.py
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"}:
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.

3 participants