Skip to content

Commit be2a707

Browse files
henryiiimayeut
andauthored
feat: use build by default (#2321)
* feat: use build by default Signed-off-by: Henry Schreiner <[email protected]> * fix: test/test_before_build.py:test --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: mayeut <[email protected]>
1 parent 21888b5 commit be2a707

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

cibuildwheel/ios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def build(options: Options, tmp_path: Path) -> None:
389389

390390
for config in python_configurations:
391391
build_options = options.build_options(config.identifier)
392-
build_frontend = build_options.build_frontend or BuildFrontendConfig("pip")
392+
build_frontend = build_options.build_frontend or BuildFrontendConfig("build")
393393
# uv doesn't support iOS
394394
if build_frontend.name == "build[uv]":
395395
msg = "uv doesn't support iOS"

cibuildwheel/linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def build_in_container(
202202
log.build_start(config.identifier)
203203
local_identifier_tmp_dir = local_tmp_dir / config.identifier
204204
build_options = options.build_options(config.identifier)
205-
build_frontend = build_options.build_frontend or BuildFrontendConfig("pip")
205+
build_frontend = build_options.build_frontend or BuildFrontendConfig("build")
206206
use_uv = build_frontend.name == "build[uv]"
207207
pip = ["uv", "pip"] if use_uv else ["pip"]
208208

cibuildwheel/macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def build(options: Options, tmp_path: Path) -> None:
404404

405405
for config in python_configurations:
406406
build_options = options.build_options(config.identifier)
407-
build_frontend = build_options.build_frontend or BuildFrontendConfig("pip")
407+
build_frontend = build_options.build_frontend or BuildFrontendConfig("build")
408408
use_uv = build_frontend.name == "build[uv]"
409409
uv_path = find_uv()
410410
if use_uv and uv_path is None:

cibuildwheel/windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def build(options: Options, tmp_path: Path) -> None:
355355

356356
for config in python_configurations:
357357
build_options = options.build_options(config.identifier)
358-
build_frontend = build_options.build_frontend or BuildFrontendConfig("pip")
358+
build_frontend = build_options.build_frontend or BuildFrontendConfig("build")
359359
use_uv = build_frontend.name == "build[uv]" and can_use_uv(config)
360360
log.build_start(config.identifier)
361361

docs/options.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ This option can also be set using the [command-line option](#command-line)
649649
## Build customization
650650

651651
### `CIBW_BUILD_FRONTEND` {: #build-frontend}
652-
> Set the tool to use to build, either "pip" (default for now), "build", or "build\[uv\]"
652+
> Set the tool to use to build, either "build" (default), "build/[uv/]", or "pip"
653653
654654
Options:
655655

@@ -658,8 +658,8 @@ Options:
658658

659659
Default: `pip`
660660

661-
Choose which build frontend to use. Can either be "pip", which will run
662-
`python -m pip wheel`, or "build", which will run `python -m build --wheel`.
661+
Choose which build frontend to use. Can either be "build", which will run
662+
`python -m build --wheel`, or "pip", which will run `python -m pip wheel`.
663663

664664
You can also use "build\[uv\]", which will use an external [uv][] everywhere
665665
possible, both through `--installer=uv` passed to build, as well as when making

test/test_before_build.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def test(tmp_path):
4444
"""python -c "import sys; open('{project}/pythonversion_bb.txt', 'w').write(sys.version)" && """
4545
f'''python -c "import sys; open('{{project}}/pythonprefix_bb.txt', 'w').write({SYS_PREFIX})"'''
4646
)
47+
frontend = "build"
48+
if utils.platform != "pyodide":
49+
before_build = f"python -m pip install setuptools && {before_build}"
50+
frontend = f"{frontend};args: --no-isolation"
4751

4852
# build the wheels
4953
actual_wheels = utils.cibuildwheel_run(
@@ -52,6 +56,7 @@ def test(tmp_path):
5256
# write python version information to a temporary file, this is
5357
# checked in setup.py
5458
"CIBW_BEFORE_BUILD": before_build,
59+
"CIBW_BUILD_FRONTEND": frontend,
5560
},
5661
)
5762

0 commit comments

Comments
 (0)