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 <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2023-04-17 14:06:45 -04:00
committed by GitHub
parent fdc0eae932
commit 2246313344
4 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -242,11 +242,10 @@ def build_in_container(
container.call(["rm", "-rf", built_wheel_dir])
container.call(["mkdir", "-p", built_wheel_dir])
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
if build_frontend == "pip":
extra_flags += verbosity_flags
extra_flags += get_build_verbosity_extra_flags(build_options.build_verbosity)
container.call(
[
"python",
@@ -261,8 +260,9 @@ def build_in_container(
env=env,
)
elif build_frontend == "build":
verbosity_setting = " ".join(verbosity_flags)
extra_flags += (f"--config-setting={verbosity_setting}",)
if not 0 <= build_options.build_verbosity < 2:
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
log.warning(msg)
container.call(
[
"python",
+4 -4
View File
@@ -376,11 +376,10 @@ def build(options: Options, tmp_path: Path) -> None:
log.step("Building wheel...")
built_wheel_dir.mkdir()
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
if build_frontend == "pip":
extra_flags += verbosity_flags
extra_flags += get_build_verbosity_extra_flags(build_options.build_verbosity)
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
# see https://github.com/pypa/cibuildwheel/pull/369
call(
@@ -395,8 +394,9 @@ def build(options: Options, tmp_path: Path) -> None:
env=env,
)
elif build_frontend == "build":
verbosity_setting = " ".join(verbosity_flags)
extra_flags += (f"--config-setting={verbosity_setting}",)
if not 0 <= build_options.build_verbosity < 2:
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
log.warning(msg)
build_env = env.copy()
if build_options.dependency_constraints:
constraint_path = (
+4 -4
View File
@@ -414,11 +414,10 @@ def build(options: Options, tmp_path: Path) -> None:
log.step("Building wheel...")
built_wheel_dir.mkdir()
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
if build_frontend == "pip":
extra_flags += verbosity_flags
extra_flags += get_build_verbosity_extra_flags(build_options.build_verbosity)
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
# see https://github.com/pypa/cibuildwheel/pull/369
call(
@@ -433,8 +432,9 @@ def build(options: Options, tmp_path: Path) -> None:
env=env,
)
elif build_frontend == "build":
verbosity_setting = " ".join(verbosity_flags)
extra_flags += (f"--config-setting={verbosity_setting}",)
if not 0 <= build_options.build_verbosity < 2:
msg = f"build_verbosity {build_options.build_verbosity} is not supported for build frontend. Ignoring."
log.warning(msg)
build_env = env.copy()
if build_options.dependency_constraints:
constraints_path = (
+1 -1
View File
@@ -1393,7 +1393,7 @@ This option is not supported in the overrides section in `pyproject.toml`.
### `CIBW_BUILD_VERBOSITY` {: #build-verbosity}
> Increase/decrease the output of pip wheel
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.
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.
Platform-specific environment variables are also available:<br/>
`CIBW_BUILD_VERBOSITY_MACOS` | `CIBW_BUILD_VERBOSITY_WINDOWS` | `CIBW_BUILD_VERBOSITY_LINUX`