Skip to content

Commit 0bc8ea2

Browse files
committed
Merge branch 'release'
2 parents 29b8c44 + 541181d commit 0bc8ea2

9 files changed

+70
-68
lines changed

scripts/dockcross-manylinux-build-module-wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# Versions can be restricted by passing them in as arguments to the script
77
# For example,
88
#
9-
# scripts/dockcross-manylinux-build-module-wheels.sh cp35
9+
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
1010

1111
# Generate dockcross scripts
12-
docker run --rm dockcross/manylinux1-x64:20200416-a6b6635 > /tmp/dockcross-manylinux-x64
12+
docker run --rm dockcross/manylinux1-x64:20201015-96d8741 > /tmp/dockcross-manylinux-x64
1313
chmod u+x /tmp/dockcross-manylinux-x64
1414

1515
script_dir=$(cd $(dirname $0) || exit 1; pwd)

scripts/dockcross-manylinux-build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# scripts/dockcross-manylinux-build-wheels.sh cp35
99

1010
# Generate dockcross scripts
11-
docker run --rm dockcross/manylinux1-x64:20200416-a6b6635 > /tmp/dockcross-manylinux-x64
11+
docker run --rm dockcross/manylinux1-x64:20201015-96d8741 > /tmp/dockcross-manylinux-x64
1212
chmod u+x /tmp/dockcross-manylinux-x64
1313

1414
script_dir=$(cd $(dirname $0) || exit 1; pwd)

scripts/internal/manylinux-build-common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [[ $# -eq 0 ]]; then
1414
PYBIN=(/opt/python/*/bin)
1515
PYBINARIES=()
1616
for version in "${PYBIN[@]}"; do
17-
if [[ ${version} == *"cp35"* || ${version} == *"cp36"* || ${version} == *"cp37"* || ${version} == *"cp38"* ]]; then
17+
if [[ ${version} == *"cp35"* || ${version} == *"cp36"* || ${version} == *"cp37"* || ${version} == *"cp38"* || ${version} == *"cp39"* ]]; then
1818
PYBINARIES+=(${version})
1919
fi
2020
done

scripts/internal/windows_build_common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
from subprocess import check_call
44
import os
5+
import shutil
56

6-
DEFAULT_PY_ENVS = ["35-x64", "36-x64", "37-x64", "38-x64"]
7+
DEFAULT_PY_ENVS = ["35-x64", "36-x64", "37-x64", "38-x64", "39-x64"]
78

89
SCRIPT_DIR = os.path.dirname(__file__)
910
ROOT_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "..", ".."))
@@ -32,6 +33,8 @@ def venv_paths(python_version):
3233
pip = os.path.join(venv_dir, "Scripts", "pip.exe")
3334

3435
ninja_executable = os.path.join(venv_dir, "Scripts", "ninja.exe")
36+
if not os.path.exists(ninja_executable):
37+
ninja_executable = shutil.which("ninja.exe")
3538
print("NINJA_EXECUTABLE:%s" % ninja_executable)
3639

3740
# Update PATH

scripts/macpython-build-common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
99

1010
# Versions can be restricted by passing them in as arguments to the script
1111
# For example,
12-
# macpython-build-wheels.sh 3.5
12+
# macpython-build-wheels.sh 3.9
1313
if [[ $# -eq 0 ]]; then
1414
PYBINARIES=(${MACPYTHON_PY_PREFIX}/*)
1515
else

scripts/macpython-build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Versions can be restricted by passing them in as arguments to the script
66
# For example,
77
#
8-
# scripts/macpython-build-wheels.sh 3.5
8+
# scripts/macpython-build-wheels.sh 3.9
99

1010
# -----------------------------------------------------------------------
1111
# These variables are set in common script:

scripts/macpython-install-python.sh

Lines changed: 52 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
4343
DOWNLOADS_SDIR=downloads
4444
WORKING_SDIR=working
4545

46-
# As of 24 Oct 2019 - latest Python of each version with binary download
46+
# As of 24 September 2020 - latest Python of each version with binary download
4747
# available.
4848
# See: https://www.python.org/downloads/mac-osx/
49-
LATEST_2p7=2.7.17
49+
LATEST_2p7=2.7.18
5050
LATEST_3p5=3.5.4
5151
LATEST_3p6=3.6.8
5252
LATEST_3p7=3.7.6
53-
LATEST_3p8=3.8.0
53+
LATEST_3p8=3.8.6
54+
LATEST_3p9=3.9.0
5455

5556

5657
function check_python {
@@ -107,20 +108,52 @@ function fill_pyver {
107108
echo $ver
108109
elif [ $ver == 2 ] || [ $ver == "2.7" ]; then
109110
echo $LATEST_2p7
110-
elif [ $ver == 3 ] || [ $ver == "3.7" ]; then
111+
elif [ $ver == 3 ] || [ $ver == "3.9" ]; then
112+
echo $LATEST_3p9
113+
elif [ $ver == "3.8" ]; then
114+
echo $LATEST_3p8
115+
elif [ $ver == "3.7" ]; then
111116
echo $LATEST_3p7
112117
elif [ $ver == "3.6" ]; then
113118
echo $LATEST_3p6
114119
elif [ $ver == "3.5" ]; then
115120
echo $LATEST_3p5
116-
elif [ $ver == "3.8" ]; then
117-
echo $LATEST_3p8
118121
else
119122
echo "Can't fill version $ver" 1>&2
120123
exit 1
121124
fi
122125
}
123126

127+
function macpython_sdk_list_for_version {
128+
# return a list of SDK targets supported for a given CPython version
129+
# Parameters
130+
# $py_version (python version in major.minor.extra format)
131+
# eg
132+
# macpython_sdks_for_version 2.7.15
133+
# >> 10.6 10.9
134+
local _ver=$(fill_pyver $1)
135+
local _major=${_ver%%.*}
136+
local _return
137+
138+
if [ "$_major" -eq "2" ]; then
139+
[ $(lex_ver $_ver) -lt $(lex_ver 2.7.18) ] && _return="10.6"
140+
[ $(lex_ver $_ver) -ge $(lex_ver 2.7.15) ] && _return="$_return 10.9"
141+
elif [ "$_major" -eq "3" ]; then
142+
[ $(lex_ver $_ver) -lt $(lex_ver 3.8) ] && _return="10.6"
143+
[ $(lex_ver $_ver) -ge $(lex_ver 3.6.5) ] && _return="$_return 10.9"
144+
else
145+
echo "Error version=${_ver}, expecting 2.x or 3.x" 1>&2
146+
exit 1
147+
fi
148+
echo $_return
149+
}
150+
151+
function macpython_sdk_for_version {
152+
# assumes the output of macpython_sdk_list_for_version is a list
153+
# of SDK versions XX.Y in sorted order, eg "10.6 10.9" or "10.9"
154+
echo $(macpython_sdk_list_for_version $1) | awk -F' ' '{print $NF}'
155+
}
156+
124157
function pyinst_ext_for_version {
125158
# echo "pkg" or "dmg" depending on the passed Python version
126159
# Parameters
@@ -148,13 +181,11 @@ function pyinst_fname_for_version {
148181
# Parameters
149182
# $py_version (Python version in major.minor.extra format)
150183
# $py_osx_ver: {major.minor | not defined}
151-
# if defined, the macOS version that Python is built for, e.g.
152-
# "10.6" or "10.9", if not defined, uses the default
153-
# MACPYTHON_DEFAULT_OSX
154-
# Note: this is the version the Python is built for, and hence
155-
# the min version supported, NOT the version of the current system
184+
# if defined, the minimum macOS SDK version that Python is
185+
# built for, eg: "10.6" or "10.9", if not defined, infers
186+
# this from $py_version using macpython_sdk_for_version
156187
local py_version=$1
157-
local py_osx_ver=${2:-$MACPYTHON_DEFAULT_OSX}
188+
local py_osx_ver=${2:-$(macpython_sdk_for_version $py_version)}
158189
local inst_ext=$(pyinst_ext_for_version $py_version)
159190
echo "python-${py_version}-macosx${py_osx_ver}.${inst_ext}"
160191
}
@@ -229,7 +260,7 @@ function macpython_impl_for_version {
229260
# "pypy-5.4" for PyPy
230261
local version=$1
231262
check_var $1
232-
if [[ "$version" =~ pypy-([0-9\.]+) ]]; then
263+
if [[ "$version" =~ ^pypy ]]; then
233264
echo pp
234265
elif [[ "$version" =~ ([0-9\.]+) ]]; then
235266
echo cp
@@ -257,17 +288,17 @@ function install_macpython {
257288
# Install Python and set $PYTHON_EXE to the installed executable
258289
# Parameters:
259290
# $version : [implementation-]major[.minor[.patch]]
260-
# The Python implementation to install, e.g. "3.6" or "pypy-5.4"
291+
# The Python implementation to install, e.g. "3.6", "pypy-5.4" or "pypy3.6-7.2"
261292
# $py_osx_ver: {major.minor | not defined}
262293
# if defined, the macOS version that CPython is built for, e.g.
263294
# "10.6" or "10.9". Ignored for PyPy
264295
local version=$1
265296
local py_osx_ver=$2
266297
local impl=$(macpython_impl_for_version $version)
267-
local stripped_ver=$(strip_macpython_ver_prefix $version)
268298
if [[ "$impl" == "pp" ]]; then
269-
install_mac_pypy $stripped_ver
299+
install_pypy $version
270300
elif [[ "$impl" == "cp" ]]; then
301+
local stripped_ver=$(strip_macpython_ver_prefix $version)
271302
install_mac_cpython $stripped_ver $py_osx_ver
272303
else
273304
echo "Unexpected Python impl: ${impl}"
@@ -304,43 +335,9 @@ function install_mac_cpython {
304335
if [ -e "$inst_cmd" ]; then
305336
sh "$inst_cmd"
306337
fi
307-
}
308-
309-
function install_mac_pypy {
310-
# Installs pypy.org PyPy
311-
# Parameter $version
312-
# Version given in major or major.minor or major.minor.micro e.g
313-
# "3" or "3.7" or "3.7.1".
314-
# sets $PYTHON_EXE variable to python executable
315-
local py_version=$(fill_pypy_ver $1)
316-
local py_build=$(get_pypy_build_prefix $py_version)$py_version-osx64
317-
local py_zip=$py_build.tar.bz2
318-
local zip_path=$DOWNLOADS_SDIR/$py_zip
319-
mkdir -p $DOWNLOADS_SDIR
320-
wget -nv $PYPY_URL/${py_zip} -P $DOWNLOADS_SDIR
321-
untar $zip_path
322-
PYTHON_EXE=$(realpath $py_build/bin/pypy)
323-
}
324-
325-
function install_pip {
326-
# Generic install pip
327-
# Gets needed version from version implied by $PYTHON_EXE
328-
# Installs pip into python given by $PYTHON_EXE
329-
# Assumes pip will be installed into same directory as $PYTHON_EXE
330-
check_python
331-
mkdir -p $DOWNLOADS_SDIR
332-
local py_mm=`get_py_mm`
333-
local get_pip_path=$DOWNLOADS_SDIR/get-pip.py
334-
curl $GET_PIP_URL > $get_pip_path
335-
# Travis VMS now install pip for system python by default - force install
336-
# even if installed already.
337-
sudo $PYTHON_EXE $get_pip_path --ignore-installed $pip_args
338-
PIP_CMD="sudo $(dirname $PYTHON_EXE)/pip$py_mm"
339-
# Append pip_args if present (avoiding trailing space cf using variable
340-
# above).
341-
if [ -n "$pip_args" ]; then
342-
PIP_CMD="$PIP_CMD $pip_args"
343-
fi
338+
PIP_CMD="$MACPYTHON_PY_PREFIX/$py_mm/bin/python$py_mm -m pip"
339+
$PIP_CMD install --upgrade pip
340+
export PIP_CMD
344341
}
345342

346343
function install_virtualenv {
@@ -375,14 +372,12 @@ function make_workon_venv {
375372
# Remove previous versions
376373
sudo rm -rf ${MACPYTHON_FRAMEWORK}
377374

378-
for pyversion in $LATEST_3p5 $LATEST_3p6 $LATEST_3p7; do
375+
for pyversion in $LATEST_3p6 $LATEST_3p7; do
379376
install_macpython $pyversion 10.6
380-
install_pip
381377
install_virtualenv
382378
done
383379

384-
for pyversion in $LATEST_3p8; do
380+
for pyversion in $LATEST_3p8 $LATEST_3p9; do
385381
install_macpython $pyversion 10.9
386-
install_pip
387382
install_virtualenv
388383
done

scripts/windows-download-cache-and-build-module-wheels.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ sz x doxygen-1.8.11.windows.bin.zip -oC:\P\doxygen -aoa -r
1515
Invoke-WebRequest -Uri "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -OutFile "grep-win.zip"
1616
sz x grep-win.zip -oC:\P\grep -aoa -r
1717
$env:Path += ";C:\P\grep"
18-
C:\Python35-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py
18+
C:\Python37-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py

scripts/windows_build_wheels.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ def build_wheels(py_envs=DEFAULT_PY_ENVS, single_wheel=False,
251251

252252
cmake_executable = "cmake.exe"
253253
tools_venv = os.path.join(ROOT_DIR, "venv-" + py_envs[0])
254-
pip_install(tools_venv, "ninja")
255-
ninja_executable = os.path.join(tools_venv, "Scripts", "ninja.exe")
254+
ninja_executable = shutil.which('ninja.exe')
255+
if ninja_executable is None:
256+
pip_install(tools_venv, "ninja")
257+
ninja_executable = os.path.join(tools_venv, "Scripts", "ninja.exe")
256258

257259
# Build standalone project and populate archive cache
258260
check_call([
@@ -268,7 +270,9 @@ def build_wheels(py_envs=DEFAULT_PY_ENVS, single_wheel=False,
268270
# Compile wheels re-using standalone project and archive cache
269271
for py_env in py_envs:
270272
tools_venv = os.path.join(ROOT_DIR, "venv-" + py_env)
271-
pip_install(tools_venv, "ninja")
273+
ninja_executable = shutil.which('ninja.exe')
274+
if ninja_executable is None:
275+
pip_install(tools_venv, "ninja")
272276
build_wheel(py_env, single_wheel=single_wheel,
273277
cleanup=cleanup, wheel_names=wheel_names,
274278
cmake_options=cmake_options)

0 commit comments

Comments
 (0)