From 513f112d6ae33bc50c26da2d438ca86c24c7ffcc Mon Sep 17 00:00:00 2001 From: Dowon Date: Sun, 11 Aug 2024 17:07:50 +0900 Subject: [PATCH] feat: Version-independent wheel files --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 8a5febc..66bebbb 100644 --- a/setup.py +++ b/setup.py @@ -10,12 +10,23 @@ 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 @@ def run(self): ], cmdclass={ "clean": Clean, + "bdist_wheel": BdistWheel, }, classifiers=[ "Development Status :: 2 - Pre-Alpha",