forked from sklam/numba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jenkins
executable file
·43 lines (38 loc) · 1.34 KB
/
.jenkins
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#
# This is the jenkins build script for building/testing Numba.
#
# Jenkins Requirements:
# - Anaconda should be installed in ~/anaconda
# - Use a jenkins build matrix for multiple
# platforms/python versions
# - Use the XShell plugin to launch this script
# - Call the script from the root workspace
# directory as ./.jenkins
#
# Require a version of Python to be selected
if [ "${PYTHON_VERSION}" == "" ]; then
echo You must select a Python version with the PYTHON_VERSION variable.
exit 1
fi
# Use conda to create a conda environment of the required
# python version and containing the dependencies.
export PYENV_PREFIX=${WORKSPACE}/build/pyenv
rm -rf ${PYENV_PREFIX}
~/anaconda/bin/conda create --yes -p ${PYENV_PREFIX} python=${PYTHON_VERSION} cython scipy llvmpy cffi distribute nose || exit 1
export PATH=${PYENV_PREFIX}/bin:${PATH}
if [ -f "${PYENV_PREFIX}/bin/python" ]; then
export PYTHON_EXECUTABLE=${PYENV_PREFIX}/bin/python
elif [ -f "${PYENV_PREFIX}/bin/python3" ]; then
export PYTHON_EXECUTABLE=${PYENV_PREFIX}/bin/python3
else
echo Conda environment creation failed.
exit 1
fi
# Build/install Numba
pip install -r requirements.txt --use-mirrors
${PYTHON_EXECUTABLE} setup.py install || exit 1
# Run the tests
pushd ..
${PYTHON_EXECUTABLE} -c 'import sys, numba;sys.exit(0 if numba.test([]) == 0 else 1)' || exit 1
popd