| 1 |
source /home/jenkins/.jenkins/virtual_envs/$PythonVersion/$packages/bin/activate |
| 2 |
# get the newest version of nose and coverage, ignoring installed packages |
| 3 |
pip install --upgrade -I nose coverage || : |
| 4 |
|
| 5 |
# Make sure pyparsing and ipython (used for pretty printing) are installed |
| 6 |
pip install pyparsing --upgrade |
| 7 |
pip install ipython |
| 8 |
|
| 9 |
# Make sure we have sphinx (for testing the sphinxext) |
| 10 |
pip install sphinx |
| 11 |
|
| 12 |
echo "Using newest available package versions" |
| 13 |
|
| 14 |
pip install --upgrade numpy |
| 15 |
pip install --upgrade scipy |
| 16 |
pip install --upgrade sympy |
| 17 |
pip install --upgrade matplotlib |
| 18 |
|
| 19 |
# Print the version numbers for the dependencies |
| 20 |
python -c "import numpy; print('numpy version: ' + numpy.__version__)" |
| 21 |
python -c "import scipy; print('scipy version: ' + scipy.__version__)" |
| 22 |
python -c "import sympy; print('sympy version: ' + sympy.__version__)" |
| 23 |
python -c "import matplotlib; print('matplotlib version: ' + matplotlib.__version__)" |
| 24 |
|
| 25 |
# Build Brian2 |
| 26 |
python setup.py build --build-lib=build/lib |
| 27 |
|
| 28 |
# Move to the build directory to make sure it is used for testing |
| 29 |
# (important for Python 3) |
| 30 |
cd build/lib |
| 31 |
|
| 32 |
# delete remaining compiled code from previous runs |
| 33 |
echo deleting '~/.python*_compiled' if it exists |
| 34 |
rm -r ~/.python*_compiled || : |
| 35 |
|
| 36 |
# Run unit tests and record coverage but do not fail the build if anything goes wrong here |
| 37 |
coverage erase --rcfile=../../.coveragerc || : |
| 38 |
coverage run --rcfile=../../.coveragerc ~/.jenkins/virtual_envs/$PythonVersion/$packages/bin/nosetests --with-xunit --logging-clear-handlers --verbose --with-doctest brian2 || : |
| 39 |
coverage xml -i --rcfile=../../.coveragerc || : |