diff --git a/cibuildwheel/ios.py b/cibuildwheel/ios.py index e3b6c0a47..52411e31a 100644 --- a/cibuildwheel/ios.py +++ b/cibuildwheel/ios.py @@ -389,7 +389,7 @@ def build(options: Options, tmp_path: Path) -> None: for config in python_configurations: build_options = options.build_options(config.identifier) - build_frontend = build_options.build_frontend or BuildFrontendConfig("pip") + build_frontend = build_options.build_frontend or BuildFrontendConfig("build") # uv doesn't support iOS if build_frontend.name == "build[uv]": msg = "uv doesn't support iOS" diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 3a652b366..650577c9d 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -202,7 +202,7 @@ def build_in_container( log.build_start(config.identifier) local_identifier_tmp_dir = local_tmp_dir / config.identifier build_options = options.build_options(config.identifier) - build_frontend = build_options.build_frontend or BuildFrontendConfig("pip") + build_frontend = build_options.build_frontend or BuildFrontendConfig("build") use_uv = build_frontend.name == "build[uv]" pip = ["uv", "pip"] if use_uv else ["pip"] diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index a6829eca9..bd05f2a99 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -404,7 +404,7 @@ def build(options: Options, tmp_path: Path) -> None: for config in python_configurations: build_options = options.build_options(config.identifier) - build_frontend = build_options.build_frontend or BuildFrontendConfig("pip") + build_frontend = build_options.build_frontend or BuildFrontendConfig("build") use_uv = build_frontend.name == "build[uv]" uv_path = find_uv() if use_uv and uv_path is None: diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 268e73de6..bd9a3224c 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -355,7 +355,7 @@ def build(options: Options, tmp_path: Path) -> None: for config in python_configurations: build_options = options.build_options(config.identifier) - build_frontend = build_options.build_frontend or BuildFrontendConfig("pip") + build_frontend = build_options.build_frontend or BuildFrontendConfig("build") use_uv = build_frontend.name == "build[uv]" and can_use_uv(config) log.build_start(config.identifier) diff --git a/docs/options.md b/docs/options.md index 080c66bb8..dd90e9fcb 100644 --- a/docs/options.md +++ b/docs/options.md @@ -649,7 +649,7 @@ This option can also be set using the [command-line option](#command-line) ## Build customization ### `CIBW_BUILD_FRONTEND` {: #build-frontend} -> Set the tool to use to build, either "pip" (default for now), "build", or "build\[uv\]" +> Set the tool to use to build, either "build" (default), "build/[uv/]", or "pip" Options: @@ -658,8 +658,8 @@ Options: Default: `pip` -Choose which build frontend to use. Can either be "pip", which will run -`python -m pip wheel`, or "build", which will run `python -m build --wheel`. +Choose which build frontend to use. Can either be "build", which will run +`python -m build --wheel`, or "pip", which will run `python -m pip wheel`. You can also use "build\[uv\]", which will use an external [uv][] everywhere possible, both through `--installer=uv` passed to build, as well as when making diff --git a/test/test_before_build.py b/test/test_before_build.py index c817c87ca..19a770133 100644 --- a/test/test_before_build.py +++ b/test/test_before_build.py @@ -44,6 +44,10 @@ def test(tmp_path): """python -c "import sys; open('{project}/pythonversion_bb.txt', 'w').write(sys.version)" && """ f'''python -c "import sys; open('{{project}}/pythonprefix_bb.txt', 'w').write({SYS_PREFIX})"''' ) + frontend = "build" + if utils.platform != "pyodide": + before_build = f"python -m pip install setuptools && {before_build}" + frontend = f"{frontend};args: --no-isolation" # build the wheels actual_wheels = utils.cibuildwheel_run( @@ -52,6 +56,7 @@ def test(tmp_path): # write python version information to a temporary file, this is # checked in setup.py "CIBW_BEFORE_BUILD": before_build, + "CIBW_BUILD_FRONTEND": frontend, }, )