Skip to content

Commit 2246313

Browse files
authored
fix: verbosity isn't supported for pypa/build (#1474)
This was incorrectly adding an empty config setting, and it was not correct if included for build - it's a pip wheel only setting. Reported in #1471. Signed-off-by: Henry Schreiner <[email protected]>
1 parent fdc0eae commit 2246313

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

cibuildwheel/linux.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,10 @@ def build_in_container(
242242
container.call(["rm", "-rf", built_wheel_dir])
243243
container.call(["mkdir", "-p", built_wheel_dir])
244244

245-
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
246245
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
247246

248247
if build_frontend == "pip":
249-
extra_flags += verbosity_flags
248+
extra_flags += get_build_verbosity_extra_flags(build_options.build_verbosity)
250249
container.call(
251250
[
252251
"python",
@@ -261,8 +260,9 @@ def build_in_container(
261260
env=env,
262261
)
263262
elif build_frontend == "build":
264-
verbosity_setting = " ".join(verbosity_flags)
265-
extra_flags += (f"--config-setting={verbosity_setting}",)
263+
if not 0 <= build_options.build_verbosity < 2:
264+
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
265+
log.warning(msg)
266266
container.call(
267267
[
268268
"python",

cibuildwheel/macos.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,10 @@ def build(options: Options, tmp_path: Path) -> None:
376376
log.step("Building wheel...")
377377
built_wheel_dir.mkdir()
378378

379-
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
380379
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
381380

382381
if build_frontend == "pip":
383-
extra_flags += verbosity_flags
382+
extra_flags += get_build_verbosity_extra_flags(build_options.build_verbosity)
384383
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
385384
# see https://github.com/pypa/cibuildwheel/pull/369
386385
call(
@@ -395,8 +394,9 @@ def build(options: Options, tmp_path: Path) -> None:
395394
env=env,
396395
)
397396
elif build_frontend == "build":
398-
verbosity_setting = " ".join(verbosity_flags)
399-
extra_flags += (f"--config-setting={verbosity_setting}",)
397+
if not 0 <= build_options.build_verbosity < 2:
398+
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
399+
log.warning(msg)
400400
build_env = env.copy()
401401
if build_options.dependency_constraints:
402402
constraint_path = (

cibuildwheel/windows.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,10 @@ def build(options: Options, tmp_path: Path) -> None:
414414
log.step("Building wheel...")
415415
built_wheel_dir.mkdir()
416416

417-
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
418417
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
419418

420419
if build_frontend == "pip":
421-
extra_flags += verbosity_flags
420+
extra_flags += get_build_verbosity_extra_flags(build_options.build_verbosity)
422421
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
423422
# see https://github.com/pypa/cibuildwheel/pull/369
424423
call(
@@ -433,8 +432,9 @@ def build(options: Options, tmp_path: Path) -> None:
433432
env=env,
434433
)
435434
elif build_frontend == "build":
436-
verbosity_setting = " ".join(verbosity_flags)
437-
extra_flags += (f"--config-setting={verbosity_setting}",)
435+
if not 0 <= build_options.build_verbosity < 2:
436+
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
437+
log.warning(msg)
438438
build_env = env.copy()
439439
if build_options.dependency_constraints:
440440
constraints_path = (

docs/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ This option is not supported in the overrides section in `pyproject.toml`.
13931393
### `CIBW_BUILD_VERBOSITY` {: #build-verbosity}
13941394
> Increase/decrease the output of pip wheel
13951395
1396-
An number from 1 to 3 to increase the level of verbosity (corresponding to invoking pip with `-v`, `-vv`, and `-vvv`), between -1 and -3 (`-q`, `-qq`, and `-qqq`), or just 0 (default verbosity). These flags are useful while debugging a build when the output of the actual build invoked by `pip wheel` is required.
1396+
An number from 1 to 3 to increase the level of verbosity (corresponding to invoking pip with `-v`, `-vv`, and `-vvv`), between -1 and -3 (`-q`, `-qq`, and `-qqq`), or just 0 (default verbosity). These flags are useful while debugging a build when the output of the actual build invoked by `pip wheel` is required. Has no effect on the `build` backend, which produces verbose output by default.
13971397

13981398
Platform-specific environment variables are also available:<br/>
13991399
`CIBW_BUILD_VERBOSITY_MACOS` | `CIBW_BUILD_VERBOSITY_WINDOWS` | `CIBW_BUILD_VERBOSITY_LINUX`

0 commit comments

Comments
 (0)