这是indexloc提供的服务,不要输入任何密码
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
10 changes: 7 additions & 3 deletions ext/build.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand All @@ -154,6 +155,9 @@ artifacts = [
build = "cp39-* cp310-* cp311-* cp312-*"
skip = "*-musllinux*"

[tool.cibuildwheel.macos]
environment = "MACOSX_DEPLOYMENT_TARGET='11.0'"

[tool.cibuildwheel.linux]
archs = ["x86_64"]

Expand Down