forked from open-atmos/PyMPDATA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
91 lines (86 loc) · 3.59 KB
/
.travis.yml
File metadata and controls
91 lines (86 loc) · 3.59 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
language: python
os: linux
jobs:
include:
- name: "Linux, Python 3.8-dev, OpenMPI, newest packages, tests"
python: "3.8-dev"
dist: focal
before_install:
- sudo `which pip` install --upgrade pip
- pip install numpy
#- pip install --pre git+https://github.com/numba/numba.git
#- sed -i '/numba/d' requirements.txt
before_script:
- pip install -U $(cat requirements.txt | awk -F '==|>=' {'print $1'})
- export NUMBA_THREADING_LAYER=omp
- python -m numba -s
- python -c 'import numba; assert numba.get_num_threads() > 1 and numba.threading_layer() != "workqueue"'
env: MPI=openmpi
- name: "Linux, Python 3.8, OpenMPI, required packages, tests and codecov"
python: 3.8
env: CODECOV=TRUE MPI=openmpi
- name: "Linux, Python 3.8, MPICH, required packages, tests"
python: 3.8
env: MPI=mpich
- name: "Linux, Python 3.8, no MPI, required packages, examples"
python: 3.8
env: EXAMPLES=TRUE MPI=none
- name: "OSX, Python 3.8, OpenMPI, required packages, tests"
language: shell
os: osx
before_install:
- export PY_SFX=3
- export HOMEBREW_NO_INSTALL_CLEANUP=1
- export HOMEBREW_NO_AUTO_UPDATE=1
- name: "Windows, Python 3.8, MS-MPI, required packages, tests"
language: shell
os: windows
before_install:
- choco install python --version 3.8.2
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH
install:
- |
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
export apt_get_install="sudo apt-get install --no-install-recommends"
if [[ $MPI == 'none' ]]; then sed -i '/mpi4py/d' requirements.txt; fi
if [[ $MPI == 'mpich' ]]; then $apt_get_install mpich libmpich-dev; fi
if [[ $MPI == 'openmpi' ]]; then $apt_get_install openmpi-bin libopenmpi-dev; fi
$apt_get_install ffmpeg
fi;
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install open-mpi; fi
- |
if [[ $TRAVIS_OS_NAME == 'windows' ]]; then
WEB_ADDRESS=https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1
curl -L $WEB_ADDRESS/msmpisetup.exe -o msmpisetup.exe
curl -L $WEB_ADDRESS/msmpisdk.msi -o msmpisdk.msi
./msmpisetup.exe
msiexec //i msmpisdk.msi
export PATH=/c/Program\ Files/Microsoft\ MPI/bin:$PATH
fi;
- pip$PY_SFX install -U ipykernel pytest pytest-cov pytest-benchmark codecov nbconvert jupyter_client
- pip$PY_SFX install -U -r requirements.txt
script:
- python$PY_SFX -m numba -s
- |
if [[ $EXAMPLES == 'TRUE' ]]; then
python$PY_SFX -m ipykernel install --user
for i in PyMPDATA_examples/*/demo*.ipynb; do
jupyter nbconvert --to markdown --stdout $i > $i.md.repo;
travis_wait 30 jupyter nbconvert --ExecutePreprocessor.timeout=1800 --to markdown --execute --stdout $i || exit 1;
# TEMPORARILY disabled before we find a solution for generated graphics causing diffs to differ
# jupyter nbconvert --ExecutePreprocessor.timeout=1800 --to markdown --execute --stdout $i > $i.md.travis || exit 1;
# diff $i.md.repo $i.md.travis
done;
else
if [[ $CODECOV == 'TRUE' ]]; then
python$PY_SFX -m pytest -k "not test_mpi" --cov-report term --cov=PyMPDATA PyMPDATA_tests || exit 1;
else
python$PY_SFX -m pytest PyMPDATA_tests -k "not test_mpi" || exit 1;
fi;
mpiexec $([ "$MPI" == 'openmpi' ] && echo "--oversubscribe") -n 2 python$PY_SFX -m pytest -k "test_mpi" PyMPDATA_tests || exit 1;
fi;
after_success:
- |
if [[ $CODECOV == 'TRUE' ]]; then
codecov || exit 1;
fi;