diff options
author | kpayson64 <kpayson@google.com> | 2016-07-19 15:43:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-19 15:43:41 -0700 |
commit | 4fa58f082b03450f0b70980d64948d90b2752c8d (patch) | |
tree | 97c9f077199f97d51727682ba234d24d8e25bf12 | |
parent | 413d302d4b0443914335a2cd95fce34e7e666a7e (diff) | |
parent | 398b06e8432e5e9007349b7c89ae6b67e02c1035 (diff) |
Merge pull request #7424 from soltanmm/macverfix
Force the Python host version on Mac OS X
-rw-r--r-- | setup.py | 6 | ||||
-rw-r--r-- | tools/distrib/python/grpcio_tools/setup.py | 6 |
2 files changed, 12 insertions, 0 deletions
@@ -30,10 +30,12 @@ """A setup module for the GRPC Python package.""" from distutils import extension as _extension +from distutils import util import os import os.path import pkg_resources import platform +import re import shlex import shutil import sys @@ -133,6 +135,10 @@ if 'darwin' in sys.platform and PY3: if mac_target and (pkg_resources.parse_version(mac_target) < pkg_resources.parse_version('10.7.0')): os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.7' + os.environ['_PYTHON_HOST_PLATFORM'] = re.sub( + r'macosx-[0-9]+\.[0-9]+-(.+)', + r'macosx-10.7-\1', + util.get_platform()) def cython_extensions(module_names, extra_sources, include_dirs, diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index a00ce01110..8082c7a665 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -28,11 +28,13 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from distutils import extension +from distutils import util import errno import os import os.path import pkg_resources import platform +import re import shlex import shutil import sys @@ -83,6 +85,10 @@ if 'darwin' in sys.platform and PY3: if mac_target and (pkg_resources.parse_version(mac_target) < pkg_resources.parse_version('10.9.0')): os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9' + os.environ['_PYTHON_HOST_PLATFORM'] = re.sub( + r'macosx-[0-9]+\.[0-9]+-(.+)', + r'macosx-10.9-\1', + util.get_platform()) def package_data(): tools_path = GRPC_PYTHON_TOOLS_PACKAGE.replace('.', os.path.sep) |