How to test Jupyter notebooks on Travis CI?

Jay Wong

Is there a way to deploy Jupyter Notebooks on Travis CI and test running all the cells?

My Jupyter Notebooks use IPython Kernel, and I have a conda environment file.

Jason R. Wang

I've been wondering something similar and have compiled some information but haven't fully tested it yet.

Firstly, you can rely on jupyter nbconvert execute notebooks, where you can then look for errors. There's an example set up with Travis CI and Conda at ghego/travis_anaconda_jupyter. I believe Travis CI relies on pytest too to catch issues, though I'm not entirely sure how this fits together.

Another way you can run this is with pytest-notebook, which relies on you having a working version of the notebooks you want in some environment. This package's main purpose is to detect if changes to the environment will create issues within the notebooks. This can also potentially be used in conjunction with the above method, though it might be redundant.

It might be additionally beneficial for version management (tracking, seeing diffs, legibility) to write your notebooks in markdown format and then use jupytext to convert them into a .ipynb file to then run with the above options. jupytext can also execute notebooks directly with the --execute flag, so perhaps there's an even simpler way to integrate such a workflow!

I will be testing this in the coming weeks and will update this comment if I learn anything new.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to Travis CI and Jupyter Notebooks through Nbsphinx

How To Set Sources For Jupyter Notebooks

How to test Pl/Python PostgreSQL procedures with Travis CI?

How to make Travis CI test package for Linux, OS X, Windows?

How do I integrate travis ci with codeclimate test coverage in Python?

How to get Travis CI to build and test xcode projects hosted on Github?

How to get the current split index of test in Travis-CI?

How to test a project that need keyboard input with travis-ci.org?

How to use different R versions to test packages with Travis-CI?

How to !rm python_var (in Jupyter notebooks)

How to interpret .py files as jupyter notebooks

How to save Jupyter notebooks from GitHub

How to install module in Jupyter Notebooks for iPython

How to wrap code/text in Jupyter notebooks

How to use Jupyter notebooks in a conda environment?

How to programmatically generate markdown output in Jupyter notebooks?

How to open .ipynb pages as normal jupyter notebooks

How to convert Jupyter/IPython notebooks to LaTex?

How to have interactivity of Jupyter Notebooks online?

How to use Github Package in Jupyter Notebooks

how to stop docker automatically launch jupyter notebooks

Mocha test passes locally, but fails on Travis CI

Travis-CI GoLang Examples test error

Usage of environment variable of Travis CI in maven test

Using Travis-CI to test Homebrew tap

Django Selenium test fails sometimes in Travis CI

Travis CI runs only one test

Test docker containers using travis-ci

How to remove caches on Travis CI?