Unverified Commit 909c12d8 authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge branch 'devel' into devel

parents 86ec17b0 e0049424
......@@ -76,7 +76,16 @@ test_script:
- python -m pyappveyordemo.tests.test_extension
# Smoke test of install_python script
# Use C:\PythonXY, C:\PythonXY-x64, C:\PythonXYrcZ, or C:\PythonXYrcZ-x64
- set PYTHON=C:\Python37
- ps: .\install_python.ps1
- set PYTHON=C:\Python37-x64
- ps: .\install_python.ps1
- set PYTHON=C:\Python38-x64
- ps: .\install_python.ps1
- set PYTHON=C:\Python38rc1-x64
- ps: .\install_python.ps1
- set PYTHON=C:\Python38
- ps: .\install_python.ps1
- set PYTHON=C:\Python38rc1
- ps: .\install_python.ps1
downloads/
*.orig
*.swp
......@@ -6,6 +6,11 @@ cache:
directories:
- $HOME/.ccache
env:
global:
# Always set Python version
- MB_PYTHON_VERSION=3.7
matrix:
include:
- os: linux
......@@ -15,7 +20,7 @@ matrix:
dist: xenial
env:
- TEST_BUILDS=1
# 64-bit builds, manylinux2014
# 64-bit builds, manylinux2010
- os: linux
dist: xenial
env:
......@@ -27,6 +32,12 @@ matrix:
env:
- TEST_BUILDS=1
- PLAT=i686
- os: linux
dist: xenial
env:
- TEST_BUILDS=1
- PLAT=i686
- MB_ML_VER=2010
# Builds with caching
- os: linux
dist: xenial
......@@ -36,173 +47,161 @@ matrix:
# OSX builds
- os: osx
env:
- PYTHON_VERSION=2.7
- MB_PYTHON_VERSION=2.7
- MB_PYTHON_OSX_VER=10.6
- TEST_BUILDS=1
- os: osx
env:
- PYTHON_VERSION=2.7
- MB_PYTHON_OSX_VER=10.9
- MB_PYTHON_VERSION=2.7
- TEST_BUILDS=1
- os: osx
language: objective-c
env:
- PYTHON_VERSION=2.7
- MB_PYTHON_VERSION=2.7
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=3.6
- MB_PYTHON_VERSION=3.6
- MB_PYTHON_OSX_VER=10.6
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=3.6
- MB_PYTHON_VERSION=3.6
- VENV=venv
- MB_PYTHON_OSX_VER=10.9
- os: osx
env:
- PYTHON_VERSION=3.7
- MB_PYTHON_VERSION=3.7
- MB_PYTHON_OSX_VER=10.6
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=3.7
- MB_PYTHON_VERSION=3.7
- VENV=venv
- MB_PYTHON_OSX_VER=10.9
- os: osx
env:
- PYTHON_VERSION=3.7
- MB_PYTHON_VERSION=3.7
- VENV=venv
- USE_CCACHE=1
- os: osx
env:
- PYTHON_VERSION=3.8
- VENV=venv
- MB_PYTHON_OSX_VER=10.9
- MB_ML_VER=2010
- os: osx
env:
- PYTHON_VERSION=pypy-4.0
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.0
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.1
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.3
- MB_PYTHON_VERSION=3.8
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.4
- MB_PYTHON_VERSION=pypy-6.0
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.6
- MB_PYTHON_VERSION=pypy-7.0
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.7
- MB_PYTHON_VERSION=pypy-7.1
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.8
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-5.9
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-6.0
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-7.0
- VENV=venv
- os: osx
env:
- PYTHON_VERSION=pypy-7.1
- MB_PYTHON_VERSION=pypy-7.2
- VENV=venv
# Default OSX (xcode image) is 10.13 (xcode 9.4.1) as of 2018-08-03
# See: https://docs.travis-ci.com/user/reference/osx/
- os: osx
osx_image: xcode10.1
env:
- PYTHON_VERSION=3.7
- MB_PYTHON_VERSION=3.7
- TEST_BUILDS=1
- os: osx
osx_image: xcode10.1
env:
- PYTHON_VERSION=3.7
- MB_PYTHON_VERSION=3.7
- MB_PYTHON_OSX_VER=10.9
- TEST_BUILDS=1
- os: osx
osx_image: xcode10
env:
- PYTHON_VERSION=3.7
- MB_PYTHON_VERSION=3.7
- os: osx
osx_image: xcode10
env:
- PYTHON_VERSION=3.8
- MB_PYTHON_OSX_VER=10.9
- MB_ML_VER=2010
- MB_PYTHON_VERSION=3.8
- os: osx
osx_image: xcode10.1
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode10
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode9.4
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode9.3
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode9.2
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode9.1
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode9
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode8.3
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode8.2
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode8.1
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode8
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
- os: osx
osx_image: xcode7.3
env:
- PYTHON_VERSION=3.5
- MB_PYTHON_VERSION=3.5
# ARM aarch 64 builds
- os: linux
arch: arm64
env:
- MB_PYTHON_VERSION=3.7
- MB_ML_VER=2014
- TEST_BUILDS=1
- PLAT=aarch64
# s390x builds
- os: linux
arch: s390x
env:
- MB_PYTHON_VERSION=3.7
- MB_ML_VER=2014
- TEST_BUILDS=1
- PLAT=s390x
# ppc64le builds
- os: linux
arch: ppc64le
env:
- MB_PYTHON_VERSION=3.7
- MB_ML_VER=2014
- TEST_BUILDS=1
- PLAT=ppc64le
script:
- export ENV_VARS_PATH="tests/env_vars.sh"
......
......@@ -8,21 +8,21 @@ wheels on the `AppVeyor <https://ci.appveyor.com/>`_ infrastructure.
The Travis CI scripts are designed to build *and test*:
* Dual 32/64-bit architecture macOS wheels built for macOS 10.6+;
* 64-bit macOS wheels built for macOS 10.9+;
* 64-bit ``manylinuxX_x86_64`` wheels, both narrow and wide Unicode builds, where `X` is any valid Manylinux version, such as `1`, or `2010`.
* 32-bit ``manylinuxX_i686`` wheels, both narrow and wide Unicode builds.
* 64-bit macOS wheels built for macOS 10.9+
* 64/32-bit macOS wheels built for macOS 10.6+
* 64-bit ``manylinuxX_x86_64`` wheels, both narrow and wide Unicode builds, where `X` is any valid Manylinux version, such as `1`, or `2010`
* 32-bit ``manylinuxX_i686`` wheels, both narrow and wide Unicode builds
You can currently build and test against Pythons 2.7, 3.5, 3.6, 3.7.
You can currently build and test against Pythons 2.7, 3.5, 3.6, 3.7 and 3.8
The small innovation here is that you can test against 32-bit builds, and both
The small innovation here is that you can test against Linux 32-bit builds, both
wide and narrow Unicode Python 2 builds, which was not easy on the default
Travis CI configurations.
The AppVeyor setup is designed to build *and test*:
* 64-bit Windows ``win_amd64`` wheels;
* 32-bit Windows ``win32`` wheels.
* 64-bit Windows ``win_amd64`` wheels
* 32-bit Windows ``win32`` wheels
You can currently build and test against Pythons 2.7, 3.5, 3.6, 3.7.
......@@ -36,41 +36,43 @@ test wheels.
Configuration is by overriding the default build function, and defining a test
function.
The bash scripts are layered, in the sense that they loaded in the following
sequence:
The bash scripts are layered, in the sense that they are composed of a number of scripts
which are sourced in sequence, each one potentially overriding previous ones.
macOS
=====
See ``multibuild/travis_osx_steps.sh``.
For build and test phases, these bash scripts get sourced one after the other,
so that functions and variables defined in later scripts can overwrite
functions and variables in earlier scripts:
The following bash scripts are sourced in this order::
* multibuild/common_utils.sh
* multibuild/osx_utils.sh
* env_vars.sh
* multibuild/configure_build.sh
* multibuild/library_builders.sh
* config.sh
multibuild/common_utils.sh
multibuild/osx_utils.sh
env_vars.sh
multibuild/configure_build.sh
multibuild/library_builders.sh
config.sh
See ``travis_osx_steps.sh`` to review source order.
See ``multibuild/travis_osx_steps.sh``
The macOS build / test phases run on the macOS VM started by Travis CI.
Therefore any environment variable defined in the ``.travis.yml`` or bash
Therefore any environment variable defined in ``.travis.yml`` or the bash
shell scripts listed above are available for your build and test.
macOS builds may be targeted either at macOS 10.6+
(dual arch 64 / 32 bit) or macOS 10.9+ (64b only). These depend on the
corresponding build of python from https://www.python.org/downloads/mac-osx/.
At the time of writing, 10.9+ / 64 bit builds are supported for Python
versions 3.6.5 / 2.7.15 and above. If you want to build for an older version
of Python, you'll have to target 10.6+ / dual arch.
Build options are controlled mainly by the following environment
variables:
* ``MB_PYTHON_VER`` sets the Python version targetted: ``major.minor.patch`` for CPython, or ``pypy-major.minor`` for PyPy.
* ``MB_PYTHON_OSX_VER`` sets the minimum macOS SDK version for any C extensions. For CPython targets it may be set to 10.6 or 10.9, provided a corresponding Python build is available at `python.org <https://www.python.org/downloads/mac-osx/>`_. It defaults to the highest version available. It's ignored for PyPy targets.
* ``PLAT`` sets the architectures built for any C extensions: ``x86_64`` or ``intel`` for 64-bit or 64/32-bit respectively. It defaults to the same arches as the target Python version: 64-bit for CPython macOS 10.9 or PyPy, and 64/32-bit for CPython 10.6.
The ``build_wheel`` function builds the wheel, and the ``install_run``
function installs the wheel and tests it. Look in ``common_utils.sh`` for
default definitions of these functions. See below for more details.
In most cases it's best to rely on the defaults for ``MB_PYTHON_OSX_VER`` and ``PLAT``, rather than setting them explicitly. Examples of exceptions to this guideline include:
* setting ``MB_PYTHON_OSX_VER=10.6`` to build a 10.6 64/32-bit CPython wheel for Python 2.7 (default for 2.7 is 10.9 64-bit)
* setting ``MB_PYTHON_OSX_VER=10.6 and PLAT=x86_64`` to build a 10.6 64-bit only wheel (10.6 would normally be 64/32-bit). Such a wheel would still have a platform tag of ``macosx_10_6_intel`` , advertising support for both 64 and 32-bit, but wouldnt work in 32-bit mode. This may be OK given how unlikely it is that there is still anyone actually running Python on macOS in 32-bit mode.
The ``build_wheel`` function builds the wheel, and ``install_run``
function installs and tests it. Look in ``multibuild/common_utils.sh`` for
default definitions of these functions. See below for more details, many of which are common
to macOS and Linux.
Manylinux
=========
......@@ -82,35 +84,33 @@ a clean Ubuntu 14.04 container.
Build phase
-----------
Specify the Manylinux version to build for with the `MB_ML_VER` environment variable. The default version is `1`. Versions that are currently valid are:
Specify the Manylinux version to build for with the ``MB_ML_VER`` environment
variable. The default version is ``1``. Versions that are currently valid are:
* `1` (see [PEP 513](https://www.python.org/dev/peps/pep-0513);
* `2010` (see [PEP
* ``1`` corresponding to manylinux1 (see [PEP 513](https://www.python.org/dev/peps/pep-0513);
* ``2010`` corresponding to manylinux2010 (see [PEP
571](https://www.python.org/dev/peps/pep-0571).
At some point `2014` will be a valid version - see [PEP
599](https://www.python.org/dev/peps/pep-0599).
* ``2014`` corresponding to manylinux2014 and adds more architectures to ``PLAT``
(see [PEP 599](https://www.python.org/dev/peps/pep-0599).
The environment variable specified which Manylinux docker container you are building in.
The `PLAT` environment variable can be one of `x86_64` or `i686`, specifying 64-bit and 32-bit builds, respectively. The default is 64-bit.
At the time of writing, Manylinux2010 only supports 64-bit
builds, so `MB_ML_VER=2010` and `PLAT=i686` is an invalid
combination, and will generate an error when trying to find the
matching Docker image.
The ``PLAT`` environment variable can be one of ``x86_64``, ``i686`` ``s390x``,
``ppc64le``, or ``aarch64``, specifying 64-bit x86, 32-bit x86, 64-bit s390x,
PowerPC, and ARM builds, respectively. The default is ``x86_64``. Only ``x86_64``
and ``i686`` are valid on manylinux1 and manylinux2010.
``multibuild/travis_linux_steps.sh`` defines the ``build_wheel`` function,
which starts up the Manylinux1 Docker container to run a wrapper script
``multibuild/docker_build_wrap.sh``, that (within the container) sources the
following bash scripts:
following bash scripts::
* multibuild/common_utils.sh
* multibuild/manylinux_utils.sh
* env_vars.sh
* multibuild/configure_build.sh
* multibuild/library_builders.sh
* config.sh
multibuild/common_utils.sh
multibuild/manylinux_utils.sh
env_vars.sh
multibuild/configure_build.sh
multibuild/library_builders.sh
config.sh
See ``docker_build_wrap.sh`` to review the order of script sourcing.
......@@ -129,10 +129,10 @@ Testing is in an Ubuntu 14.04 Docker container - see
``multibuild/docker_test_wrap.sh``. ``multibuild/travis_linux_steps.sh``
defines the ``install_run`` function, which starts up the testing Docker
container with a wrapper script ``multibuild/docker_test_wrap.sh``. The
wrapper script sources the following bash scripts:
wrapper script sources the following bash scripts::
* multibuild/common_utils.sh
* config.sh
multibuild/common_utils.sh
config.sh
See ``docker_test_wrap.sh`` for script source order.
......@@ -151,7 +151,7 @@ default the function that is run on macOS, and in the Manylinux container for
the build phase, is defined in ``multibuild/common_utils.sh``. You can
override the default function in the project ``config.sh`` file (see below).
If you are building a wheel from pypi, rather than from a source repository,
If you are building a wheel from PyPI, rather than from a source repository,
you can use the ``build_index_wheel`` command, again defined in
``multibuild/common_utils.sh``.
......@@ -196,12 +196,11 @@ To use these scripts
# Commit from your-project that you want to build
- BUILD_COMMIT=v0.1.0
# pip dependencies to _build_ your project
- BUILD_DEPENDS="Cython numpy"
- BUILD_DEPENDS="cython numpy"
# pip dependencies to _test_ your project. Include any dependencies
# that you need, that are also specified in BUILD_DEPENDS, this will be
# a separate install.
- TEST_DEPENDS="numpy scipy pytest"
- PLAT=x86_64
- UNICODE_WIDTH=32
- WHEELHOUSE_UPLOADER_USERNAME=travis-worker
# Following generated with
......@@ -223,7 +222,11 @@ To use these scripts
# For CPython macOS builds only, the minimum supported macOS version and
# architectures of any C extensions in the wheel are set with the variable
# MB_PYTHON_OSX_VER: 10.9 (64-bit only) or 10.6 (64/32-bit dual arch).
# MB_PYTHON_OSX_VER: 10.9 (64-bit only) or 10.6 (64/32-bit dual arch). By
# default this is set to the highest available for the Python version selected
# using MB_PYTHON_VERSION. You should only need to set this explicitly if you
# are building a 10.6 dual-arch build for a CPython version where both a 10.9 and
# 10.6 build are available (for example, 2.7 or 3.7).
# All PyPy macOS builds are 64-bit only.
# Required in Linux to invoke `docker` ourselves
......@@ -267,10 +270,10 @@ To use these scripts
- os: osx
env:
- MB_PYTHON_VERSION=2.7
- MB_PYTHON_OSX_VER=10.6
- os: osx
env:
- MB_PYTHON_VERSION=2.7
- MB_PYTHON_OSX_VER=10.9
- os: osx
env:
- MB_PYTHON_VERSION=3.5
......@@ -280,7 +283,13 @@ To use these scripts
- os: osx
env:
- MB_PYTHON_VERSION=3.7
- MB_PYTHON_OSX_VER=10.9
- MB_PYTHON_OSX_VER=10.6
- os: osx
env:
- MB_PYTHON_VERSION=3.7
- os: osx
env:
- MB_PYTHON_VERSION=3.8
- os: osx
language: generic
env:
......
......@@ -102,7 +102,7 @@ alias gh-clone=gh_clone
function set_opts {
# Set options from input options string (in $- format).
local opts=$1
local chars="exhimBH"
local chars="exhmBH"
for (( i=0; i<${#chars}; i++ )); do
char=${chars:$i:1}
[ -n "${opts//[^${char}]/}" ] && set -$char || set +$char
......@@ -310,6 +310,9 @@ function get_platform {
python -c 'import platform; print(platform.uname()[4])'
}
if [ "$(get_platform)" == x86_64 ] || \
[ "$(get_platform)" == i686 ]; then IS_X86=1; fi
function get_distutils_platform {
# Report platform as given by distutils get_platform.
# This is the platform tag that pip will use.
......@@ -364,7 +367,7 @@ function fill_submodule {
PYPY_URL=https://bitbucket.org/pypy/pypy/downloads
# As of 2019-05-15, the latest verions of PyPy.
# As of 2019-10-15, the latest verions of PyPy.
LATEST_PP_4p0=4.0.1
LATEST_PP_4=$LATEST_PP_4p0
......@@ -383,7 +386,8 @@ LATEST_PP_6=$LATEST_PP_6p0
LATEST_PP_7p0=7.0.0
LATEST_PP_7p1=7.1.1
LATEST_PP_7=$LATEST_PP_7p1
LATEST_PP_7p2=7.2.0
LATEST_PP_7=$LATEST_PP_7p2
function unroll_version {
# Convert major or major.minor format to major.minor.micro using the above
......
......@@ -9,14 +9,13 @@ if [ -n "$CONFIGURE_BUILD_SOURCED" ]; then
fi
CONFIGURE_BUILD_SOURCED=1
PLAT="${PLAT:-x86_64}"
BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}"
# Default compilation flags for OSX
# IS_OSX is defined in common_utils.sh
if [ -n "$IS_OSX" ]; then
# Default compilation flags for OSX
source $MULTIBUILD_DIR/osx_utils.sh
PLAT=$(macpython_arch_for_version $MB_PYTHON_VERSION)
PLAT=${PLAT:-$(macpython_arch_for_version $MB_PYTHON_VERSION)}
if [[ $PLAT == intel ]]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"}
elif [[ $PLAT == x86_64 ]]; then
......@@ -34,12 +33,15 @@ if [ -n "$IS_OSX" ]; then
# Disable homebrew auto-update
export HOMEBREW_NO_AUTO_UPDATE=1
else
# default compilation flags for linux
PLAT="${PLAT:-x86_64}"
# Strip all binaries after compilation.
STRIP_FLAGS=${STRIP_FLAGS:-"-Wl,-strip-all"}
export CFLAGS="${CFLAGS:-$STRIP_FLAGS}"
export CXXFLAGS="${CXXFLAGS:-$STRIP_FLAGS}"
export FFLAGS="${FFLAGS:-$STRIP_FLAGS}"
yum install -y libtool
fi
# Promote BUILD_PREFIX on search path to any newly built libs
......
......@@ -5,23 +5,25 @@
$py_exe = "${env:PYTHON}\Python.exe"
if ( [System.IO.File]::Exists($py_exe) ) {
echo "$py_exe exists"
exit 0
}
$req_nodot = $env:PYTHON -replace '\D+Python(\d+)(?:-x64)?','$1'
$req_nodot = $env:PYTHON -replace '\D+Python(\d+(?:rc\d+)?)(-x64)?','$1'
$req_ver = $req_nodot -replace '(\d)(\d+)','$1.$2.0'
$req_dir = $req_nodot -replace '(\d)(\d+)(.*)','$1.$2.0'
$last_three = $env:PYTHON[-3 .. -1] -join ''
if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") {
if ($last_three -eq "x64") {
$exe_suffix="-amd64"
} elseif ($env:PYTHON -eq "C:\Python${req_nodot}") {
$exe_suffix=""
} else {
exit 0
$exe_suffix=""
}
$py_url = "https://www.python.org/ftp/python"
Write-Host "Installing Python ${req_ver}$exe_suffix..." -ForegroundColor Cyan
Write-Host "Installing Python ${req_dir}/${req_ver}$exe_suffix to $env:Python ..." -ForegroundColor Cyan
$exePath = "$env:TEMP\python-${req_ver}${exe_suffix}.exe"
$downloadFile = "$py_url/${req_ver}/python-${req_ver}${exe_suffix}.exe"
$downloadFile = "$py_url/${req_dir}/python-${req_ver}${exe_suffix}.exe"
Write-Host "Downloading $downloadFile..."
(New-Object Net.WebClient).DownloadFile($downloadFile, $exePath)
Write-Host "Installing..."
......
......@@ -15,24 +15,24 @@ ZLIB_VERSION="${ZLIB_VERSION:-1.2.10}"
LIBPNG_VERSION="${LIBPNG_VERSION:-1.6.21}"
BZIP2_VERSION="${BZIP2_VERSION:-1.0.6}"
FREETYPE_VERSION="${FREETYPE_VERSION:-2.6.3}"
TIFF_VERSION="${TIFF_VERSION:-4.0.6}"
TIFF_VERSION="${TIFF_VERSION:-4.1.0}"
JPEG_VERSION="${JPEG_VERSION:-9b}"
OPENJPEG_VERSION="${OPENJPEG_VERSION:-2.1}"
LCMS2_VERSION="${LCMS2_VERSION:-2.7}"
LCMS2_VERSION="${LCMS2_VERSION:-2.9}"
GIFLIB_VERSION="${GIFLIB_VERSION:-5.1.3}"
LIBWEBP_VERSION="${LIBWEBP_VERSION:-0.5.0}"
XZ_VERSION="${XZ_VERSION:-5.2.2}"
LIBYAML_VERSION="${LIBYAML_VERSION:-0.1.5}"
LIBYAML_VERSION="${LIBYAML_VERSION:-0.2.2}"
SZIP_VERSION="${SZIP_VERSION:-2.1.1}"
HDF5_VERSION="${HDF5_VERSION:-1.10.5}"
LIBAEC_VERSION="${LIBAEC_VERSION:-0.3.3}"
LIBAEC_VERSION="${LIBAEC_VERSION:-1.0.4}"
LZO_VERSION=${LZO_VERSION:-2.10}
LZF_VERSION="${LZF_VERSION:-3.6}"
BLOSC_VERSION=${BLOSC_VERSION:-1.10.2}
SNAPPY_VERSION="${SNAPPY_VERSION:-1.1.3}"
CURL_VERSION=${CURL_VERSION:-7.49.1}
NETCDF_VERSION=${NETCDF_VERSION:-4.4.1.1}
SWIG_VERSION=${SWIG_VERSION:-3.0.12}
SWIG_VERSION=${SWIG_VERSION:-4.0.1}
PCRE_VERSION=${PCRE_VERSION:-8.38}
SUITESPARSE_VERSION=${SUITESPARSE_VERSION:-4.5.6}
LIBTOOL_VERSION=${LIBTOOL_VERSION:-2.4.6}
......@@ -40,7 +40,7 @@ RAGEL_VERSION=${RAGEL_VERSION:-6.10}
FLEX_VERSION=${FLEX_VERSION:-2.6.4}
BISON_VERSION=${BISON_VERSION:-3.0.4}
FFTW_VERSION=${FFTW_VERSION:-3.3.7}
CFITSIO_VERSION=${CFITSIO_VERSION:-3370}
CFITSIO_VERSION=${CFITSIO_VERSION:-3450}
OPENSSL_ROOT=openssl-1.0.2t
# Hash from https://www.openssl.org/source/openssl-1.0.2?.tar.gz.sha256
OPENSSL_HASH=14cb464efe7ac6b54799b34456bd69558a749a4931ecfd9cf9f71d7881cac7bc
......@@ -94,6 +94,9 @@ function build_openblas {
if [ -n "$IS_OSX" ]; then
brew install openblas
brew link --force openblas
elif [ ! -v IS_X86 ]; then
# Skip this for now until we can build a suitable tar.gz
return;
else
mkdir -p $ARCHIVE_SDIR
local plat=${1:-${PLAT:-x86_64}}
......@@ -135,7 +138,7 @@ function build_libpng {
function build_bzip2 {
if [ -n "$IS_OSX" ]; then return; fi # OSX has bzip2 libs already
if [ -e bzip2-stamp ]; then return; fi
fetch_unpack https://download.sourceforge.net/bzip2/bzip2-${BZIP2_VERSION}.tar.gz
fetch_unpack https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz
(cd bzip2-${BZIP2_VERSION} \
&& make -f Makefile-libbz2_so \
&& make install PREFIX=$BUILD_PREFIX)
......@@ -228,6 +231,7 @@ function build_hdf5 {
fetch_unpack $hdf5_url/hdf5-$short/hdf5-$HDF5_VERSION/src/hdf5-$HDF5_VERSION.tar.gz
(cd hdf5-$HDF5_VERSION \
&& ./configure --with-szlib=$BUILD_PREFIX --prefix=$BUILD_PREFIX \
--enable-threadsafe --enable-unsupported --with-pthread=yes \
&& make -j4 \
&& make install)
touch hdf5-stamp
......@@ -235,10 +239,10 @@ function build_hdf5 {
function build_libaec {
if [ -e libaec-stamp ]; then return; fi
local root_name=libaec-0.3.3
local root_name=libaec-1.0.4
local tar_name=${root_name}.tar.gz
# Note URL will change for each version
fetch_unpack https://gitlab.dkrz.de/k202009/libaec/uploads/48398bd5b7bc05a3edb3325abfeac864/${tar_name}
fetch_unpack https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/${tar_name}
(cd $root_name \
&& ./configure --prefix=$BUILD_PREFIX \
&& make \
......
......@@ -8,20 +8,18 @@ source $MULTIBUILD_DIR/common_utils.sh
MACPYTHON_URL=https://www.python.org/ftp/python
MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
MACPYTHON_DEFAULT_OSX="10.6"
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$MACPYTHON_DEFAULT_OSX}
GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
DOWNLOADS_SDIR=downloads
WORKING_SDIR=working
# As of 26 July 2019 - latest Python of each version with binary download
# As of 20 Oct 2019 - latest Python of each version with binary download
# available.
# See: https://www.python.org/downloads/mac-osx/
LATEST_2p7=2.7.16
LATEST_2p7=2.7.17
LATEST_3p5=3.5.4
LATEST_3p6=3.6.8
LATEST_3p7=3.7.4
LATEST_3p8=3.8.0rc1
LATEST_3p7=3.7.5
LATEST_3p8=3.8.0
function check_python {
......@@ -78,20 +76,50 @@ function fill_pyver {
echo $ver
elif [ $ver == 2 ] || [ $ver == "2.7" ]; then
echo $LATEST_2p7
elif [ $ver == 3 ] || [ $ver == "3.7" ]; then
elif [ $ver == 3 ] || [ $ver == "3.8" ]; then
echo $LATEST_3p8
elif [ $ver == "3.7" ]; then
echo $LATEST_3p7
elif [ $ver == "3.6" ]; then
echo $LATEST_3p6
elif [ $ver == "3.5" ]; then
echo $LATEST_3p5
elif [ $ver == "3.8" ]; then
echo $LATEST_3p8
else
echo "Can't fill version $ver" 1>&2
exit 1
fi
}
function macpython_sdk_list_for_version {
# return a list of SDK targets supported for a given CPython version
# Parameters
# $py_version (python version in major.minor.extra format)
# eg
# macpython_sdks_for_version 2.7.15
# >> 10.6 10.9
local _ver=$(fill_pyver $1)
local _major=${_ver%%.*}
local _return
if [ "$_major" -eq "2" ]; then
_return="10.6"
[ $(lex_ver $_ver) -ge $(lex_ver 2.7.15) ] && _return="$_return 10.9"
elif [ "$_major" -eq "3" ]; then
[ $(lex_ver $_ver) -lt $(lex_ver 3.8) ] && _return="10.6"
[ $(lex_ver $_ver) -ge $(lex_ver 3.6.5) ] && _return="$_return 10.9"
else
echo "Error version=${_ver}, expecting 2.x or 3.x" 1>&2
exit 1
fi
echo $_return
}
function macpython_sdk_for_version {
# assumes the output of macpython_sdk_list_for_version is a list
# of SDK versions XX.Y in sorted order, eg "10.6 10.9" or "10.9"
echo $(macpython_sdk_list_for_version $1) | awk -F' ' '{print $NF}'
}
function pyinst_ext_for_version {
# echo "pkg" or "dmg" depending on the passed Python version
# Parameters
......@@ -119,13 +147,11 @@ function pyinst_fname_for_version {
# Parameters
# $py_version (Python version in major.minor.extra format)
# $py_osx_ver: {major.minor | not defined}
# if defined, the macOS version that Python is built for, e.g.
# "10.6" or "10.9", if not defined, uses the default
# MACPYTHON_DEFAULT_OSX
# Note: this is the version the Python is built for, and hence
# the min version supported, NOT the version of the current system
# if defined, the minimum macOS SDK version that Python is
# built for, eg: "10.6" or "10.9", if not defined, infers
# this from $py_version using macpython_sdk_for_version
local py_version=$1
local py_osx_ver=${2:-$MACPYTHON_DEFAULT_OSX}
local py_osx_ver=${2:-$(macpython_sdk_for_version $py_version)}
local inst_ext=$(pyinst_ext_for_version $py_version)
echo "python-${py_version}-macosx${py_osx_ver}.${inst_ext}"
}
......
......@@ -86,8 +86,14 @@ actual="$(set -e; suppress bad_mid_cmd)"
# Reset options
set_opts $ORIG_OPTS
# On Linux docker containers in travis, can only be x86_64 or i686
[ "$(get_platform)" == x86_64 ] || [ "$(get_platform)" == i686 ] || exit 1
# On Linux docker containers in travis, can be x86_64, i686, s390x, ppc64le, or
# aarch64
[ "$(get_platform)" == x86_64 ] || \
[ "$(get_platform)" == i686 ] || \
[ "$(get_platform)" == aarch64 ] || \
[ "$(get_platform)" == ppc64le ] || \
[ "$(get_platform)" == s390x ] || \
exit 1
# Crudest possible check for get_distutils_platform
expected=$(python -c "import distutils.util as du; print(du.get_platform())")
......
......@@ -15,5 +15,6 @@
[ "$(fill_pypy_ver 6.0)" == $LATEST_PP_6p0 ] || ingest
[ "$(fill_pypy_ver 7.0)" == $LATEST_PP_7p0 ] || ingest
[ "$(fill_pypy_ver 7.1)" == $LATEST_PP_7p1 ] || ingest
[ "$(fill_pypy_ver 7.2)" == $LATEST_PP_7p2 ] || ingest
[ "$(fill_pypy_ver 4.0.1)" == "4.0.1" ] || ingest
[ "$(fill_pypy_ver 5.0.1)" == "5.0.1" ] || ingest
......@@ -2,9 +2,11 @@
[ "$(fill_pyver 2)" == $LATEST_2p7 ] || ingest
[ "$(fill_pyver 2.7)" == $LATEST_2p7 ] || ingest
[ "$(fill_pyver 2.7.8)" == "2.7.8" ] || ingest
[ "$(fill_pyver 3)" == $LATEST_3p7 ] || ingest
[ "$(fill_pyver 3.7.0)" == "3.7.0" ] || ingest
[ "$(fill_pyver 3)" == $LATEST_3p8 ] || ingest
[ "$(fill_pyver 3.8)" == $LATEST_3p8 ] || ingest
[ "$(fill_pyver 3.8.0)" == "3.8.0" ] || ingest
[ "$(fill_pyver 3.7)" == $LATEST_3p7 ] || ingest
[ "$(fill_pyver 3.7.0)" == "3.7.0" ] || ingest
[ "$(fill_pyver 3.6)" == $LATEST_3p6 ] || ingest
[ "$(fill_pyver 3.6.0)" == "3.6.0" ] || ingest
[ "$(fill_pyver 3.5)" == $LATEST_3p5 ] || ingest
......
......@@ -32,7 +32,7 @@ suppress build_swig
# E.g. arb (below) requires a couple of other libraries.
# Run here just for the output, even though they fail.
(set +e ;
build_github fredrik-johansson/arb 2.16.0 ;
build_github fredrik-johansson/arb 2.17.0 ;
build_github glennrp/libpng v1.6.37 ;
build_github wbhart/mpir mpir-3.0.0
)
......@@ -52,6 +52,7 @@ fi
suppress build_ragel
suppress build_cfitsio
suppress build_new_zlib
suppress build_hdf5
[ ${MB_PYTHON_VERSION+x} ] || ingest "\$MB_PYTHON_VERSION is not set"
[ "$MB_PYTHON_VERSION" == "$PYTHON_VERSION" ] || ingest "\$MB_PYTHON_VERSION must be equal to \$PYTHON_VERSION"
......
......@@ -9,4 +9,7 @@
[ "$(cpython_path 3.5 16)" == "/opt/python/cp35-cp35m" ] || ingest "cp 3.5 16"
[ "$(cpython_path 3.7)" == "/opt/python/cp37-cp37m" ] || ingest "cp 3.7"
[ "$(cpython_path 3.7 32)" == "/opt/python/cp37-cp37m" ] || ingest "cp 3.7 32"
[ "$(cpython_path 3.7 16)" == "/opt/python/cp37-cp37m" ] || ingest "cp 3.7 16"
\ No newline at end of file
[ "$(cpython_path 3.7 16)" == "/opt/python/cp37-cp37m" ] || ingest "cp 3.7 16"
[ "$(cpython_path 3.8)" == "/opt/python/cp38-cp38" ] || ingest "cp 3.8"
[ "$(cpython_path 3.8 32)" == "/opt/python/cp38-cp38" ] || ingest "cp 3.8 32"
[ "$(cpython_path 3.8 16)" == "/opt/python/cp38-cp38" ] || ingest "cp 3.8 16"
\ No newline at end of file
......@@ -6,9 +6,16 @@ source tests/utils.sh
source tests/test_common_utils.sh
source tests/test_fill_submodule.sh
if [ -n "$IS_OSX" ]; then
source osx_utils.sh
get_macpython_environment $PYTHON_VERSION ${VENV:-""} $MB_PYTHON_OSX_VER
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$(macpython_sdk_for_version $MB_PYTHON_VERSION)}
# To work round:
# https://travis-ci.community/t/syntax-error-unexpected-keyword-rescue-expecting-keyword-end-in-homebrew/5623
brew update
get_macpython_environment $MB_PYTHON_VERSION ${VENV:-""} $MB_PYTHON_OSX_VER
source tests/test_python_install.sh
source tests/test_fill_pyver.sh
source tests/test_fill_pypy_ver.sh
......@@ -19,7 +26,9 @@ else
fi
if [ -n "$TEST_BUILDS" ]; then
if [ -n "$IS_OSX" ]; then
MB_PYTHON_VERSION=${MB_PYTHON_VERSION:-$PYTHON_VERSION}
# This checked in test_library_builders.
# Will be set automatically by docker call in build_multilinux below.
PYTHON_VERSION=${MB_PYTHON_VERSION}
source tests/test_library_builders.sh
elif [ ! -x "$(command -v docker)" ]; then
echo "Skipping build tests; no docker available"
......
......@@ -10,12 +10,18 @@
[ "$(pyinst_ext_for_version 3)" == pkg ] || ingest
[ "$(pyinst_fname_for_version 2.7.14)" == "python-2.7.14-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 2.7.15)" == "python-2.7.15-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.6.8)" == "python-3.6.8-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.7.1)" == "python-3.7.1-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 2.7.15)" == "python-2.7.15-macosx10.9.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.6.8)" == "python-3.6.8-macosx10.9.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.7.1)" == "python-3.7.1-macosx10.9.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.8.0)" == "python-3.8.0-macosx10.9.pkg" ] || ingest
[ "$(pyinst_fname_for_version 2.7.15 10.9)" == "python-2.7.15-macosx10.9.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.7.1 10.9)" == "python-3.7.1-macosx10.9.pkg" ] || ingest
[ "$(pyinst_fname_for_version 2.7.14 10.6)" == "python-2.7.14-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 2.7.15 10.6)" == "python-2.7.15-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.6.8 10.6)" == "python-3.6.8-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.7.1 10.6)" == "python-3.7.1-macosx10.6.pkg" ] || ingest
[ "$(pyinst_fname_for_version 2.7.15 10.11)" == "python-2.7.15-macosx10.11.pkg" ] || ingest
[ "$(pyinst_fname_for_version 3.7.1 10.12)" == "python-3.7.1-macosx10.12.pkg" ] || ingest
# Test utilities for getting Python version versions
[ "$(get_py_digit)" == "${cpython_version:0:1}" ] || ingest
......@@ -38,5 +44,21 @@
[ "$(macpython_impl_for_version 3.7.2)" == "cp" ] || ingest
[ "$(macpython_impl_for_version pypy-5.4)" == "pp" ] || ingest
# Test lookup of available macOS SDK build targets from python version
[ "$(macpython_sdk_list_for_version 3.8)" == "10.9" ] || ingest
[ "$(macpython_sdk_list_for_version 3.7.5)" == "10.6 10.9" ] || ingest
[ "$(macpython_sdk_list_for_version 3.7)" == "10.6 10.9" ] || ingest
[ "$(macpython_sdk_list_for_version 3.6.5)" == "10.6 10.9" ] || ingest
[ "$(macpython_sdk_list_for_version 3.6)" == "10.6 10.9" ] || ingest
[ "$(macpython_sdk_list_for_version 3.5)" == "10.6" ] || ingest
[ "$(macpython_sdk_list_for_version 2.7)" == "10.6 10.9" ] || ingest
[ "$(macpython_sdk_list_for_version 2.7.14)" == "10.6" ] || ingest
[ "$(macpython_sdk_list_for_version 2.7.15)" == "10.6 10.9" ] || ingest
[ "$(macpython_sdk_for_version 3.8)" == "10.9" ] || ingest
[ "$(macpython_sdk_for_version 3.5)" == "10.6" ] || ingest
[ "$(macpython_sdk_for_version 2.7)" == "10.9" ] || ingest
[ "$(macpython_sdk_for_version 2.7.14)" == "10.6" ] || ingest
# Test pkg-config install
install_pkg_config
......@@ -23,12 +23,12 @@ fi
python_mm="${cpython_version:0:1}.${cpython_version:2:1}"
# extract implementation prefix and version
if [[ "$PYTHON_VERSION" =~ (pypy-)?([0-9\.]+) ]]; then
if [[ "$MB_PYTHON_VERSION" =~ (pypy-)?([0-9\.]+) ]]; then
_impl=${BASH_REMATCH[1]:-"cp"}
requested_impl=${_impl:0:2}
requested_version=${BASH_REMATCH[2]}
else
ingest "Error parsing PYTHON_VERSION=$PYTHON_VERSION"
ingest "Error parsing MB_PYTHON_VERSION=$MB_PYTHON_VERSION"
fi
# simple regex match, a 2.7 pattern will match 2.7.11, but not 2
......@@ -63,10 +63,10 @@ fi
# check macOS version and arch are as expected
distutils_plat=$($PYTHON_EXE -c "import distutils.util; print(distutils.util.get_platform())")
expected_arch=$(macpython_arch_for_version $PYTHON_VERSION)
expected_arch=$(macpython_arch_for_version $MB_PYTHON_VERSION)
if [[ $requested_impl == 'cp' ]]; then
expected_tag="macosx-$MB_PYTHON_OSX_VER-$expected_arch"
else
expected_tag="macosx-10.[0-9]+-$expected_arch"
fi
[[ $distutils_plat =~ $expected_tag ]] || ingest
\ No newline at end of file
[[ $distutils_plat =~ $expected_tag ]] || ingest
......@@ -6,7 +6,7 @@ else
pip_install="$PIP_CMD install"
fi
# Current wheel versions not available for older Pythons
lpv=$(lex_ver $PYTHON_VERSION)
lpv=$(lex_ver $MB_PYTHON_VERSION)
if [ $lpv -ge $(lex_ver 3.5) ] || [ $lpv -lt $(lex_ver 3) ]; then
for whl in wheel==0.31.1 wheel==0.32.0 wheel; do
$pip_install -U $whl
......
......@@ -10,6 +10,8 @@ ENV_VARS_PATH=${ENV_VARS_PATH:-env_vars.sh}
# These load common_utils.sh
source $MULTIBUILD_DIR/osx_utils.sh
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$(macpython_sdk_for_version $MB_PYTHON_VERSION)}
if [ -r "$ENV_VARS_PATH" ]; then source "$ENV_VARS_PATH"; fi
source $MULTIBUILD_DIR/configure_build.sh
source $MULTIBUILD_DIR/library_builders.sh
......@@ -20,6 +22,11 @@ source $MULTIBUILD_DIR/library_builders.sh
function before_install {
export CC=clang
export CXX=clang++
# To work round:
# https://travis-ci.community/t/syntax-error-unexpected-keyword-rescue-expecting-keyword-end-in-homebrew/5623
brew update
get_macpython_environment $MB_PYTHON_VERSION venv
source venv/bin/activate
pip install --upgrade pip wheel
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment