Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 13, 2022
1 parent cc2b61f commit c200dea
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions cibuildwheel/windows.py
Expand Up @@ -35,7 +35,6 @@
)



def get_nuget_args(version: str, arch: str, output_directory: Path) -> List[str]:
platform_suffix = {"32": "x86", "64": "", "ARM64": "arm64"}
python_name = "python" + platform_suffix[arch]
Expand Down Expand Up @@ -125,7 +124,7 @@ def setup_python(
dependency_constraint_flags: Sequence[PathOrStr],
environment: ParsedEnvironment,
build_frontend: BuildFrontend,
cross_compiling_target_arch: Optional[str]
cross_compiling_target_arch: Optional[str],
) -> Dict[str, str]:
tmp.mkdir()

Expand All @@ -136,9 +135,9 @@ def setup_python(
implementation_id = python_configuration.identifier.split("-")[0]
log.step(f"Installing Python {implementation_id}...")
if implementation_id.startswith("cp"):
base_python = install_cpython(python_configuration.version,
python_configuration.arch,
python_suffix)
base_python = install_cpython(
python_configuration.version, python_configuration.arch, python_suffix
)
elif implementation_id.startswith("pp"):
if cross_compiling_target_arch:
raise ValueError("cross compilation is only supported with cpython variant")
Expand All @@ -152,11 +151,11 @@ def setup_python(
# we copy target libs in base libs
# there is no other proper way to pass this directory on LIBPATH
# when compiling the wheel.
target_python = install_cpython(python_configuration.version,
cross_compiling_target_arch,
python_suffix)
base_libs = base_python.parent / 'libs'
target_libs = target_python.parent / 'libs'
target_python = install_cpython(
python_configuration.version, cross_compiling_target_arch, python_suffix
)
base_libs = base_python.parent / "libs"
target_libs = target_python.parent / "libs"
shutil.rmtree(base_libs)
shutil.copytree(target_libs, base_libs)

Expand Down Expand Up @@ -335,7 +334,7 @@ def build(options: Options, tmp_path: Path) -> None:

if config.arch == "ARM64" and platform.machine() == "AMD64":
x64_arch = "64"
config = config._replace(arch = x64_arch)
config = config._replace(arch=x64_arch)
cross_compiling_target_arch = "ARM64"
log.step("Cross compiling for " + cross_compiling_target_arch + "...")

Expand Down Expand Up @@ -449,7 +448,11 @@ def build(options: Options, tmp_path: Path) -> None:
if cross_compiling_target_arch:
log.step("skip wheel testing (cross compile)")

if not cross_compiling_target_arch and build_options.test_command and options.globals.test_selector(config.identifier):
if (
not cross_compiling_target_arch
and build_options.test_command
and options.globals.test_selector(config.identifier)
):
log.step("Testing wheel...")
# set up a virtual environment to install and test from, to make sure
# there are no dependencies that were pulled in at build time.
Expand Down

0 comments on commit c200dea

Please sign in to comment.