Commit c83fd441 authored by 0dminnimda's avatar 0dminnimda Committed by GitHub

Introduce new shell syntax for ci-run.sh to improve Windows support (GH-4400)

parent c8c9a12e
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
GCC_VERSION=${GCC_VERSION:=8} GCC_VERSION=${GCC_VERSION:=8}
# Set up compilers # Set up compilers
if [ "$TEST_CODE_STYLE" == "1" ]; then if [[ $TEST_CODE_STYLE == "1" ]]; then
echo "Skipping compiler setup" echo "Skipping compiler setup"
elif [ "${OSTYPE##linux-gnu*}" == "" ]; then elif [[ $OSTYPE == "linux-gnu"* ]]; then
echo "Setting up linux compiler" echo "Setting up linux compiler"
echo "Installing requirements [apt]" echo "Installing requirements [apt]"
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
...@@ -13,7 +13,7 @@ elif [ "${OSTYPE##linux-gnu*}" == "" ]; then ...@@ -13,7 +13,7 @@ elif [ "${OSTYPE##linux-gnu*}" == "" ]; then
sudo apt install -y -q ccache gdb python-dbg python3-dbg gcc-$GCC_VERSION || exit 1 sudo apt install -y -q ccache gdb python-dbg python3-dbg gcc-$GCC_VERSION || exit 1
ALTERNATIVE_ARGS="" ALTERNATIVE_ARGS=""
if [ -z "${BACKEND##*cpp*}" ]; then if [[ $BACKEND == *"cpp"* ]]; then
sudo apt install -y -q g++-$GCC_VERSION || exit 1 sudo apt install -y -q g++-$GCC_VERSION || exit 1
ALTERNATIVE_ARGS="--slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION" ALTERNATIVE_ARGS="--slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION"
fi fi
...@@ -23,11 +23,11 @@ elif [ "${OSTYPE##linux-gnu*}" == "" ]; then ...@@ -23,11 +23,11 @@ elif [ "${OSTYPE##linux-gnu*}" == "" ]; then
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 60 $ALTERNATIVE_ARGS sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 60 $ALTERNATIVE_ARGS
export CC="gcc" export CC="gcc"
if [ -z "${BACKEND##*cpp*}" ]; then if [[ $BACKEND == *"cpp"* ]]; then
sudo update-alternatives --set g++ /usr/bin/g++-$GCC_VERSION sudo update-alternatives --set g++ /usr/bin/g++-$GCC_VERSION
export CXX="g++" export CXX="g++"
fi fi
elif [ "${OSTYPE##darwin*}" == "" ]; then elif [[ $OSTYPE == "darwin"* ]]; then
echo "Setting up macos compiler" echo "Setting up macos compiler"
export CC="clang -Wno-deprecated-declarations" export CC="clang -Wno-deprecated-declarations"
export CXX="clang++ -stdlib=libc++ -Wno-deprecated-declarations" export CXX="clang++ -stdlib=libc++ -Wno-deprecated-declarations"
...@@ -36,7 +36,7 @@ else ...@@ -36,7 +36,7 @@ else
fi fi
# Set up miniconda # Set up miniconda
if [ "$STACKLESS" == "true" ]; then if [[ $STACKLESS == "true" ]]; then
echo "Installing stackless python" echo "Installing stackless python"
#conda install --quiet --yes nomkl --file=test-requirements.txt --file=test-requirements-cpython.txt #conda install --quiet --yes nomkl --file=test-requirements.txt --file=test-requirements-cpython.txt
conda config --add channels stackless conda config --add channels stackless
...@@ -50,11 +50,11 @@ echo "====================" ...@@ -50,11 +50,11 @@ echo "===================="
echo "|VERSIONS INSTALLED|" echo "|VERSIONS INSTALLED|"
echo "====================" echo "===================="
echo "Python $PYTHON_SYS_VERSION" echo "Python $PYTHON_SYS_VERSION"
if [ "$CC" ]; then if [[ $CC ]]; then
which ${CC%% *} which ${CC%% *}
${CC%% *} --version ${CC%% *} --version
fi fi
if [ "$CXX" ]; then if [[ $CXX ]]; then
which ${CXX%% *} which ${CXX%% *}
${CXX%% *} --version ${CXX%% *} --version
fi fi
...@@ -62,39 +62,39 @@ echo "====================" ...@@ -62,39 +62,39 @@ echo "===================="
# Install python requirements # Install python requirements
echo "Installing requirements [python]" echo "Installing requirements [python]"
if [ -z "${PYTHON_VERSION##2.7}" ]; then if [[ $PYTHON_VERSION == "2.7"* ]]; then
pip install wheel || exit 1 pip install wheel || exit 1
pip install -r test-requirements-27.txt || exit 1 pip install -r test-requirements-27.txt || exit 1
elif [ -z "${PYTHON_VERSION##3.[45]*}" ]; then elif [[ $PYTHON_VERSION == "3."[45]* ]]; then
python -m pip install wheel || exit 1 python -m pip install wheel || exit 1
python -m pip install -r test-requirements-34.txt || exit 1 python -m pip install -r test-requirements-34.txt || exit 1
else else
python -m pip install -U pip setuptools wheel || exit 1 python -m pip install -U pip setuptools wheel || exit 1
if [ -n "${PYTHON_VERSION##*-dev}" -o "$COVERAGE" == "1" ]; then if [[ $PYTHON_VERSION != *"-dev" || $COVERAGE == "1" ]]; then
python -m pip install -r test-requirements.txt || exit 1 python -m pip install -r test-requirements.txt || exit 1
if [ "${PYTHON_VERSION##pypy*}" -a "${PYTHON_VERSION##3.[4789]*}" ]; then if [[ $PYTHON_VERSION != "pypy"* && $PYTHON_VERSION != "3."[4789]* ]]; then
python -m pip install -r test-requirements-cpython.txt || exit 1 python -m pip install -r test-requirements-cpython.txt || exit 1
fi fi
fi fi
fi fi
if [ "$TEST_CODE_STYLE" == "1" ]; then if [[ $TEST_CODE_STYLE == "1" ]]; then
STYLE_ARGS="--no-unit --no-doctest --no-file --no-pyregr --no-examples"; STYLE_ARGS="--no-unit --no-doctest --no-file --no-pyregr --no-examples"
python -m pip install -r doc-requirements.txt || exit 1 python -m pip install -r doc-requirements.txt || exit 1
else else
STYLE_ARGS="--no-code-style" STYLE_ARGS="--no-code-style"
# Install more requirements # Install more requirements
if [ -n "${PYTHON_VERSION##*-dev}" ]; then if [[ $PYTHON_VERSION != *"-dev" ]]; then
if [ -z "${BACKEND##*cpp*}" ]; then if [[ $BACKEND == *"cpp"* ]]; then
echo "WARNING: Currently not installing pythran due to compatibility issues" echo "WARNING: Currently not installing pythran due to compatibility issues"
# python -m pip install pythran==0.9.5 || exit 1 # python -m pip install pythran==0.9.5 || exit 1
fi fi
if [ "$BACKEND" != "cpp" -a -n "${PYTHON_VERSION##pypy*}" -a if [[ $BACKEND != "cpp" && $PYTHON_VERSION != "pypy"* &&
-n "${PYTHON_VERSION##2*}" -a -n "${PYTHON_VERSION##3.4*}" ]; then $PYTHON_VERSION != "2"* && $PYTHON_VERSION != "3.4"* ]]; then
python -m pip install mypy || exit 1 python -m pip install mypy || exit 1
fi fi
fi fi
...@@ -110,7 +110,7 @@ export PATH="/usr/lib/ccache:$PATH" ...@@ -110,7 +110,7 @@ export PATH="/usr/lib/ccache:$PATH"
# This is true for the latest msvc, gcc and clang # This is true for the latest msvc, gcc and clang
CFLAGS="-O0 -ggdb -Wall -Wextra" CFLAGS="-O0 -ggdb -Wall -Wextra"
if [ "$NO_CYTHON_COMPILE" != "1" -a -n "${PYTHON_VERSION##pypy*}" ]; then if [[ $NO_CYTHON_COMPILE != "1" && $PYTHON_VERSION != "pypy"* ]]; then
BUILD_CFLAGS="$CFLAGS -O2" BUILD_CFLAGS="$CFLAGS -O2"
if [[ $PYTHON_SYS_VERSION == "2"* ]]; then if [[ $PYTHON_SYS_VERSION == "2"* ]]; then
...@@ -118,10 +118,10 @@ if [ "$NO_CYTHON_COMPILE" != "1" -a -n "${PYTHON_VERSION##pypy*}" ]; then ...@@ -118,10 +118,10 @@ if [ "$NO_CYTHON_COMPILE" != "1" -a -n "${PYTHON_VERSION##pypy*}" ]; then
fi fi
SETUP_ARGS="" SETUP_ARGS=""
if [ "$COVERAGE" == "1" ]; then if [[ $COVERAGE == "1" ]]; then
SETUP_ARGS="$SETUP_ARGS --cython-coverage" SETUP_ARGS="$SETUP_ARGS --cython-coverage"
fi fi
if [ "$CYTHON_COMPILE_ALL" == "1" ]; then if [[ $CYTHON_COMPILE_ALL == "1" ]]; then
SETUP_ARGS="$SETUP_ARGS --cython-compile-all" SETUP_ARGS="$SETUP_ARGS --cython-compile-all"
fi fi
SETUP_ARGS="$SETUP_ARGS SETUP_ARGS="$SETUP_ARGS
...@@ -130,15 +130,18 @@ if [ "$NO_CYTHON_COMPILE" != "1" -a -n "${PYTHON_VERSION##pypy*}" ]; then ...@@ -130,15 +130,18 @@ if [ "$NO_CYTHON_COMPILE" != "1" -a -n "${PYTHON_VERSION##pypy*}" ]; then
CFLAGS=$BUILD_CFLAGS \ CFLAGS=$BUILD_CFLAGS \
python setup.py build_ext -i $SETUP_ARGS || exit 1 python setup.py build_ext -i $SETUP_ARGS || exit 1
if [ -z "$COVERAGE" -a -z "$STACKLESS" -a -n "${BACKEND//*cpp*}" -a # COVERAGE can be either "" (empty or not set) or "1" (when we set it)
-z "$LIMITED_API" -a -z "$CYTHON_COMPILE_ALL" -a -z "$EXTRA_CFLAGS" ]; then # STACKLESS can be either "" (empty or not set) or "true" (when we set it)
# CYTHON_COMPILE_ALL can be either "" (empty or not set) or "1" (when we set it)
if [[ $COVERAGE != "1" && $STACKLESS != "true" && $BACKEND != *"cpp"* &&
$CYTHON_COMPILE_ALL != "1" && $LIMITED_API == "" && $EXTRA_CFLAGS == "" ]]; then
python setup.py bdist_wheel || exit 1 python setup.py bdist_wheel || exit 1
fi fi
fi fi
if [ "$TEST_CODE_STYLE" == "1" ]; then if [[ $TEST_CODE_STYLE == "1" ]]; then
make -C docs html || exit 1 make -C docs html || exit 1
elif [ -n "${PYTHON_VERSION##pypy*}" ]; then elif [[ $PYTHON_VERSION != "pypy"* ]]; then
# Run the debugger tests in python-dbg if available # Run the debugger tests in python-dbg if available
# (but don't fail, because they currently do fail) # (but don't fail, because they currently do fail)
PYTHON_DBG=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])') PYTHON_DBG=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])')
...@@ -150,10 +153,10 @@ elif [ -n "${PYTHON_VERSION##pypy*}" ]; then ...@@ -150,10 +153,10 @@ elif [ -n "${PYTHON_VERSION##pypy*}" ]; then
fi fi
RUNTESTS_ARGS="" RUNTESTS_ARGS=""
if [ "$COVERAGE" == "1" ]; then if [[ $COVERAGE == "1" ]]; then
RUNTESTS_ARGS="$RUNTESTS_ARGS --coverage --coverage-html --cython-only" RUNTESTS_ARGS="$RUNTESTS_ARGS --coverage --coverage-html --cython-only"
fi fi
if [ -z "$TEST_CODE_STYLE" ]; then if [[ $TEST_CODE_STYLE != "1" ]]; then
RUNTESTS_ARGS="$RUNTESTS_ARGS -j7" RUNTESTS_ARGS="$RUNTESTS_ARGS -j7"
fi fi
......
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