Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
c920f21b
Commit
c920f21b
authored
Jan 26, 2019
by
Rob Buckley
Browse files
add support for python.org builds targetting osx 10.9
parent
31383c15
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
17 deletions
+95
-17
.gitignore
.gitignore
+1
-0
.travis.yml
.travis.yml
+29
-2
osx_utils.sh
osx_utils.sh
+27
-11
tests/test_multibuild.sh
tests/test_multibuild.sh
+2
-1
tests/test_osx_utils.sh
tests/test_osx_utils.sh
+23
-0
tests/test_supported_wheels.sh
tests/test_supported_wheels.sh
+10
-1
travis_osx_steps.sh
travis_osx_steps.sh
+3
-2
No files found.
.gitignore
View file @
c920f21b
downloads/
downloads/
*.orig
*.orig
.idea/
.travis.yml
View file @
c920f21b
...
@@ -49,6 +49,10 @@ matrix:
...
@@ -49,6 +49,10 @@ matrix:
env
:
env
:
-
PYTHON_VERSION=2.7
-
PYTHON_VERSION=2.7
-
VENV=venv
-
VENV=venv
-
os
:
osx
env
:
-
PYTHON_VERSION=2.7
-
MB_PYTHON_OSX_VER=10.9
-
os
:
osx
-
os
:
osx
env
:
env
:
-
PYTHON_VERSION=3.4
-
PYTHON_VERSION=3.4
...
@@ -67,10 +71,20 @@ matrix:
...
@@ -67,10 +71,20 @@ matrix:
env
:
env
:
-
PYTHON_VERSION=3.6
-
PYTHON_VERSION=3.6
-
VENV=venv
-
VENV=venv
-
os
:
osx
env
:
-
PYTHON_VERSION=3.6
-
VENV=venv
-
MB_PYTHON_OSX_VER=10.9
-
os
:
osx
env
:
-
PYTHON_VERSION=3.7
-
VENV=venv
-
os
:
osx
-
os
:
osx
env
:
env
:
-
PYTHON_VERSION=3.7
-
PYTHON_VERSION=3.7
-
VENV=venv
-
VENV=venv
-
MB_PYTHON_OSX_VER=10.9
-
os
:
osx
-
os
:
osx
env
:
env
:
-
PYTHON_VERSION=3.7
-
PYTHON_VERSION=3.7
...
@@ -108,8 +122,21 @@ matrix:
...
@@ -108,8 +122,21 @@ matrix:
env
:
env
:
-
PYTHON_VERSION=pypy-6.0
-
PYTHON_VERSION=pypy-6.0
-
VENV=venv
-
VENV=venv
# Default OSX (xcode image) is 10.13 (xcode 9.4.1) as of 2018-08-03
# # 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/
# # See: https://docs.travis-ci.com/user/reference/osx/
-
os
:
osx
osx_image
:
xcode10.1
env
:
-
PYTHON_VERSION=3.7
-
os
:
osx
osx_image
:
xcode10.1
env
:
-
PYTHON_VERSION=3.7
-
MB_PYTHON_OSX_VER=10.9
-
os
:
osx
osx_image
:
xcode10
env
:
-
PYTHON_VERSION=3.7
-
os
:
osx
-
os
:
osx
osx_image
:
xcode10.1
osx_image
:
xcode10.1
env
:
env
:
...
...
osx_utils.sh
View file @
c920f21b
...
@@ -8,6 +8,7 @@ source $MULTIBUILD_DIR/common_utils.sh
...
@@ -8,6 +8,7 @@ source $MULTIBUILD_DIR/common_utils.sh
MACPYTHON_URL
=
https://www.python.org/ftp/python
MACPYTHON_URL
=
https://www.python.org/ftp/python
MACPYTHON_PY_PREFIX
=
/Library/Frameworks/Python.framework/Versions
MACPYTHON_PY_PREFIX
=
/Library/Frameworks/Python.framework/Versions
MACPYTHON_DEFAULT_OSX
=
"10.6"
GET_PIP_URL
=
https://bootstrap.pypa.io/get-pip.py
GET_PIP_URL
=
https://bootstrap.pypa.io/get-pip.py
DOWNLOADS_SDIR
=
downloads
DOWNLOADS_SDIR
=
downloads
WORKING_SDIR
=
working
WORKING_SDIR
=
working
...
@@ -119,9 +120,10 @@ function pyinst_fname_for_version {
...
@@ -119,9 +120,10 @@ function pyinst_fname_for_version {
# echo filename for OSX installer file given Python version
# echo filename for OSX installer file given Python version
# Parameters
# Parameters
# $py_version (python version in major.minor.extra format)
# $py_version (python version in major.minor.extra format)
# $osx_ver (macosx version in major.minor format, defaults to MACPYTHON_DEFAULT_OSX)
local
py_version
=
$1
local
py_version
=
$1
local
osx_ver
=
${
2
:-
$MACPYTHON_DEFAULT_OSX
}
local
inst_ext
=
$(
pyinst_ext_for_version
$py_version
)
local
inst_ext
=
$(
pyinst_ext_for_version
$py_version
)
local
osx_ver
=
10.6
echo
"python-
$py_version
-macosx
${
osx_ver
}
.
$inst_ext
"
echo
"python-
$py_version
-macosx
${
osx_ver
}
.
$inst_ext
"
}
}
...
@@ -130,11 +132,13 @@ function install_macpython {
...
@@ -130,11 +132,13 @@ function install_macpython {
# Parameters:
# Parameters:
# $version : [implementation-]major[.minor[.patch]]
# $version : [implementation-]major[.minor[.patch]]
# The Python implementation to install, e.g. "3.6" or "pypy-5.4"
# The Python implementation to install, e.g. "3.6" or "pypy-5.4"
# $osx_version: { 10.6|10.9 }. Ignored for pypy
local
version
=
$1
local
version
=
$1
local
osx_version
=
$2
if
[[
"
$version
"
=
~ pypy-
([
0-9
\.
]
+
)
]]
;
then
if
[[
"
$version
"
=
~ pypy-
([
0-9
\.
]
+
)
]]
;
then
install_mac_pypy
"
${
BASH_REMATCH
[1]
}
"
install_mac_pypy
"
${
BASH_REMATCH
[1]
}
"
elif
[[
"
$version
"
=
~
([
0-9
\.
]
+
)
]]
;
then
elif
[[
"
$version
"
=
~
([
0-9
\.
]
+
)
]]
;
then
install_mac_cpython
"
${
BASH_REMATCH
[1]
}
"
install_mac_cpython
"
${
BASH_REMATCH
[1]
}
"
$osx_version
else
else
echo
"config error: Issue parsing this implementation in install_python:"
echo
"config error: Issue parsing this implementation in install_python:"
echo
" version=
$version
"
echo
" version=
$version
"
...
@@ -144,13 +148,16 @@ function install_macpython {
...
@@ -144,13 +148,16 @@ function install_macpython {
function
install_mac_cpython
{
function
install_mac_cpython
{
# Installs Python.org Python
# Installs Python.org Python
# Parameter $version
# Parameters
# Version given in major or major.minor or major.minor.micro e.g
# $py_version
# "3" or "3.4" or "3.4.1".
# Version given in major or major.minor or major.minor.micro e.g
# "3" or "3.4" or "3.4.1".
# $osx_version = { 10.6 | 10.9 }
# sets $PYTHON_EXE variable to python executable
# sets $PYTHON_EXE variable to python executable
local
py_version
=
$(
fill_pyver
$1
)
local
py_version
=
$(
fill_pyver
$1
)
local
osx_version
=
$2
local
py_stripped
=
$(
strip_ver_suffix
$py_version
)
local
py_stripped
=
$(
strip_ver_suffix
$py_version
)
local
py_inst
=
$(
pyinst_fname_for_version
$py_version
)
local
py_inst
=
$(
pyinst_fname_for_version
$py_version
$osx_version
)
local
inst_path
=
$DOWNLOADS_SDIR
/
$py_inst
local
inst_path
=
$DOWNLOADS_SDIR
/
$py_inst
mkdir
-p
$DOWNLOADS_SDIR
mkdir
-p
$DOWNLOADS_SDIR
curl
$MACPYTHON_URL
/
$py_stripped
/
${
py_inst
}
>
$inst_path
curl
$MACPYTHON_URL
/
$py_stripped
/
${
py_inst
}
>
$inst_path
...
@@ -258,6 +265,7 @@ function get_macpython_environment {
...
@@ -258,6 +265,7 @@ function get_macpython_environment {
# $venv_dir : {directory_name|not defined}
# $venv_dir : {directory_name|not defined}
# If defined - make virtualenv in this directory, set python / pip
# If defined - make virtualenv in this directory, set python / pip
# commands accordingly
# commands accordingly
# $osx_version: {10.6 | 10.9}
#
#
# Installs Python
# Installs Python
# Sets $PYTHON_EXE to path to Python executable
# Sets $PYTHON_EXE to path to Python executable
...
@@ -265,15 +273,15 @@ function get_macpython_environment {
...
@@ -265,15 +273,15 @@ function get_macpython_environment {
# If $venv_dir defined, Sets $VIRTUALENV_CMD to virtualenv executable
# If $venv_dir defined, Sets $VIRTUALENV_CMD to virtualenv executable
# Puts directory of $PYTHON_EXE on $PATH
# Puts directory of $PYTHON_EXE on $PATH
local
version
=
$1
local
version
=
$1
local
venv_dir
=
$2
local
osx_version
=
$2
local
venv_dir
=
$3
if
[
"
$USE_CCACHE
"
==
"1"
]
;
then
if
[
"
$USE_CCACHE
"
==
"1"
]
;
then
activate_ccache
activate_ccache
fi
fi
remove_travis_ve_pip
remove_travis_ve_pip
install_macpython
$version
install_macpython
$version
$osx_version
install_pip
install_pip
if
[
-n
"
$venv_dir
"
]
;
then
if
[
-n
"
$venv_dir
"
]
;
then
...
@@ -298,12 +306,20 @@ function repair_wheelhouse {
...
@@ -298,12 +306,20 @@ function repair_wheelhouse {
delocate-wheel
$wheelhouse
/
*
.whl
# copies library dependencies into wheel
delocate-wheel
$wheelhouse
/
*
.whl
# copies library dependencies into wheel
# Add platform tags to label wheels as compatible with OSX 10.9 and
# Add platform tags to label wheels as compatible with OSX 10.9 and
# 10.10. The wheels will be built against Python.org Python, and so will
# 10.10. The wheels will be built against Python.org Python, and so will
# in fact be compatible with OSX >= 10.6
.
pip < 6.0 doesn't realize
# in fact be compatible with OSX >= 10.6
or >=10.9.
pip < 6.0 doesn't realize
# this, so, in case users have older pip, add platform tags to specify
# this, so, in case users have older pip, add platform tags to specify
# compatibility with later OSX. Not necessary for OSX released well
# compatibility with later OSX. Not necessary for OSX released well
# after pip 6.0. See:
# after pip 6.0. See:
# https://github.com/MacPython/wiki/wiki/Spinning-wheels#question-will-pip-give-me-a-broken-wheel
# https://github.com/MacPython/wiki/wiki/Spinning-wheels#question-will-pip-give-me-a-broken-wheel
delocate-addplat
--rm-orig
-x
10_9
-x
10_10
$wheelhouse
/
*
.whl
if
[
$MB_PYTHON_OSX_VER
==
"10.6"
]
;
then
delocate-addplat
--rm-orig
-x
10_9
-x
10_10
$wheelhouse
/
*
.whl
elif
[
$MB_PYTHON_OSX_VER
==
"10.9"
]
;
then
# assume that 10.9 python is 64-bit arch only
delocate-addplat
--rm-orig
-p
macosx_10_10_x86_64
$wheelhouse
/
*
.whl
else
echo
"Invalid python macosx version
$MB_PYTHON_OSX_VER
"
1>&2
exit
1
fi
}
}
function
install_pkg_config
{
function
install_pkg_config
{
...
...
tests/test_multibuild.sh
View file @
c920f21b
...
@@ -8,7 +8,8 @@ source tests/test_common_utils.sh
...
@@ -8,7 +8,8 @@ source tests/test_common_utils.sh
source
tests/test_fill_submodule.sh
source
tests/test_fill_submodule.sh
if
[
-n
"
$IS_OSX
"
]
;
then
if
[
-n
"
$IS_OSX
"
]
;
then
source
osx_utils.sh
source
osx_utils.sh
get_macpython_environment
$PYTHON_VERSION
$VENV
MB_PYTHON_OSX_VER
=
${
MB_PYTHON_OSX_VER
:-
$MACPYTHON_DEFAULT_OSX
}
get_macpython_environment
$PYTHON_VERSION
$MB_PYTHON_OSX_VER
$VENV
source
tests/test_python_install.sh
source
tests/test_python_install.sh
source
tests/test_fill_pyver.sh
source
tests/test_fill_pyver.sh
source
tests/test_fill_pypy_ver.sh
source
tests/test_fill_pypy_ver.sh
...
...
tests/test_osx_utils.sh
View file @
c920f21b
...
@@ -12,9 +12,32 @@
...
@@ -12,9 +12,32 @@
[
"
$(
pyinst_ext_for_version 3
)
"
==
pkg
]
||
ingest
[
"
$(
pyinst_ext_for_version 3
)
"
==
pkg
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.8
)
"
==
"python-2.7.8-macosx10.6.dmg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.8
)
"
==
"python-2.7.8-macosx10.6.dmg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.9
)
"
==
"python-2.7.9-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.9
)
"
==
"python-2.7.9-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.10
)
"
==
"python-2.7.10-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.11
)
"
==
"python-2.7.11-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.12
)
"
==
"python-2.7.12-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 2.7.13
)
"
==
"python-2.7.13-macosx10.6.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.4.1
)
"
==
"python-3.4.1-macosx10.6.dmg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.4.1
)
"
==
"python-3.4.1-macosx10.6.dmg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.4.2
)
"
==
"python-3.4.2-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.4.2
)
"
==
"python-3.4.2-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.1
)
"
==
"python-3.6.1-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.1
)
"
==
"python-3.6.1-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.2
)
"
==
"python-3.6.2-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.3
)
"
==
"python-3.6.3-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.4
)
"
==
"python-3.6.4-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.5
)
"
==
"python-3.6.5-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.6
)
"
==
"python-3.6.6-macosx10.6.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.7
)
"
==
"python-3.6.7-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.0
)
"
==
"python-3.7.0-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 10.9
)
"
==
"python-2.7.15-macosx10.9.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.5 10.9
)
"
==
"python-3.6.5-macosx10.9.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.6 10.9
)
"
==
"python-3.6.6-macosx10.9.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.7 10.9
)
"
==
"python-3.6.7-macosx10.9.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.6.8 10.9
)
"
==
"python-3.6.8-macosx10.9.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.7.0 10.9
)
"
==
"python-3.7.0-macosx10.9.pkg"
]
||
ingest
[
"
$(
pyinst_fname_for_version 3.7.1 10.9
)
"
==
"python-3.7.1-macosx10.9.pkg"
]
||
ingest
# Test utilities for getting Python version versions
# Test utilities for getting Python version versions
[
"
$(
get_py_digit
)
"
==
"
${
cpython_version
:0:1
}
"
]
||
ingest
[
"
$(
get_py_digit
)
"
==
"
${
cpython_version
:0:1
}
"
]
||
ingest
...
...
tests/test_supported_wheels.sh
View file @
c920f21b
...
@@ -10,6 +10,15 @@ lpv=$(lex_ver $PYTHON_VERSION)
...
@@ -10,6 +10,15 @@ lpv=$(lex_ver $PYTHON_VERSION)
if
[
$lpv
-ge
$(
lex_ver 3.5
)
]
||
[
$lpv
-lt
$(
lex_ver 3
)
]
;
then
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
for
whl
in
wheel
==
0.31.1
wheel
==
0.32.0 wheel
;
do
$pip_install
-U
$whl
$pip_install
-U
$whl
$PYTHON_EXE
supported_wheels.py tornado-5.1-cp27-cp27m-macosx_10_6_intel.whl tornado-5.1-cp36-cp36m-macosx_10_13_x86_64.whl texext-0.6.1-cp36-none-any.whl
$PYTHON_EXE
supported_wheels.py
\
tornado-5.1-cp27-cp27m-macosx_10_6_intel.whl
\
tornado-5.1-cp27-cp27m-macosx_10_9_intel.whl
\
tornado-5.1-cp27-cp27m-macosx_10_9_x86_64.whl
\
tornado-5.1-cp27-cp27m-macosx_10_13_x86_64.whl
\
tornado-5.1-cp36-cp36m-macosx_10_6_intel.whl
\
tornado-5.1-cp36-cp36m-macosx_10_9_intel.whl
\
tornado-5.1-cp36-cp36m-macosx_10_9_x86_64.whl
\
tornado-5.1-cp36-cp36m-macosx_10_13_x86_64.whl
\
texext-0.6.1-cp36-none-any.whl
done
done
fi
fi
travis_osx_steps.sh
View file @
c920f21b
...
@@ -5,11 +5,12 @@ set -e
...
@@ -5,11 +5,12 @@ set -e
# Get needed utilities
# Get needed utilities
MULTIBUILD_DIR
=
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
MULTIBUILD_DIR
=
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
MB_PYTHON_VERSION
=
${
MB_PYTHON_VERSION
:-
$TRAVIS_PYTHON_VERSION
}
MB_PYTHON_VERSION
=
${
MB_PYTHON_VERSION
:-
$TRAVIS_PYTHON_VERSION
}
ENV_VARS_PATH
=
${
ENV_VARS_PATH
:-
env_vars
.sh
}
ENV_VARS_PATH
=
${
ENV_VARS_PATH
:-
env_vars
.sh
}
# These load common_utils.sh
# These load common_utils.sh
source
$MULTIBUILD_DIR
/osx_utils.sh
source
$MULTIBUILD_DIR
/osx_utils.sh
# osx_utils defines MACPYTHON_DEFAULT_OSX
MB_PYTHON_OSX_VER
=
$(
$MB_PYTHON_OSX_VER
:-
$MACPYTHON_DEFAULT_OSX
)
if
[
-r
"
$ENV_VARS_PATH
"
]
;
then
source
"
$ENV_VARS_PATH
"
;
fi
if
[
-r
"
$ENV_VARS_PATH
"
]
;
then
source
"
$ENV_VARS_PATH
"
;
fi
source
$MULTIBUILD_DIR
/configure_build.sh
source
$MULTIBUILD_DIR
/configure_build.sh
source
$MULTIBUILD_DIR
/library_builders.sh
source
$MULTIBUILD_DIR
/library_builders.sh
...
@@ -22,7 +23,7 @@ function before_install {
...
@@ -22,7 +23,7 @@ function before_install {
brew cask uninstall oclint
||
true
brew cask uninstall oclint
||
true
export
CC
=
clang
export
CC
=
clang
export
CXX
=
clang++
export
CXX
=
clang++
get_macpython_environment
$MB_PYTHON_VERSION
venv
get_macpython_environment
$MB_PYTHON_VERSION
$MB_PYTHON_OSX_VER
venv
source
venv/bin/activate
source
venv/bin/activate
pip
install
--upgrade
pip wheel
pip
install
--upgrade
pip wheel
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment