diff --git a/.gitignore b/.gitignore index a003eda10b9827f972a29ecccbe9b67c3cfa7de1..0bd7dd9df4747b57843832bc5e9a81187eac3e97 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,9 @@ target/ # Jupyter Notebook .ipynb_checkpoints +# Jupyter Notebooks converted to python +notebooks/*.py + # PyCharm .idea/ diff --git a/examples/simple_example_1.py b/examples-not-running/simple_example_1.py similarity index 100% rename from examples/simple_example_1.py rename to examples-not-running/simple_example_1.py diff --git a/examples/simple_example_2.py b/examples-not-running/simple_example_2.py similarity index 100% rename from examples/simple_example_2.py rename to examples-not-running/simple_example_2.py diff --git a/examples/simple_example_3.py b/examples-not-running/simple_example_3.py similarity index 100% rename from examples/simple_example_3.py rename to examples-not-running/simple_example_3.py diff --git a/requirements_continuous_integration.txt b/requirements_continuous_integration.txt index 23b4aec3351fd5effbbf8dbd1b638a20cd0319ec..af81f6733fd4be6c15d37af050824fd496cb3a52 100644 --- a/requirements_continuous_integration.txt +++ b/requirements_continuous_integration.txt @@ -1,16 +1,15 @@ -# 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 wheel==0.32.1 watchdog==0.9.0 benchmarker==4.0.1 coverage==4.5.1 Sphinx==1.8.1 +sphinx-rtd-theme==0.4.3 flake8==3.7.7 flake8-eradicate==0.2.0 - - 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 +jupyter==1.0.0 +git+https://github.com/who8mylunch/Jupyter_Canvas_Widget.git@bd151ae1509c50b5809944dd3294f58b7b069c86 + diff --git a/requirements_dev.txt b/requirements_dev.txt index 6fd16dd56ec083a3e7ca9ae4bdfef74de558e6b6..28ed09e6321ec0f9711d8784b97f06bfe87fb2b5 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -9,7 +9,7 @@ recordtype==1.3 xarray==0.11.3 matplotlib==3.0.2 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 msgpack==0.6.1 svgutils==0.3.1 diff --git a/setup.py b/setup.py index e1a84fd454a57a70f0db43f1445e6db5ea6dd934..d517c279cb5d31a09174b71419b3615160abc39a 100644 --- a/setup.py +++ b/setup.py @@ -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 diff --git a/tox.ini b/tox.ini index 1c6a3d45b2ba71dc04d0adb04a1a71b961f38dec..c5a1ce1bff9934563a9ffec0573d8a66b2c91cc5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36, py37, flake8, 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} @@ -62,6 +62,46 @@ deps = commands = 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] whitelist_externals = sh pip @@ -77,5 +117,3 @@ deps = commands = sh -c 'echo DISPLAY: $DISPLAY' py.test --basetemp={envtmpdir} - -