Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dependency to wheel>=0.34.0 #272

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["py-cpuinfo==8.0.0", "setuptools", "wheel"]
requires = ["py-cpuinfo==8.0.0", "setuptools", "wheel>=0.34.0"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ setuptools
sphinx
sphinx_rtd_theme
nbsphinx
wheel
wheel>=0.34.0
36 changes: 12 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from distutils.errors import CompileError
import distutils.ccompiler
import distutils.sysconfig
from wheel.bdist_wheel import bdist_wheel, get_platform

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand All @@ -70,29 +71,17 @@
except Exception:
cpuinfo_parse_arch = None

# Patch bdist_wheel
try:
from wheel.bdist_wheel import bdist_wheel
except ImportError:
BDistWheel = None
else:
from pkg_resources import parse_version
import wheel
from wheel.bdist_wheel import get_platform

class BDistWheel(bdist_wheel):
"""Override bdist_wheel to handle as pure python package"""

def finalize_options(self):
if parse_version(wheel.__version__) >= parse_version('0.34.0'):
self.plat_name = get_platform(self.bdist_dir)
else:
self.plat_name = get_platform()
bdist_wheel.finalize_options(self)

def get_tag(self):
"""Override the python and abi tag generation"""
return self.python_tag, "none", bdist_wheel.get_tag(self)[-1]
class BDistWheel(bdist_wheel):
"""Override bdist_wheel to handle as pure python package"""

def finalize_options(self):
self.plat_name = get_platform(self.bdist_dir)
bdist_wheel.finalize_options(self)

def get_tag(self):
"""Override the python and abi tag generation"""
return self.python_tag, "none", bdist_wheel.get_tag(self)[-1]


# Probe host capabilities and manage build config
Expand Down Expand Up @@ -1325,13 +1314,12 @@ def make_distribution(self):
"Topic :: Software Development :: Libraries :: Python Modules",
]
cmdclass = dict(
bdist_wheel=BDistWheel,
build=Build,
build_clib=BuildCLib,
build_ext=PluginBuildExt,
build_py=BuildPy,
debian_src=sdist_debian)
if BDistWheel is not None:
cmdclass['bdist_wheel'] = BDistWheel


if __name__ == "__main__":
Expand Down
Loading