mirror of https://github.com/KLayout/klayout.git
Various updates for Python 3.9 and more MacOS support, inherited from 0.26.
This commit is contained in:
parent
3dff2c638e
commit
07d2eeaa3b
119
.travis.yml
119
.travis.yml
|
|
@ -283,7 +283,118 @@ matrix:
|
||||||
|
|
||||||
# python 3 osx
|
# 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"
|
- name: "cp37-cp37m-macosx_10_13_x86_64.whl"
|
||||||
os: osx
|
os: osx
|
||||||
osx_image: xcode9.4 # macOS 10.13
|
osx_image: xcode9.4 # macOS 10.13
|
||||||
|
|
@ -302,7 +413,7 @@ matrix:
|
||||||
- PIP_UPDATE="1"
|
- PIP_UPDATE="1"
|
||||||
- PYTHON_BUILD=true
|
- 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"
|
- name: "cp36-cp36m-macosx_10_13_x86_64.whl"
|
||||||
os: osx
|
os: osx
|
||||||
osx_image: xcode9.4 # macOS 10.13
|
osx_image: xcode9.4 # macOS 10.13
|
||||||
|
|
@ -320,7 +431,7 @@ matrix:
|
||||||
- PIP_UPDATE="1"
|
- PIP_UPDATE="1"
|
||||||
- PYTHON_BUILD=true
|
- 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"
|
- name: "cp35-cp35m-macosx_10_13_x86_64.whl"
|
||||||
os: osx
|
os: osx
|
||||||
osx_image: xcode9.4 # macOS 10.13
|
osx_image: xcode9.4 # macOS 10.13
|
||||||
|
|
@ -375,6 +486,8 @@ matrix:
|
||||||
- PIP_UPDATE="1"
|
- PIP_UPDATE="1"
|
||||||
- PYTHON_BUILD=true
|
- PYTHON_BUILD=true
|
||||||
|
|
||||||
|
# KLayout builds not enabled for now
|
||||||
|
exclude:
|
||||||
# KLayout builds for mac
|
# KLayout builds for mac
|
||||||
# Python 3
|
# Python 3
|
||||||
- name: "KLayout macOS 10.13 with py3.7"
|
- name: "KLayout macOS 10.13 with py3.7"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ jobs:
|
||||||
cp38-cp38-win_amd64.whl:
|
cp38-cp38-win_amd64.whl:
|
||||||
python.version: '3.8'
|
python.version: '3.8'
|
||||||
python.architecture: 'x64'
|
python.architecture: 'x64'
|
||||||
|
cp39-cp39-win_amd64.whl:
|
||||||
|
python.version: '3.9'
|
||||||
|
python.architecture: 'x64'
|
||||||
cp35-cp35m-win32.whl:
|
cp35-cp35m-win32.whl:
|
||||||
python.version: '3.5'
|
python.version: '3.5'
|
||||||
python.architecture: 'x86'
|
python.architecture: 'x86'
|
||||||
|
|
@ -40,6 +43,9 @@ jobs:
|
||||||
cp38-cp38-win32.whl:
|
cp38-cp38-win32.whl:
|
||||||
python.version: '3.8'
|
python.version: '3.8'
|
||||||
python.architecture: 'x86'
|
python.architecture: 'x86'
|
||||||
|
cp39-cp39-win32.whl:
|
||||||
|
python.version: '3.9'
|
||||||
|
python.architecture: 'x86'
|
||||||
maxParallel: 6
|
maxParallel: 6
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -123,6 +129,11 @@ jobs:
|
||||||
vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04'
|
vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04'
|
||||||
steps:
|
steps:
|
||||||
- checkout: none #skip checking out the default repository resource
|
- 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
|
- task: DownloadBuildArtifacts@0
|
||||||
displayName: 'Download Build Artifacts wheel-3.8.x64'
|
displayName: 'Download Build Artifacts wheel-3.8.x64'
|
||||||
inputs:
|
inputs:
|
||||||
|
|
@ -143,6 +154,11 @@ jobs:
|
||||||
inputs:
|
inputs:
|
||||||
artifactName: 'wheel-3.5.x64'
|
artifactName: 'wheel-3.5.x64'
|
||||||
downloadPath: '$(System.DefaultWorkingDirectory)'
|
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
|
- task: DownloadBuildArtifacts@0
|
||||||
displayName: 'Download Build Artifacts wheel-3.8.x86'
|
displayName: 'Download Build Artifacts wheel-3.8.x86'
|
||||||
inputs:
|
inputs:
|
||||||
|
|
|
||||||
29
setup.py
29
setup.py
|
|
@ -59,6 +59,7 @@ from setuptools.extension import Extension, Library
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import platform
|
import platform
|
||||||
from distutils.errors import CompileError
|
from distutils.errors import CompileError
|
||||||
import distutils.command.build_ext
|
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
|
# only if python version > 2.6, somehow the travis compiler hangs in 2.6
|
||||||
import sys
|
if sys.version_info[0] * 100 + sys.version_info[1] > 206:
|
||||||
if sys.version_info[0] * 10 + sys.version_info[1] > 26:
|
|
||||||
import distutils.ccompiler
|
import distutils.ccompiler
|
||||||
distutils.ccompiler.CCompiler.compile = parallelCCompile
|
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)
|
# TODO: delete (Obsolete)
|
||||||
# patch get_ext_filename
|
# patch get_ext_filename
|
||||||
from distutils.command.build_ext import build_ext
|
from distutils.command.build_ext import build_ext
|
||||||
|
|
@ -252,10 +261,10 @@ class Config(object):
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
bits = os.getenv("KLAYOUT_BITS")
|
bits = os.getenv("KLAYOUT_BITS")
|
||||||
if bits:
|
if bits:
|
||||||
return ["\"-I" + os.path.join(bits, "zlib", "include") + "\"",
|
return [quote_path("-I" + os.path.join(bits, "zlib", "include")),
|
||||||
"\"-I" + os.path.join(bits, "ptw", "include") + "\"",
|
quote_path("-I" + os.path.join(bits, "ptw", "include")),
|
||||||
"\"-I" + os.path.join(bits, "expat", "include") + "\"",
|
quote_path("-I" + os.path.join(bits, "expat", "include")),
|
||||||
"\"-I" + os.path.join(bits, "curl", "include") + "\""]
|
quote_path("-I" + os.path.join(bits, "curl", "include"))]
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
elif platform.system() == "Darwin":
|
elif platform.system() == "Darwin":
|
||||||
|
|
@ -285,10 +294,10 @@ class Config(object):
|
||||||
args = ["/DLL"]
|
args = ["/DLL"]
|
||||||
bits = os.getenv("KLAYOUT_BITS")
|
bits = os.getenv("KLAYOUT_BITS")
|
||||||
if bits:
|
if bits:
|
||||||
args += ["\"/LIBPATH:" + os.path.join(bits, "zlib", "libraries") + "\"",
|
args += [quote_path("/LIBPATH:" + os.path.join(bits, "zlib", "libraries")),
|
||||||
"\"/LIBPATH:" + os.path.join(bits, "ptw", "libraries") + "\"",
|
quote_path("/LIBPATH:" + os.path.join(bits, "ptw", "libraries")),
|
||||||
"\"/LIBPATH:" + os.path.join(bits, "expat", "libraries") + "\"",
|
quote_path("/LIBPATH:" + os.path.join(bits, "expat", "libraries")),
|
||||||
"\"/LIBPATH:" + os.path.join(bits, "curl", "libraries") + "\""]
|
quote_path("/LIBPATH:" + os.path.join(bits, "curl", "libraries"))]
|
||||||
return args
|
return args
|
||||||
elif platform.system() == "Darwin":
|
elif platform.system() == "Darwin":
|
||||||
# For the dependency modules, make sure we produce a dylib.
|
# For the dependency modules, make sure we produce a dylib.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue