Unverified Commit 1a9ddbee authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge pull request #323 from mattip/specific-python-pip2

MRG: Specify python, pip using PYTHON_EXE, PYTHON _EXE -mpip

Replaces gh-315: rebased and fixed one more occurrence

Related to MacPython/pandas-wheels#79
parents ec50c47f 4d6b73c7
......@@ -63,15 +63,18 @@ function stop_spinner {
}
function abspath {
# Can work with any Python; need not be our installed Python.
python -c "import os.path; print(os.path.abspath('$1'))"
}
function relpath {
# Path of first input relative to second (or $PWD if not specified)
# Can work with any Python; need not be our installed Python.
python -c "import os.path; print(os.path.relpath('$1','${2:-$PWD}'))"
}
function realpath {
# Can work with any Python; need not be our installed Python.
python -c "import os; print(os.path.realpath('$1'))"
}
......@@ -262,7 +265,8 @@ function bdist_wheel_cmd {
# fixed with bdist_wheel:
# https://github.com/warner/python-versioneer/issues/121
local abs_wheelhouse=$1
python setup.py bdist_wheel
check_python
$PYTHON_EXE setup.py bdist_wheel
cp dist/*.whl $abs_wheelhouse
}
......@@ -318,6 +322,7 @@ function pip_opts {
function get_platform {
# Report platform as given by uname
# Use any Python that comes to hand.
python -c 'import platform; print(platform.uname()[4])'
}
......@@ -327,7 +332,8 @@ if [ "$(get_platform)" == x86_64 ] || \
function get_distutils_platform {
# Report platform as given by distutils get_platform.
# This is the platform tag that pip will use.
python -c "import distutils.util; print(distutils.util.get_platform())"
check_python
$PYTHON_EXE -c "import distutils.util; print(distutils.util.get_platform())"
}
function install_wheel {
......@@ -340,19 +346,24 @@ function install_wheel {
# TEST_DEPENDS (optional, default "")
# MANYLINUX_URL (optional, default "") (via pip_opts function)
local wheelhouse=$(abspath ${WHEEL_SDIR:-wheelhouse})
check_pip
if [ -n "$TEST_DEPENDS" ]; then
while read TEST_DEPENDENCY; do
$PYTHON_EXE -mpip install $(pip_opts) $@ $TEST_DEPENDENCY
$PIP_CMD install $(pip_opts) $@ $TEST_DEPENDENCY
done <<< "$TEST_DEPENDS"
fi
$PYTHON_EXE -mpip install packaging
check_python
check_pip
$PIP_CMD install packaging
local supported_wheels=$($PYTHON_EXE $MULTIBUILD_DIR/supported_wheels.py $wheelhouse/*.whl)
if [ -z "$supported_wheels" ]; then
echo "ERROR: no supported wheels found"
exit 1
fi
# Install compatible wheel
$PYTHON_EXE -mpip install $(pip_opts) $@ $supported_wheels
$PIP_CMD install $(pip_opts) $@ $supported_wheels
}
function install_run {
......
set -ex
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
function run_tests {
$PYTHON_EXE -c "import simplejson"
}
......
......@@ -2,11 +2,20 @@
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -x
source common_utils.sh
source tests/utils.sh
# This is normally set
# - on linux via docker_build_wrap.sh, docker_test_wrap.sh
# - on macOS via make_workon_env or install_macpython,
# which is called by get_macpython_environment which is called by before_install
# We call it here so that these pre-install tests succeed
PYTHON_EXE=python
source tests/utils.sh
source tests/test_common_utils.sh
source tests/test_fill_submodule.sh
# make sure it is set via one of the mechanisms above
unset PYTHON_EXE
if [ -n "$IS_OSX" ]; then
source osx_utils.sh
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$(macpython_sdk_for_version $MB_PYTHON_VERSION)}
......
......@@ -26,7 +26,7 @@ MB_PYTHON_VERSION=${MB_PYTHON_VERSION:-$TRAVIS_PYTHON_VERSION}
function before_install {
# Install a virtualenv to work in.
virtualenv --python=python venv
virtualenv --python=$PYTHON_EXE venv
source venv/bin/activate
python --version # just to check
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