Merge pull request #98 from Bing-su/fix/setup.py

feat: Version-independent wheel files
This commit is contained in:
Shunsuke Shibayama 2024-08-14 15:33:44 +09:00 committed by GitHub
commit 11527b305f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -10,12 +10,23 @@ from setuptools import setup, Command
from setuptools_rust import RustBin
import tomli
try:
# setuptools >= 70.1.0
from setuptools.command.bdist_wheel import bdist_wheel
except ImportError:
from wheel.bdist_wheel import bdist_wheel
def removeprefix(string, prefix):
if string.startswith(prefix):
return string[len(prefix):]
else:
return string
class BdistWheel(bdist_wheel):
def get_tag(self):
_, _, plat = super().get_tag()
return "py3", "none", plat
class Clean(Command):
user_options = []
def initialize_options(self):
@ -68,6 +79,7 @@ setup(
],
cmdclass={
"clean": Clean,
"bdist_wheel": BdistWheel,
},
classifiers=[
"Development Status :: 2 - Pre-Alpha",