diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-08-29 12:41:46 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-09-08 21:39:06 +0200 |
| commit | 0d500d003d4c8f199aaae3cfa830227261b48ed0 (patch) | |
| tree | af27924e8615ab61f74167f350c5b23b477d5f08 /create_wheels.py | |
| parent | 9bca4e6c1d2a1a374dee704c33e1b8f6ab337f61 (diff) | |
macOS wheel creation: Fix wheel name
- The macOS version in the wheel name was picked up from Python's
build configuration instead of Qt.
- The solution involves writing the cmake variable
QT_DARWIN_MIN_DEPLOYMENT_TARGET into _config.py, and create_wheels.py
loads this _config.py to fetch the python variable storing it.
Pick-to: 6.5
Fixes: PYSIDE-2429
Change-Id: I85003174b83ba937c8b3e1498b728f13d960284e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'create_wheels.py')
| -rw-r--r-- | create_wheels.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/create_wheels.py b/create_wheels.py index ad52aa9c5..e3c9d1d85 100644 --- a/create_wheels.py +++ b/create_wheels.py @@ -4,6 +4,7 @@ import os import platform import sys +import importlib from argparse import ArgumentParser, Namespace from dataclasses import dataclass from pathlib import Path @@ -86,7 +87,18 @@ def generate_setup_cfg(artifacts: Path, setup: SetupData) -> str: # Will generate manylinux_2_28_x86_64 _tag = f"manylinux_{glibc}_{arch}" elif _os == "darwin": - target = get_config_var("MACOSX_DEPLOYMENT_TARGET") + # find _config.py and load it to obtain __qt_macos_min_deployment_target__ + target = None + config_py = package_path / "shiboken6" / "_config.py" + if not config_py.exists(): + raise RuntimeError(f"Unable to find {str(config_py)}") + + module_name = config_py.name[:-3] + _spec = importlib.util.spec_from_file_location(f"{module_name}", config_py) + _module = importlib.util.module_from_spec(_spec) + _spec.loader.exec_module(module=_module) + target = _module.__qt_macos_min_deployment_target__ + if not target: print("Error: couldn't get the value from MACOSX_DEPLOYMENT_TARGET. " "Falling back to local platform version.") |
