From f35b645a8ff77fc95ba84a1d59685cff902c1e83 Mon Sep 17 00:00:00 2001 From: dasm Date: Tue, 9 Sep 2025 14:29:17 -0700 Subject: [PATCH 1/2] Tweaks for getting cibuildwheel working on a mac. --- ext/build.py | 10 +++++++--- pyproject.toml | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ext/build.py b/ext/build.py index 4af9cc9..dab39ab 100755 --- a/ext/build.py +++ b/ext/build.py @@ -1,9 +1,10 @@ +import platform import subprocess import sys -import platform import sysconfig from pathlib import Path from typing import Any + from hatchling.builders.hooks.plugin.interface import BuildHookInterface build_dir = Path(__file__).parent @@ -38,6 +39,7 @@ def check_platform(): sys.exit(1) print(f"Running on: {platform.system()} {platform.machine()}") + class CustomBuildHook(BuildHookInterface): def initialize(self, _version: str, build_data: dict[str, Any]): # Tell hatchling to indicate that the package is not pure Python in its @@ -48,8 +50,10 @@ def initialize(self, _version: str, build_data: dict[str, Any]): # to some disagreement between sysconfig and various packaging tools, we # need to slightly alter the format of the platform tag for it to be # accepted by cibuildwheel. - build_data['pure_python'] = False - build_data['tag'] = f'py3-none-{sysconfig.get_platform().replace("-", "_")}' + build_data["pure_python"] = False + build_data["tag"] = ( + f'py3-none-{sysconfig.get_platform().replace("-", "_").replace(".", "_")}' + ) check_platform() try: diff --git a/pyproject.toml b/pyproject.toml index ce7bdd6..3fda71f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,6 +146,7 @@ only-include = [ packages = ["src/tmlt"] artifacts = [ "src/tmlt/core/ext/lib/*.so.*", + "src/tmlt/core/ext/lib/*[0-9].dylib", "src/tmlt/core/ext/__init__.py", "src/tmlt/core/ext/lib/__init__.py", ] @@ -153,6 +154,7 @@ artifacts = [ [tool.cibuildwheel] build = "cp39-* cp310-* cp311-* cp312-*" skip = "*-musllinux*" +environment = "MACOSX_DEPLOYMENT_TARGET='11.0'" [tool.cibuildwheel.linux] archs = ["x86_64"] From bf961072f9b37cd16ee6329a595c0bbbafd570c1 Mon Sep 17 00:00:00 2001 From: dasm Date: Tue, 9 Sep 2025 15:08:19 -0700 Subject: [PATCH 2/2] Make environment variable mac-specific. --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3fda71f..83c78fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -154,6 +154,8 @@ artifacts = [ [tool.cibuildwheel] build = "cp39-* cp310-* cp311-* cp312-*" skip = "*-musllinux*" + +[tool.cibuildwheel.macos] environment = "MACOSX_DEPLOYMENT_TARGET='11.0'" [tool.cibuildwheel.linux]