Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cibuildwheel/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def options_summary(self) -> str | dict[str, str]:
return {"name": self.name, "args": repr(self.args)}


def _get_verbosity_flags(level: int, frontend: BuildFrontendName) -> list[str]:
def _get_verbosity_flags(level: int, frontend: BuildFrontendName, *, py38: bool) -> list[str]:
if level < 0:
if frontend == "pip":
return ["-" + -level * "q"]

msg = f"build_verbosity {level} is not supported for {frontend} frontend. Ignoring."
log.warning(msg)
if frontend.startswith("build") and py38:
msg = f"build_verbosity {level} is not supported for {frontend} frontend. Ignoring."
log.warning(msg)
return []
return ["-" + -level * "q"]

if level > 0:
if frontend == "pip":
Expand Down Expand Up @@ -75,10 +75,10 @@ def parse_config_settings(config_settings_str: str) -> dict[str, str | list[str]


def get_build_frontend_extra_flags(
build_frontend: BuildFrontendConfig, verbosity_level: int, config_settings: str
build_frontend: BuildFrontendConfig, verbosity_level: int, config_settings: str, *, py38: bool
) -> list[str]:
return [
*_split_config_settings(config_settings),
*build_frontend.args,
*_get_verbosity_flags(verbosity_level, build_frontend.name),
*_get_verbosity_flags(verbosity_level, build_frontend.name, py38=py38),
]
2 changes: 2 additions & 0 deletions cibuildwheel/platforms/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ def build_wheel(state: BuildState) -> Path:
state.options.build_frontend,
state.options.build_verbosity,
state.options.config_settings,
py38=False,
),
env=state.android_env,
)
Expand All @@ -474,6 +475,7 @@ def build_wheel(state: BuildState) -> Path:
state.options.build_frontend,
state.options.build_verbosity,
state.options.config_settings,
py38=False,
),
env=state.android_env,
)
Expand Down
5 changes: 4 additions & 1 deletion cibuildwheel/platforms/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ def build(options: Options, tmp_path: Path) -> None:
built_wheel_dir.mkdir()

extra_flags = get_build_frontend_extra_flags(
build_frontend, build_options.build_verbosity, build_options.config_settings
build_frontend,
build_options.build_verbosity,
build_options.config_settings,
py38=False,
)

match build_frontend.name:
Expand Down
5 changes: 4 additions & 1 deletion cibuildwheel/platforms/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ def build_in_container(
container.call(["mkdir", "-p", built_wheel_dir])

extra_flags = get_build_frontend_extra_flags(
build_frontend, build_options.build_verbosity, build_options.config_settings
build_frontend,
build_options.build_verbosity,
build_options.config_settings,
py38=config.identifier[1:].startswith("p38"),
)

match build_frontend.name:
Expand Down
5 changes: 4 additions & 1 deletion cibuildwheel/platforms/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,10 @@ def build(options: Options, tmp_path: Path) -> None:
built_wheel_dir.mkdir()

extra_flags = get_build_frontend_extra_flags(
build_frontend, build_options.build_verbosity, build_options.config_settings
build_frontend,
build_options.build_verbosity,
build_options.config_settings,
py38=config.identifier[1:].startswith("p38"),
)

build_env = env.copy()
Expand Down
5 changes: 4 additions & 1 deletion cibuildwheel/platforms/pyodide.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,10 @@ def build(options: Options, tmp_path: Path) -> None:
log.step("Building wheel...")

extra_flags = get_build_frontend_extra_flags(
build_frontend, build_options.build_verbosity, build_options.config_settings
build_frontend,
build_options.build_verbosity,
build_options.config_settings,
py38=False,
)

call(
Expand Down
5 changes: 4 additions & 1 deletion cibuildwheel/platforms/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,10 @@ def build(options: Options, tmp_path: Path) -> None:
built_wheel_dir.mkdir()

extra_flags = get_build_frontend_extra_flags(
build_frontend, build_options.build_verbosity, build_options.config_settings
build_frontend,
build_options.build_verbosity,
build_options.config_settings,
py38=config.identifier[1:].startswith("p38"),
)

if (
Expand Down
18 changes: 10 additions & 8 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1760,14 +1760,16 @@ will not produce more logging about the build itself. Other levels only affect
the build frontend output, which is usually things like resolving and
downloading dependencies. The settings are:

| | build | pip | desc |
|-------------|-------|--------|----------------------------------|
| -2 | N/A | `-qq` | even more quiet, where supported |
| -1 | N/A | `-q` | quiet mode, where supported |
| 0 (default) | | | default for build tool |
| 1 | | `-v` | print backend output |
| 2 | `-v` | `-vv` | print log messages e.g. resolving info |
| 3 | `-vv` | `-vvv` | print even more debug info |
| | build | pip | uv | desc |
|-------------|-------|--------|-------|----------------------------------|
| -2 | `-qq`[^1] | `-qq` | `-qq` | even more quiet, where supported |
| -1 | `-q`[^1] | `-q` | `-q` | quiet mode, where supported |
| 0 (default) | | | | default for build tool |
| 1 | | `-v` | | print backend output |
| 2 | `-v` | `-vv` | `-v` | print log messages e.g. resolving info |
| 3 | `-vv` | `-vvv` | `-vv` | print even more debug info |

[^1]: Not supported on Python 3.8, will be ignored with a warning.

Settings that are not supported for a specific frontend will log a warning.
The default build frontend is `build`, which does show build backend output by
Expand Down
8 changes: 6 additions & 2 deletions unit_test/options_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,15 @@ def test_deprecated_image(
("pip", 3, ["-Ca", "-Cb", "-1", "-vvv"]),
("pip", 2, ["-Ca", "-Cb", "-1", "-vv"]),
("pip", -1, ["-Ca", "-Cb", "-1", "-q"]),
("uv", -1, ["-Ca", "-Cb", "-1", "-q"]),
("build", -1, ["-Ca", "-Cb", "-1", "-q"]),
("build[uv]", -1, ["-Ca", "-Cb", "-1", "-q"]),
("build", 0, ["-Ca", "-Cb", "-1"]),
("build", 1, ["-Ca", "-Cb", "-1"]),
("build", 2, ["-Ca", "-Cb", "-1", "-v"]),
("build", 3, ["-Ca", "-Cb", "-1", "-vv"]),
("build[uv]", 3, ["-Ca", "-Cb", "-1", "-vv"]),
("uv", 3, ["-Ca", "-Cb", "-1", "-vv"]),
],
)
def test_get_build_frontend_extra_flags(
Expand All @@ -611,7 +615,7 @@ def test_get_build_frontend_extra_flags(
monkeypatch.setattr(Logger, "warning", mock_warning)
build_frontend = BuildFrontendConfig(frontend, ["-1"])
args = get_build_frontend_extra_flags(
build_frontend=build_frontend, verbosity_level=verbosity, config_settings="a b"
build_frontend=build_frontend, verbosity_level=verbosity, config_settings="a b", py38=False
)

assert args == result
Expand All @@ -626,7 +630,7 @@ def test_get_build_frontend_extra_flags_warning(
monkeypatch.setattr(Logger, "warning", mock_warning)
build_frontend = BuildFrontendConfig(frontend, ["-1"])
args = get_build_frontend_extra_flags(
build_frontend=build_frontend, verbosity_level=-1, config_settings="a b"
build_frontend=build_frontend, verbosity_level=-1, config_settings="a b", py38=True
)
assert args == ["-Ca", "-Cb", "-1"]
mock_warning.assert_called_once()
Expand Down
Loading