diff --git a/kokoro/release/python/linux/build_artifacts.sh b/kokoro/release/python/linux/build_artifacts.sh index 032e30d566304..0b30b271a0f26 100755 --- a/kokoro/release/python/linux/build_artifacts.sh +++ b/kokoro/release/python/linux/build_artifacts.sh @@ -43,3 +43,4 @@ build_artifact_version 2.7 build_artifact_version 3.4 build_artifact_version 3.5 build_artifact_version 3.6 +build_artifact_version 3.7 diff --git a/kokoro/release/python/macos/build_artifacts.sh b/kokoro/release/python/macos/build_artifacts.sh index 2aec5e64710d7..15d7091242ddc 100755 --- a/kokoro/release/python/macos/build_artifacts.sh +++ b/kokoro/release/python/macos/build_artifacts.sh @@ -45,3 +45,4 @@ build_artifact_version 2.7 build_artifact_version 3.4 build_artifact_version 3.5 build_artifact_version 3.6 +build_artifact_version 3.7 diff --git a/kokoro/release/python/windows/build_artifacts.bat b/kokoro/release/python/windows/build_artifacts.bat index 86270e6fb6e09..c2f6a2c1ea9a6 100644 --- a/kokoro/release/python/windows/build_artifacts.bat +++ b/kokoro/release/python/windows/build_artifacts.bat @@ -51,3 +51,13 @@ SET PYTHON=C:\python36 SET PYTHON_VERSION=3.6 SET PYTHON_ARCH=64 CALL build_single_artifact.bat + +SET PYTHON=C:\python37_32bit +SET PYTHON_VERSION=3.7 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat + +SET PYTHON=C:\python37 +SET PYTHON_VERSION=3.7 +SET PYTHON_ARCH=64 +CALL build_single_artifact.bat diff --git a/python/setup.py b/python/setup.py index a9df075e7becd..d6d3e1989883d 100755 --- a/python/setup.py +++ b/python/setup.py @@ -1,10 +1,14 @@ #! /usr/bin/env python # # See README for usage instructions. +from distutils import util import glob import os +import pkg_resources +import re import subprocess import sys +import sysconfig import platform # We must use setuptools, not distutils, because we need to use the @@ -186,6 +190,18 @@ def get_option_from_sys_argv(option_str): extra_compile_args.append('-Wno-invalid-offsetof') extra_compile_args.append('-Wno-sign-compare') + # https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes + # C++ projects must now migrate to libc++ and are recommended to set a + # deployment target of macOS 10.9 or later, or iOS 7 or later. + if sys.platform == 'darwin': + mac_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + 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()) + # https://github.com/Theano/Theano/issues/4926 if sys.platform == 'win32': extra_compile_args.append('-D_hypot=hypot')