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
8af041e2
Commit
8af041e2
authored
Mar 28, 2017
by
Kyle Stewart
Browse files
Remove dependance on MB_PYTHON_VERSION.
Functions renamed to match their intent better.
parent
01cf6111
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
47 deletions
+30
-47
.travis.yml
.travis.yml
+8
-8
osx_utils.sh
osx_utils.sh
+18
-31
tests/test_multibuild.sh
tests/test_multibuild.sh
+1
-5
tests/test_python_install.sh
tests/test_python_install.sh
+2
-2
travis_osx_steps.sh
travis_osx_steps.sh
+1
-1
No files found.
.travis.yml
View file @
8af041e2
...
...
@@ -31,35 +31,35 @@ matrix:
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-2.6
-
PYTHON_VERSION=pypy-2.6
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-4.0
-
PYTHON_VERSION=pypy-4.0
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-5.0
-
PYTHON_VERSION=pypy-5.0
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-5.1
-
PYTHON_VERSION=pypy-5.1
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-5.3
-
PYTHON_VERSION=pypy-5.3
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-5.4
-
PYTHON_VERSION=pypy-5.4
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-5.6
-
PYTHON_VERSION=pypy-5.6
-
VENV=venv
-
os
:
osx
env
:
-
MB_
PYTHON_VERSION=pypy-5.7
-
PYTHON_VERSION=pypy-5.7
-
VENV=venv
script
:
...
...
osx_utils.sh
View file @
8af041e2
...
...
@@ -120,22 +120,24 @@ function pyinst_ext_for_version {
fi
}
function
install_python
{
# Picks an implementation of Python determined by the MB_PYTHON_VERSION
# enviroment variable, then installs it
# A sub-function will set $PYTHON_EXE variable to the python executable
if
[[
"
$MB_PYTHON_VERSION
"
=
~ pypy-
([
0-9
\.
]
+
)
]]
;
then
function
install_macpython
{
# Install Python and set $PYTHON_EXE to the installed executable
# Parameters:
# $version : [implementation-]major[.minor[.patch]]
# The Python implementation to install, e.g. "3.6" or "pypy-5.4"
local
version
=
$1
if
[[
"
$version
"
=
~ pypy-
([
0-9
\.
]
+
)
]]
;
then
install_mac_pypy
"
${
BASH_REMATCH
[1]
}
"
elif
[[
"
$
MB_PYTHON_VERSION
"
=
~
([
0-9
\.
]
+
)
]]
;
then
install_macpython
"
${
BASH_REMATCH
[1]
}
"
elif
[[
"
$
version
"
=
~
([
0-9
\.
]
+
)
]]
;
then
install_mac
_c
python
"
${
BASH_REMATCH
[1]
}
"
else
echo
"config error: Issue parsing
MB_PYTHON_VERSION variable
:"
echo
"
MB_PYTHON_VERSION=
$MB_PYTHON_VERSION
"
echo
"config error: Issue parsing
this implentation in install_python
:"
echo
"
version=
$version
"
exit
1
fi
}
function
install_macpython
{
function
install_mac
_c
python
{
# Installs Python.org Python
# Parameter $version
# Version given in major or major.minor or major.minor.micro e.g
...
...
@@ -236,9 +238,11 @@ function set_py_vars {
export
PYTHON_EXE PIP_CMD
}
function
get_python_environment
{
function
get_
mac
python_environment
{
# Set up MacPython environment
# Parameters:
# $version : [implementation-]major[.minor[.patch]]
# The Python implementation to install, e.g. "3.6" or "pypy-5.4"
# $venv_dir : {directory_name|not defined}
# If defined - make virtualenv in this directory, set python / pip
# commands accordingly
...
...
@@ -248,9 +252,10 @@ function get_python_environment {
# Sets $PIP_CMD to full command for pip (including sudo if necessary)
# If $venv_dir defined, Sets $VIRTUALENV_CMD to virtualenv executable
# Puts directory of $PYTHON_EXE on $PATH
local
venv_dir
=
$1
local
version
=
$1
local
venv_dir
=
$2
remove_travis_ve_pip
install_python
install_
mac
python
$version
install_pip
if
[
-n
"
$venv_dir
"
]
;
then
install_virtualenv
...
...
@@ -259,24 +264,6 @@ function get_python_environment {
set_py_vars
}
function
get_macpython_environment
{
# Set up MacPython environment
# Parameters:
# $version :
# major.minor.micro e.g. "3.4.1"
# $venv_dir : {directory_name|not defined}
# If defined - make virtualenv in this directory, set python / pip
# commands accordingly
#
# Installs Python
# Sets $PYTHON_EXE to path to Python executable
# Sets $PIP_CMD to full command for pip (including sudo if necessary)
# If $venv_dir defined, Sets $VIRTUALENV_CMD to virtualenv executable
# Puts directory of $PYTHON_EXE on $PATH
MB_PYTHON_VERSION
=
$1
get_python_environment
$2
}
function
repair_wheelhouse
{
local
wheelhouse
=
$1
pip
install
delocate
...
...
tests/test_multibuild.sh
View file @
8af041e2
...
...
@@ -6,11 +6,7 @@ source tests/test_common_utils.sh
source
tests/test_fill_submodule.sh
if
[
-n
"
$IS_OSX
"
]
;
then
source
osx_utils.sh
if
[
-n
"
$PYTHON_VERSION
"
]
;
then
get_macpython_environment
$PYTHON_VERSION
$VENV
else
get_python_environment
$VENV
fi
get_macpython_environment
$PYTHON_VERSION
$VENV
source
tests/test_python_install.sh
source
tests/test_fill_pyver.sh
source
tests/test_osx_utils.sh
...
...
tests/test_python_install.sh
View file @
8af041e2
...
...
@@ -21,10 +21,10 @@ fi
python_mm
=
"
${
cpython_version
:0:1
}
.
${
cpython_version
:2:1
}
"
# Remove implementation prefix
if
[[
"
$
MB_
PYTHON_VERSION
"
=
~
(
pypy-
)
?
([
0-9
\.
]
+
)
]]
;
then
if
[[
"
$PYTHON_VERSION
"
=
~
(
pypy-
)
?
([
0-9
\.
]
+
)
]]
;
then
requested_version
=
${
BASH_REMATCH
[2]
}
else
ingest
"Error parsing
MB_
PYTHON_VERSION=
$
MB_
PYTHON_VERSION
"
ingest
"Error parsing PYTHON_VERSION=
$PYTHON_VERSION
"
fi
# simple regex match, a 2.7 pattern will match 2.7.11, but not 2
...
...
travis_osx_steps.sh
View file @
8af041e2
...
...
@@ -15,7 +15,7 @@ source $MULTIBUILD_DIR/library_builders.sh
function
before_install
{
export
CC
=
clang
export
CXX
=
clang++
get_python_environment venv
get_
mac
python_environment
$MB_PYTHON_VERSION
venv
source
venv/bin/activate
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