Skip to content

Commit eb2c222

Browse files
authored
add plat name (#1182)
# Pull Request ## What problem does this PR solve? Issue Number: Fixed # ## Possible side effects? - Performance: - Backward compatibility:
1 parent 8730937 commit eb2c222

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

sml/setup.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
# limitations under the License.
1414

1515
import os
16+
import platform
1617
import re
1718
import subprocess
19+
import sys
1820
from datetime import date
1921

2022
from setuptools import find_packages, setup
@@ -34,6 +36,24 @@ def get_commit_id() -> str:
3436
return commit_id
3537

3638

39+
def plat_name():
40+
# Default Linux platform tag
41+
plat_name = "manylinux2014_x86_64"
42+
43+
if sys.platform == "darwin":
44+
# macOS platform detection
45+
if platform.machine() == "x86_64":
46+
plat_name = "macosx_12_0_x86_64"
47+
else:
48+
plat_name = "macosx_12_0_arm64"
49+
elif sys.platform.startswith("linux"):
50+
# Linux platform detection
51+
if platform.machine() == "aarch64":
52+
plat_name = "manylinux_2_28_aarch64"
53+
54+
return plat_name
55+
56+
3757
def complete_version_file(*filepath):
3858
today = date.today()
3959
dstr = today.strftime("%Y%m%d")
@@ -106,5 +126,8 @@ def read_requirements():
106126
"Programming Language :: Python :: 3.10",
107127
"Programming Language :: Python :: 3.11",
108128
],
129+
options={
130+
"bdist_wheel": {"plat_name": plat_name()},
131+
},
109132
license="Apache 2.0",
110133
)

0 commit comments

Comments
 (0)