Merge pull request #1462 from hoodmane/default-build-frontend
Set the default build_frontend to be "default" (which is still "pip")
This commit is contained in:
@@ -17,6 +17,7 @@ from .util import (
|
|||||||
AlreadyBuiltWheelError,
|
AlreadyBuiltWheelError,
|
||||||
BuildSelector,
|
BuildSelector,
|
||||||
NonPlatformWheelError,
|
NonPlatformWheelError,
|
||||||
|
build_frontend_or_default,
|
||||||
find_compatible_wheel,
|
find_compatible_wheel,
|
||||||
get_build_verbosity_extra_flags,
|
get_build_verbosity_extra_flags,
|
||||||
prepare_command,
|
prepare_command,
|
||||||
@@ -175,6 +176,7 @@ def build_in_container(
|
|||||||
for config in platform_configs:
|
for config in platform_configs:
|
||||||
log.build_start(config.identifier)
|
log.build_start(config.identifier)
|
||||||
build_options = options.build_options(config.identifier)
|
build_options = options.build_options(config.identifier)
|
||||||
|
build_frontend = build_frontend_or_default(build_options.build_frontend)
|
||||||
|
|
||||||
dependency_constraint_flags: list[PathOrStr] = []
|
dependency_constraint_flags: list[PathOrStr] = []
|
||||||
|
|
||||||
@@ -241,11 +243,9 @@ def build_in_container(
|
|||||||
container.call(["mkdir", "-p", built_wheel_dir])
|
container.call(["mkdir", "-p", built_wheel_dir])
|
||||||
|
|
||||||
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
|
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
|
||||||
extra_flags = split_config_settings(
|
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
|
||||||
build_options.config_settings, build_options.build_frontend
|
|
||||||
)
|
|
||||||
|
|
||||||
if build_options.build_frontend == "pip":
|
if build_frontend == "pip":
|
||||||
extra_flags += verbosity_flags
|
extra_flags += verbosity_flags
|
||||||
container.call(
|
container.call(
|
||||||
[
|
[
|
||||||
@@ -260,7 +260,7 @@ def build_in_container(
|
|||||||
],
|
],
|
||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
elif build_options.build_frontend == "build":
|
elif build_frontend == "build":
|
||||||
verbosity_setting = " ".join(verbosity_flags)
|
verbosity_setting = " ".join(verbosity_flags)
|
||||||
extra_flags += (f"--config-setting={verbosity_setting}",)
|
extra_flags += (f"--config-setting={verbosity_setting}",)
|
||||||
container.call(
|
container.call(
|
||||||
@@ -276,7 +276,7 @@ def build_in_container(
|
|||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
assert_never(build_options.build_frontend)
|
assert_never(build_frontend)
|
||||||
|
|
||||||
built_wheel = container.glob(built_wheel_dir, "*.whl")[0]
|
built_wheel = container.glob(built_wheel_dir, "*.whl")[0]
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ from .util import (
|
|||||||
BuildFrontend,
|
BuildFrontend,
|
||||||
BuildSelector,
|
BuildSelector,
|
||||||
NonPlatformWheelError,
|
NonPlatformWheelError,
|
||||||
|
build_frontend_or_default,
|
||||||
call,
|
call,
|
||||||
detect_ci_provider,
|
detect_ci_provider,
|
||||||
download,
|
download,
|
||||||
@@ -331,6 +332,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
|
|
||||||
for config in python_configurations:
|
for config in python_configurations:
|
||||||
build_options = options.build_options(config.identifier)
|
build_options = options.build_options(config.identifier)
|
||||||
|
build_frontend = build_frontend_or_default(build_options.build_frontend)
|
||||||
log.build_start(config.identifier)
|
log.build_start(config.identifier)
|
||||||
|
|
||||||
identifier_tmp_dir = tmp_path / config.identifier
|
identifier_tmp_dir = tmp_path / config.identifier
|
||||||
@@ -353,7 +355,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
config,
|
config,
|
||||||
dependency_constraint_flags,
|
dependency_constraint_flags,
|
||||||
build_options.environment,
|
build_options.environment,
|
||||||
build_options.build_frontend,
|
build_frontend,
|
||||||
)
|
)
|
||||||
|
|
||||||
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
|
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
|
||||||
@@ -375,11 +377,9 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
built_wheel_dir.mkdir()
|
built_wheel_dir.mkdir()
|
||||||
|
|
||||||
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
|
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
|
||||||
extra_flags = split_config_settings(
|
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
|
||||||
build_options.config_settings, build_options.build_frontend
|
|
||||||
)
|
|
||||||
|
|
||||||
if build_options.build_frontend == "pip":
|
if build_frontend == "pip":
|
||||||
extra_flags += verbosity_flags
|
extra_flags += verbosity_flags
|
||||||
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
|
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
|
||||||
# see https://github.com/pypa/cibuildwheel/pull/369
|
# see https://github.com/pypa/cibuildwheel/pull/369
|
||||||
@@ -394,7 +394,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
*extra_flags,
|
*extra_flags,
|
||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
elif build_options.build_frontend == "build":
|
elif build_frontend == "build":
|
||||||
verbosity_setting = " ".join(verbosity_flags)
|
verbosity_setting = " ".join(verbosity_flags)
|
||||||
extra_flags += (f"--config-setting={verbosity_setting}",)
|
extra_flags += (f"--config-setting={verbosity_setting}",)
|
||||||
build_env = env.copy()
|
build_env = env.copy()
|
||||||
@@ -417,7 +417,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
env=build_env,
|
env=build_env,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
assert_never(build_options.build_frontend)
|
assert_never(build_frontend)
|
||||||
|
|
||||||
built_wheel = next(built_wheel_dir.glob("*.whl"))
|
built_wheel = next(built_wheel_dir.glob("*.whl"))
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class BuildOptions:
|
|||||||
test_requires: list[str]
|
test_requires: list[str]
|
||||||
test_extras: str
|
test_extras: str
|
||||||
build_verbosity: int
|
build_verbosity: int
|
||||||
build_frontend: BuildFrontend
|
build_frontend: BuildFrontend | Literal["default"]
|
||||||
config_settings: str
|
config_settings: str
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -499,11 +499,13 @@ class Options:
|
|||||||
test_extras = self.reader.get("test-extras", sep=",")
|
test_extras = self.reader.get("test-extras", sep=",")
|
||||||
build_verbosity_str = self.reader.get("build-verbosity")
|
build_verbosity_str = self.reader.get("build-verbosity")
|
||||||
|
|
||||||
build_frontend: BuildFrontend
|
build_frontend: BuildFrontend | Literal["default"]
|
||||||
if build_frontend_str == "build":
|
if build_frontend_str == "build":
|
||||||
build_frontend = "build"
|
build_frontend = "build"
|
||||||
elif build_frontend_str == "pip":
|
elif build_frontend_str == "pip":
|
||||||
build_frontend = "pip"
|
build_frontend = "pip"
|
||||||
|
elif build_frontend_str == "default":
|
||||||
|
build_frontend = "default"
|
||||||
else:
|
else:
|
||||||
msg = f"cibuildwheel: Unrecognised build frontend {build_frontend_str!r}, only 'pip' and 'build' are supported"
|
msg = f"cibuildwheel: Unrecognised build frontend {build_frontend_str!r}, only 'pip' and 'build' are supported"
|
||||||
print(msg, file=sys.stderr)
|
print(msg, file=sys.stderr)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ skip = ""
|
|||||||
test-skip = ""
|
test-skip = ""
|
||||||
|
|
||||||
archs = ["auto"]
|
archs = ["auto"]
|
||||||
build-frontend = "pip"
|
build-frontend = "default"
|
||||||
config-settings = {}
|
config-settings = {}
|
||||||
dependency-versions = "pinned"
|
dependency-versions = "pinned"
|
||||||
environment = {}
|
environment = {}
|
||||||
|
|||||||
@@ -71,6 +71,15 @@ test_fail_cwd_file: Final[Path] = resources_dir / "testing_temp_dir_file.py"
|
|||||||
|
|
||||||
BuildFrontend = Literal["pip", "build"]
|
BuildFrontend = Literal["pip", "build"]
|
||||||
|
|
||||||
|
|
||||||
|
def build_frontend_or_default(
|
||||||
|
setting: BuildFrontend | Literal["default"], default: BuildFrontend = "pip"
|
||||||
|
) -> BuildFrontend:
|
||||||
|
if setting == "default":
|
||||||
|
return default
|
||||||
|
return setting
|
||||||
|
|
||||||
|
|
||||||
MANYLINUX_ARCHS: Final[tuple[str, ...]] = (
|
MANYLINUX_ARCHS: Final[tuple[str, ...]] = (
|
||||||
"x86_64",
|
"x86_64",
|
||||||
"i686",
|
"i686",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ from .util import (
|
|||||||
BuildFrontend,
|
BuildFrontend,
|
||||||
BuildSelector,
|
BuildSelector,
|
||||||
NonPlatformWheelError,
|
NonPlatformWheelError,
|
||||||
|
build_frontend_or_default,
|
||||||
call,
|
call,
|
||||||
download,
|
download,
|
||||||
find_compatible_wheel,
|
find_compatible_wheel,
|
||||||
@@ -367,6 +368,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
|
|
||||||
for config in python_configurations:
|
for config in python_configurations:
|
||||||
build_options = options.build_options(config.identifier)
|
build_options = options.build_options(config.identifier)
|
||||||
|
build_frontend = build_frontend_or_default(build_options.build_frontend)
|
||||||
log.build_start(config.identifier)
|
log.build_start(config.identifier)
|
||||||
|
|
||||||
identifier_tmp_dir = tmp_path / config.identifier
|
identifier_tmp_dir = tmp_path / config.identifier
|
||||||
@@ -387,7 +389,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
config,
|
config,
|
||||||
dependency_constraint_flags,
|
dependency_constraint_flags,
|
||||||
build_options.environment,
|
build_options.environment,
|
||||||
build_options.build_frontend,
|
build_frontend,
|
||||||
)
|
)
|
||||||
|
|
||||||
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
|
compatible_wheel = find_compatible_wheel(built_wheels, config.identifier)
|
||||||
@@ -412,11 +414,9 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
built_wheel_dir.mkdir()
|
built_wheel_dir.mkdir()
|
||||||
|
|
||||||
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
|
verbosity_flags = get_build_verbosity_extra_flags(build_options.build_verbosity)
|
||||||
extra_flags = split_config_settings(
|
extra_flags = split_config_settings(build_options.config_settings, build_frontend)
|
||||||
build_options.config_settings, build_options.build_frontend
|
|
||||||
)
|
|
||||||
|
|
||||||
if build_options.build_frontend == "pip":
|
if build_frontend == "pip":
|
||||||
extra_flags += verbosity_flags
|
extra_flags += verbosity_flags
|
||||||
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
|
# Path.resolve() is needed. Without it pip wheel may try to fetch package from pypi.org
|
||||||
# see https://github.com/pypa/cibuildwheel/pull/369
|
# see https://github.com/pypa/cibuildwheel/pull/369
|
||||||
@@ -431,7 +431,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
*extra_flags,
|
*extra_flags,
|
||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
elif build_options.build_frontend == "build":
|
elif build_frontend == "build":
|
||||||
verbosity_setting = " ".join(verbosity_flags)
|
verbosity_setting = " ".join(verbosity_flags)
|
||||||
extra_flags += (f"--config-setting={verbosity_setting}",)
|
extra_flags += (f"--config-setting={verbosity_setting}",)
|
||||||
build_env = env.copy()
|
build_env = env.copy()
|
||||||
@@ -464,7 +464,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
|||||||
env=build_env,
|
env=build_env,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
assert_never(build_options.build_frontend)
|
assert_never(build_frontend)
|
||||||
|
|
||||||
built_wheel = next(built_wheel_dir.glob("*.whl"))
|
built_wheel = next(built_wheel_dir.glob("*.whl"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user