Skip to content
Snippets Groups Projects
Commit 48d8f126 authored by u214892's avatar u214892
Browse files

#51 run examples and notebooks in ci

parent f436c714
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ if os.name == 'nt':
try:
import pycairo
except:
call_cmd = "pip install --user " + url
call_cmd = "pip install " + url
os.system(call_cmd)
import site
......
[tox]
envlist = py36, py37, flake8, examples, docs, coverage, benchmark, sh
envlist = py36, py37, examples, notebooks, flake8, docs, coverage, benchmarks
[travis]
python =
......@@ -46,7 +46,7 @@ deps =
commands =
make coverage
[testenv:benchmark]
[testenv:benchmarks]
basepython = python
setenv =
PYTHONPATH = {toxinidir}
......@@ -68,6 +68,7 @@ setenv =
PYTHONPATH = {toxinidir}
passenv =
DISPLAY
XAUTHORITY
; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies
HTTP_PROXY
HTTPS_PROXY
......@@ -75,7 +76,10 @@ whitelist_externals = sh
deps =
-r{toxinidir}/requirements_dev.txt
commands =
sh -c 'ls examples/*.py | xargs -n 1 python'
sh -c 'echo DISPLAY=$DISPLAY'
sh -c 'echo XAUTHORITY=$XAUTHORITY'
; pipe echo into python since some examples expect input to close the window after the example is run
sh -c 'ls examples/*.py | xargs -I{} -n 1 sh -c "echo -e \"\n====== Running {} ========\n\"; echo | python {}"'
[testenv:notebooks]
basepython = python
......@@ -83,6 +87,7 @@ setenv =
PYTHONPATH = {toxinidir}
passenv =
DISPLAY
XAUTHORITY
; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies
HTTP_PROXY
HTTPS_PROXY
......@@ -95,7 +100,7 @@ commands =
sh -c 'jupyter nbextension enable --py --sys-prefix jpy_canvas'
; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463
sh -c 'ls notebooks/*.ipynb | xargs -n 1 jupyter nbconvert --to python'
sh -c 'ls notebooks/*.py | xargs -n 1 ipython'
sh -c 'ls notebooks/*.py | xargs -I{} -n 1 sh -c "echo -e \"\n====== Running {} ========\n\"; ipython {}"'
[testenv]
whitelist_externals = sh
......@@ -112,5 +117,3 @@ deps =
commands =
sh -c 'echo DISPLAY: $DISPLAY'
py.test --basetemp={envtmpdir}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment