Skip to content

Commit 1239bcd

Browse files
committed
[Feature]distinguish whl version (#7204)
* [Feature]whl version * [Feature]whl version,set root_is_pure = false * [Feature]code style
1 parent 22a217f commit 1239bcd

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

setup.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from pathlib import Path
2424

2525
import paddle
26+
from packaging import tags
2627
from setuptools import Extension, find_packages, setup
2728
from setuptools.command.build_ext import build_ext
2829
from setuptools.command.install import install
@@ -42,16 +43,17 @@
4243

4344

4445
class CustomBdistWheel(bdist_wheel):
45-
"""Custom wheel builder for pure Python packages."""
46+
"""Custom wheel builder."""
4647

4748
def finalize_options(self):
48-
"""Configure wheel as pure Python and platform-independent."""
49+
"""Configure wheel as {python tag}-{abi tag}-{platform tag}."""
4950
super().finalize_options()
50-
self.root_is_pure = True
51-
self.python_tag = "py3"
52-
self.abi_tag = "none"
51+
tag = next(tags.sys_tags())
52+
self.root_is_pure = False
53+
self.python_tag = tag.interpreter
54+
self.abi_tag = tag.abi
5355
self.plat_name_supplied = True
54-
self.plat_name = "any"
56+
self.plat_name = tag.platform
5557

5658

5759
class CMakeExtension(Extension):

0 commit comments

Comments
 (0)