Skip to content
Snippets Groups Projects
Commit df9a6f36 authored by Christian Eichenberger's avatar Christian Eichenberger :badminton:
Browse files

Merge branch '51-run-examples-in-ci-including-notebooks' into 'master'

Resolve "run examples in ci as integration tests, preferably with assertions"

Closes #51

See merge request flatland/flatland!54
parents 735c8624 48d8f126
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,9 @@ target/ ...@@ -71,6 +71,9 @@ target/
# Jupyter Notebook # Jupyter Notebook
.ipynb_checkpoints .ipynb_checkpoints
# Jupyter Notebooks converted to python
notebooks/*.py
# PyCharm # PyCharm
.idea/ .idea/
......
# contains all additional requirements to run the ```tox .``` in addition to requirements_dev.txt for ```tox -e py37,py37``` # contains all additional requirements to run the ```tox .``` in addition to requirements_dev.txt for ```tox -e py36,py37```
bumpversion==0.5.3 bumpversion==0.5.3
wheel==0.32.1 wheel==0.32.1
watchdog==0.9.0 watchdog==0.9.0
benchmarker==4.0.1 benchmarker==4.0.1
coverage==4.5.1 coverage==4.5.1
Sphinx==1.8.1 Sphinx==1.8.1
sphinx-rtd-theme==0.4.3
flake8==3.7.7 flake8==3.7.7
flake8-eradicate==0.2.0 flake8-eradicate==0.2.0
twine==1.12.1 twine==1.12.1
sphinx-rtd-theme==0.4.3
# see setup.py pycairo==1.18.1
CairoSVG==2.3.1
pydeps==1.7.2 pydeps==1.7.2
jupyter==1.0.0
git+https://github.com/who8mylunch/Jupyter_Canvas_Widget.git@bd151ae1509c50b5809944dd3294f58b7b069c86
...@@ -9,7 +9,7 @@ recordtype==1.3 ...@@ -9,7 +9,7 @@ recordtype==1.3
xarray==0.11.3 xarray==0.11.3
matplotlib==3.0.2 matplotlib==3.0.2
Pillow==5.4.1 Pillow==5.4.1
# see setup.py pycairo==1.18.1 # pycairo==1.18.1 is installed via setup.py since it needs special treatment under Windows
CairoSVG==2.3.1 CairoSVG==2.3.1
msgpack==0.6.1 msgpack==0.6.1
svgutils==0.3.1 svgutils==0.3.1
......
...@@ -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, 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}
...@@ -62,6 +62,46 @@ deps = ...@@ -62,6 +62,46 @@ deps =
commands = commands =
sh -c 'ls benchmarks/*.py | xargs -n 1 python' sh -c 'ls benchmarks/*.py | xargs -n 1 python'
[testenv:examples]
basepython = python
setenv =
PYTHONPATH = {toxinidir}
passenv =
DISPLAY
XAUTHORITY
; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies
HTTP_PROXY
HTTPS_PROXY
whitelist_externals = sh
deps =
-r{toxinidir}/requirements_dev.txt
commands =
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
setenv =
PYTHONPATH = {toxinidir}
passenv =
DISPLAY
XAUTHORITY
; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies
HTTP_PROXY
HTTPS_PROXY
whitelist_externals = sh
deps =
-r{toxinidir}/requirements_dev.txt
-r{toxinidir}/requirements_continuous_integration.txt
commands =
sh -c 'jupyter nbextension enable --py --sys-prefix widgetsnbextension'
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 -I{} -n 1 sh -c "echo -e \"\n====== Running {} ========\n\"; ipython {}"'
[testenv] [testenv]
whitelist_externals = sh whitelist_externals = sh
pip pip
...@@ -77,5 +117,3 @@ deps = ...@@ -77,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