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': ...@@ -39,7 +39,7 @@ if os.name == 'nt':
try: try:
import pycairo import pycairo
except: except:
call_cmd = "pip install --user " + url call_cmd = "pip install " + url
os.system(call_cmd) os.system(call_cmd)
import site import site
......
[tox] [tox]
envlist = py36, py37, flake8, examples, docs, coverage, benchmark, sh envlist = py36, py37, examples, notebooks, flake8, docs, coverage, benchmarks
[travis] [travis]
python = python =
...@@ -46,7 +46,7 @@ deps = ...@@ -46,7 +46,7 @@ deps =
commands = commands =
make coverage make coverage
[testenv:benchmark] [testenv:benchmarks]
basepython = python basepython = python
setenv = setenv =
PYTHONPATH = {toxinidir} PYTHONPATH = {toxinidir}
...@@ -68,6 +68,7 @@ setenv = ...@@ -68,6 +68,7 @@ setenv =
PYTHONPATH = {toxinidir} PYTHONPATH = {toxinidir}
passenv = passenv =
DISPLAY DISPLAY
XAUTHORITY
; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies ; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies
HTTP_PROXY HTTP_PROXY
HTTPS_PROXY HTTPS_PROXY
...@@ -75,7 +76,10 @@ whitelist_externals = sh ...@@ -75,7 +76,10 @@ whitelist_externals = sh
deps = deps =
-r{toxinidir}/requirements_dev.txt -r{toxinidir}/requirements_dev.txt
commands = 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] [testenv:notebooks]
basepython = python basepython = python
...@@ -83,6 +87,7 @@ setenv = ...@@ -83,6 +87,7 @@ setenv =
PYTHONPATH = {toxinidir} PYTHONPATH = {toxinidir}
passenv = passenv =
DISPLAY DISPLAY
XAUTHORITY
; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies ; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies
HTTP_PROXY HTTP_PROXY
HTTPS_PROXY HTTPS_PROXY
...@@ -95,7 +100,7 @@ commands = ...@@ -95,7 +100,7 @@ commands =
sh -c 'jupyter nbextension enable --py --sys-prefix jpy_canvas' 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 ; 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/*.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] [testenv]
whitelist_externals = sh whitelist_externals = sh
...@@ -112,5 +117,3 @@ deps = ...@@ -112,5 +117,3 @@ deps =
commands = commands =
sh -c 'echo DISPLAY: $DISPLAY' sh -c 'echo DISPLAY: $DISPLAY'
py.test --basetemp={envtmpdir} 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