Fix building pip packages on macOS.

This commit is contained in:
Fangjun Kuang 2021-07-19 11:34:55 +08:00
parent ee18278a03
commit 8362806add

View File

@ -2,6 +2,7 @@
import glob
import os
import platform
import shutil
import sys
from pathlib import Path
@ -15,6 +16,10 @@ def is_for_pypi():
return ans is not None
def is_macos():
return platform.system() == "Darwin"
try:
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
@ -23,7 +28,7 @@ try:
_bdist_wheel.finalize_options(self)
# In this case, the generated wheel has a name in the form
# k2-xxx-pyxx-none-any.whl
if is_for_pypi():
if is_for_pypi() and not is_macos():
self.root_is_pure = True
else:
# The generated wheel has a name ending with