diff --git a/.travis.yml b/.travis.yml index 56a1993bf..f96dce308 100644 --- a/.travis.yml +++ b/.travis.yml @@ -283,7 +283,118 @@ matrix: # python 3 osx - # - name: "klayout python3 osx10.13" + # MacOS 10.15, Python 3.9 + - name: "cp39-cp39m-macosx_10_15_x86_64.whl" + os: osx + osx_image: xcode12 # macOS 10.15 + cache: + directories: + - ccache + addons: + homebrew: + packages: + - python@3.9 + - ccache + update: true + env: + - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + + # MacOS 10.15, Python 3.8 + - name: "cp38-cp38m-macosx_10_15_x86_64.whl" + os: osx + osx_image: xcode12 # macOS 10.15 + cache: + directories: + - ccache + addons: + homebrew: + packages: + - python@3.8 + - ccache + update: true + env: + - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + + # MacOS 10.15, Python 3.7 + - name: "cp37-cp37m-macosx_10_15_x86_64.whl" + os: osx + osx_image: xcode12 # macOS 10.15 + cache: + directories: + - ccache + addons: + homebrew: + packages: + - python@3.7 + - ccache + update: true + env: + - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + + # MacOS 10.14, Python 3.9 + - name: "cp39-cp39m-macosx_10_14_x86_64.whl" + os: osx + osx_image: xcode11 # macOS 10.14 + cache: + directories: + - ccache + addons: + homebrew: + packages: + - python@3.9 + - ccache + update: true + env: + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + + # MacOS 10.14, Python 3.8 + - name: "cp38-cp38m-macosx_10_14_x86_64.whl" + os: osx + osx_image: xcode11 # macOS 10.14 + cache: + directories: + - ccache + addons: + homebrew: + packages: + - python@3.8 + - ccache + update: true + env: + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + + # MacOS 10.14, Python 3.7 + - name: "cp37-cp37m-macosx_10_14_x86_64.whl" + os: osx + osx_image: xcode11 # macOS 10.14 + cache: + directories: + - ccache + addons: + homebrew: + packages: + - python@3.7 + - ccache + update: true + env: + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + + # MacOS 10.13, Python 3.7 - name: "cp37-cp37m-macosx_10_13_x86_64.whl" os: osx osx_image: xcode9.4 # macOS 10.13 @@ -302,7 +413,7 @@ matrix: - PIP_UPDATE="1" - PYTHON_BUILD=true - # - name: "klayout python3.6.6 osx10.13" + # MacOS 10.13, Python 3.6 - name: "cp36-cp36m-macosx_10_13_x86_64.whl" os: osx osx_image: xcode9.4 # macOS 10.13 @@ -320,7 +431,7 @@ matrix: - PIP_UPDATE="1" - PYTHON_BUILD=true - # - name: "klayout python3.5.6 osx10.13" + # MacOS 10.13, Python 3.5 - name: "cp35-cp35m-macosx_10_13_x86_64.whl" os: osx osx_image: xcode9.4 # macOS 10.13 @@ -375,6 +486,8 @@ matrix: - PIP_UPDATE="1" - PYTHON_BUILD=true + # KLayout builds not enabled for now + exclude: # KLayout builds for mac # Python 3 - name: "KLayout macOS 10.13 with py3.7" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 55921a370..33e89610e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,6 +28,9 @@ jobs: cp38-cp38-win_amd64.whl: python.version: '3.8' python.architecture: 'x64' + cp39-cp39-win_amd64.whl: + python.version: '3.9' + python.architecture: 'x64' cp35-cp35m-win32.whl: python.version: '3.5' python.architecture: 'x86' @@ -40,6 +43,9 @@ jobs: cp38-cp38-win32.whl: python.version: '3.8' python.architecture: 'x86' + cp39-cp39-win32.whl: + python.version: '3.9' + python.architecture: 'x86' maxParallel: 6 steps: @@ -123,6 +129,11 @@ jobs: vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04' steps: - checkout: none #skip checking out the default repository resource + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts wheel-3.9.x64' + inputs: + artifactName: 'wheel-3.9.x64' + downloadPath: '$(System.DefaultWorkingDirectory)' - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifacts wheel-3.8.x64' inputs: @@ -143,6 +154,11 @@ jobs: inputs: artifactName: 'wheel-3.5.x64' downloadPath: '$(System.DefaultWorkingDirectory)' + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts wheel-3.9.x86' + inputs: + artifactName: 'wheel-3.9.x86' + downloadPath: '$(System.DefaultWorkingDirectory)' - task: DownloadBuildArtifacts@0 displayName: 'Download Build Artifacts wheel-3.8.x86' inputs: diff --git a/setup.py b/setup.py index dbef7ca6e..02fb3b637 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ from setuptools.extension import Extension, Library import glob import os import re +import sys import platform from distutils.errors import CompileError import distutils.command.build_ext @@ -102,12 +103,20 @@ def parallelCCompile(self, sources, output_dir=None, macros=None, include_dirs=N # only if python version > 2.6, somehow the travis compiler hangs in 2.6 -import sys -if sys.version_info[0] * 10 + sys.version_info[1] > 26: +if sys.version_info[0] * 100 + sys.version_info[1] > 206: import distutils.ccompiler distutils.ccompiler.CCompiler.compile = parallelCCompile +# put a path in quotes if required +def quote_path(path): + # looks like disutils don't need path quoting in version >= 3.9: + if " " in path and sys.version_info[0] * 100 + sys.version_info[1] < 309: + return "\"" + path + "\"" + else: + return path + + # TODO: delete (Obsolete) # patch get_ext_filename from distutils.command.build_ext import build_ext @@ -252,10 +261,10 @@ class Config(object): if platform.system() == "Windows": bits = os.getenv("KLAYOUT_BITS") if bits: - return ["\"-I" + os.path.join(bits, "zlib", "include") + "\"", - "\"-I" + os.path.join(bits, "ptw", "include") + "\"", - "\"-I" + os.path.join(bits, "expat", "include") + "\"", - "\"-I" + os.path.join(bits, "curl", "include") + "\""] + return [quote_path("-I" + os.path.join(bits, "zlib", "include")), + quote_path("-I" + os.path.join(bits, "ptw", "include")), + quote_path("-I" + os.path.join(bits, "expat", "include")), + quote_path("-I" + os.path.join(bits, "curl", "include"))] else: return [] elif platform.system() == "Darwin": @@ -285,10 +294,10 @@ class Config(object): args = ["/DLL"] bits = os.getenv("KLAYOUT_BITS") if bits: - args += ["\"/LIBPATH:" + os.path.join(bits, "zlib", "libraries") + "\"", - "\"/LIBPATH:" + os.path.join(bits, "ptw", "libraries") + "\"", - "\"/LIBPATH:" + os.path.join(bits, "expat", "libraries") + "\"", - "\"/LIBPATH:" + os.path.join(bits, "curl", "libraries") + "\""] + args += [quote_path("/LIBPATH:" + os.path.join(bits, "zlib", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "ptw", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "expat", "libraries")), + quote_path("/LIBPATH:" + os.path.join(bits, "curl", "libraries"))] return args elif platform.system() == "Darwin": # For the dependency modules, make sure we produce a dylib.