feat: use build by default (#2321)
* feat: use build by default Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: test/test_before_build.py:test --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: mayeut <mayeut@users.noreply.github.com>
This commit is contained in:
co-authored by
mayeut
parent
21888b531f
commit
be2a707315
+1
-1
@@ -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"
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user