xywechatpad-binary 0.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.2
2
+ Name: xywechatpad-binary
3
+ Version: 0.2
4
+ Summary: XYBotV2 Binary Distribution
5
+ Home-page: https://github.com/HenryXiaoYang/xywechatpad-binary
6
+ Author: HenryXiaoYang
7
+ Author-email: henryyang666@hotmail.com
8
+ Platform: Linux-x86_64
9
+ Platform: Linux-aarch64
10
+ Platform: macosx-x86_64
11
+ Platform: macosx-arm64
12
+ Platform: Windows-x86_64
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: platform
26
+ Dynamic: requires-python
27
+ Dynamic: summary
28
+
29
+ # XYWechatPad Binary Distribution
30
+
31
+ Binary distribution for XYBotV2
@@ -0,0 +1,3 @@
1
+ # XYWechatPad Binary Distribution
2
+
3
+ Binary distribution for XYBotV2
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,53 @@
1
+ import sys
2
+ import platform
3
+ from setuptools import setup, find_packages
4
+
5
+ # 平台检测
6
+ system = platform.system().lower()
7
+ machine = platform.machine().lower()
8
+
9
+ # 确定当前平台的二进制路径
10
+ BINARY_PATH = ""
11
+ if system == "linux":
12
+ if machine in ["x86_64", "amd64"]:
13
+ BINARY_PATH = "binaries/linux_x64/XYBotWechatPad"
14
+ elif machine == "aarch64":
15
+ BINARY_PATH = "binaries/linux_aarch64/XYBotWechatPad"
16
+ elif system == "darwin": # macOS
17
+ if machine == "arm64":
18
+ BINARY_PATH = "binaries/macos_arm64/XYBotWechatPad"
19
+ elif machine == "x86_64":
20
+ BINARY_PATH = "binaries/macos_x64/XYBotWechatPad"
21
+ elif system == "windows":
22
+ BINARY_PATH = "binaries/win_x64/XYBotWechatPad.exe"
23
+
24
+ # 版本检查
25
+ if sys.version_info < (3, 11):
26
+ raise RuntimeError("Requires Python 3.11 or higher")
27
+
28
+ setup(
29
+ name="xywechatpad-binary",
30
+ version="0.2",
31
+ author="HenryXiaoYang",
32
+ author_email="henryyang666@hotmail.com",
33
+ description="XYBotV2 Binary Distribution",
34
+ long_description=open("README.md").read(),
35
+ long_description_content_type="text/markdown",
36
+ url="https://github.com/HenryXiaoYang/xywechatpad-binary",
37
+ packages=find_packages(),
38
+ package_data={"xywechatpad_binary": [BINARY_PATH]},
39
+ classifiers=[
40
+ "Programming Language :: Python :: 3",
41
+ "Operating System :: POSIX :: Linux",
42
+ "Operating System :: MacOS",
43
+ "Operating System :: Microsoft :: Windows",
44
+ ],
45
+ python_requires='>=3.11',
46
+ platforms=[
47
+ "Linux-x86_64",
48
+ "Linux-aarch64",
49
+ "macosx-x86_64",
50
+ "macosx-arm64",
51
+ "Windows-x86_64"
52
+ ]
53
+ )
@@ -0,0 +1,56 @@
1
+ import platform
2
+ import shutil
3
+ from pathlib import Path
4
+
5
+ def copy_binary(target_dir: Path) -> Path:
6
+ """
7
+ 将当前平台的二进制文件复制到指定目录
8
+ :param target_dir: 必须存在的目标目录
9
+ :return: 复制后的完整文件路径
10
+ :raises FileNotFoundError: 当目标目录不存在时
11
+ :raises OSError: 平台不受支持时
12
+ """
13
+ system = platform.system().lower()
14
+ machine = platform.machine().lower()
15
+
16
+ # 平台到二进制路径的映射
17
+ BIN_MAP = {
18
+ "linux": {
19
+ "x86_64": "binaries/linux_x64/XYBotWechatPad",
20
+ "amd64": "binaries/linux_x64/XYBotWechatPad",
21
+ "aarch64": "binaries/linux_aarch64/XYBotWechatPad"
22
+ },
23
+ "darwin": { # macOS
24
+ "x86_64": "binaries/macos_x64/XYBotWechatPad",
25
+ "arm64": "binaries/macos_arm64/XYBotWechatPad"
26
+ },
27
+ "windows": {
28
+ "x86_64": "binaries/win_x64/XYBotWechatPad.exe",
29
+ "amd64": "binaries/win_x64/XYBotWechatPad.exe"
30
+ }
31
+ }
32
+
33
+ # 验证平台支持
34
+ if system not in BIN_MAP or machine not in BIN_MAP[system]:
35
+ raise OSError(f"Unsupported platform: {system}-{machine}")
36
+
37
+ # 获取源文件路径
38
+ src_path = Path(__file__).parent / BIN_MAP[system][machine]
39
+ if not src_path.exists():
40
+ raise FileNotFoundError(f"Binary not found: {src_path}")
41
+
42
+ # 验证目标目录
43
+ if not target_dir.is_dir():
44
+ raise FileNotFoundError(f"Target directory does not exist: {target_dir}")
45
+
46
+ # 构建目标路径
47
+ dest_path = target_dir / src_path.name
48
+
49
+ # 执行复制
50
+ shutil.copy2(src_path, dest_path)
51
+
52
+ # 设置可执行权限(非Windows)
53
+ if system != "windows":
54
+ dest_path.chmod(0o755)
55
+
56
+ return dest_path
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.2
2
+ Name: xywechatpad-binary
3
+ Version: 0.2
4
+ Summary: XYBotV2 Binary Distribution
5
+ Home-page: https://github.com/HenryXiaoYang/xywechatpad-binary
6
+ Author: HenryXiaoYang
7
+ Author-email: henryyang666@hotmail.com
8
+ Platform: Linux-x86_64
9
+ Platform: Linux-aarch64
10
+ Platform: macosx-x86_64
11
+ Platform: macosx-arm64
12
+ Platform: Windows-x86_64
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: platform
26
+ Dynamic: requires-python
27
+ Dynamic: summary
28
+
29
+ # XYWechatPad Binary Distribution
30
+
31
+ Binary distribution for XYBotV2
@@ -0,0 +1,8 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ xywechatpad_binary/__init__.py
5
+ xywechatpad_binary.egg-info/PKG-INFO
6
+ xywechatpad_binary.egg-info/SOURCES.txt
7
+ xywechatpad_binary.egg-info/dependency_links.txt
8
+ xywechatpad_binary.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ xywechatpad_binary