forked from pyvista/pyvista
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
114 lines (102 loc) · 3.63 KB
/
.travis.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
sudo: required
dist: xenial
os:
- linux
language: python
python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'
addons:
apt:
packages:
- xvfb
env:
global:
# Doctr deploy key for vtkiorg/vtki
- secure: "NHUV04B//rkOUxfBd5Bk3QN3g/iQ91wdRZowNTwCIPAbznFez2mbwQcsULDeZk7blPsv1xEAnqy/T/nPyYZuHO9qU2/OElvxKspaKgcGZ9Ig/czmjrO7Y5VnU2KOZJNwBLgb6mEpDvkKoI2j9WhhcTuPcDbayk6ntXz03snYRUsn2nwHfvqDmIqMQnqSwgVejPJQxBsQSikzYzkTYT9P/z94VoSTp4UrvDVj2Tygrw4PnSGe/9x6qTolo3Ofd+REt4LBth6/lBX2OrBhHwnp9wWpEX1o98HOdf5ZUHI9v8gZacnncVXNlNu1biBlQR58bXZX/4RqRdM2No6NcszC8CbhAS+UhNdsPlbimt9L60s4MWwq+IaxCOA2/lzLVdFl8p5wDjz+DDZsdVMNyjhO3MBP5Am/4qJ0BsQEQ2vtZMF3Jvil9oiSSWcp7IGYsj3aPqEcKFm5uc2SwU1CXg4uBfgDsowqBi0t5/1rWqsJQ6p+6ZlU2NoN4ppNjuenAYyDla49J6I7wLp6Z3GwHuupE75WncVhL5BY5aYRcTDrkKuRx8nFIMe+Xuzp6NKmWaDxIwoztA0VPZ9FtMYiM5ahvHwSnZ8wIxUngjMHPuE7+e6KkCBcLt/e7DlzBQhi4kPJesbzw3NX/VmYkAoZsK5tkwKBZakKIKudpjzW73DxGE8="
before_script: # configure a headless display to test plot generation
- export DISPLAY=:99.0
- which Xvfb
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# - ls -l /etc/init.d/
# - sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
install:
- pip install -r requirements.txt
- pip install -r requirements_docs.txt
- pip install pytest-cov
- pip install codecov
- |
if [[ $TRAVIS_PYTHON_VERSION != 2.7 ]]; then
pip install -r requirements_test.txt
pip install -U doctr
pip install cookiecutter
fi
- pip install -e .
- which python
- python -c "import vtk; print(vtk.VTK_VERSION)"
- python -c "import imageio; imageio.plugins.ffmpeg.download()"
- pip list
script:
# Run the test suite and generate coverage report
- pytest -v --cov vtki
# Run all code examples in the docstrings
- pytest -v --doctest-modules vtki
- | # report code coverage
if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then
codecov
fi
# Now make sure notebooks are running
# TODO: add below: pytest -v --nbval-lax --current-env --disable-warnings tests/*.ipynb;
- |
if [[ $TRAVIS_PYTHON_VERSION != 2.7 ]]; then
pytest -v --nbval-lax --current-env --disable-warnings notebooks/*.ipynb;
fi
# And test the documentation
- cd ./docs/
# Add environmental varaible for offscreen plotting after pytest executes
- export VTKI_OFFSCREEN=True
# Do not run doc testing on python 2.7
# Run `make html` before `make doctest` to avoid segfault.
# Then rerun `make html` to use updated figures from `make doctest`
- |
if [[ $TRAVIS_PYTHON_VERSION != 2.7 ]]; then
set -e;
make html;
make doctest;
make html;
fi
- cd ..
- |
if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then
doctr deploy --built-docs ./docs/_build/html .;
cookiecutter -f --no-input --config-file vtki-binder-config.yml -o .. https://github.com/vtkiorg/cookiecutter-vtki-binder.git;
rm -rf ../vtki-examples/notebooks/;
cd ./docs/;
find ./examples -type f -name '*.ipynb' | cpio -p -d -v ../../vtki-examples/;
cd ../../vtki-examples/;
git init;
git add .;
git commit -m "Autogenerated notebooks from Travis";
REMOTE="https://${GH_TOKEN}@github.com/vtkiorg/vtki-examples";
git config --global user.name "${GH_NAME}";
git config --global user.email "${GH_EMAIL}";
git remote add origin ${REMOTE};
git push -uf origin master;
cd ../vtki/
fi
cache:
directories:
- "$HOME/.cache/pip"
deploy:
- provider: pypi
user: akaszynski
distributions: sdist
on:
condition: "$TRAVIS_PYTHON_VERSION == 3.6"
tags: true
password: $PYPI_PASSWORD
notifications:
email: false