-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhatch_build.py
More file actions
30 lines (24 loc) · 1.2 KB
/
Copy pathhatch_build.py
File metadata and controls
30 lines (24 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys as 系统
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
class 平台检查钩子(BuildHookInterface):
def initialize(self, 版本, 构建数据):
super().initialize(版本, 构建数据)
# 限制只能在 Windows x64 系统上构建/安装
if 系统.platform != "win32":
raise RuntimeError(
"\n"
"===========================================================\n"
"ERROR: MyBiOut! 仅支持 Windows 平台。\n"
"==========================================================="
)
if 系统.maxsize <= 2**32:
raise RuntimeError(
"\n"
"===========================================================\n"
"ERROR: MyBiOut! 仅支持 64 位 Windows 系统。\n"
"==========================================================="
)
# 强制将 Wheel 标记为平台特定(非 pure python),并指定为 Windows 64位平台标签(win_amd64)
if self.target_name == "wheel":
构建数据["pure_python"] = False
构建数据["tag"] = "py3-none-win_amd64"