Skip to main content

Pytest plugin for releasing notebooks

Project description

nbmake

Pytest plugin for building notebooks into a tested Jupyterbook

Functionality

  1. Implements pytest plugin API to access the Jupyterbook execution runtime
    1. This enables parallelisation with pytest-xdist
  2. Automates generation of Jupyterbook config and table of contents, or lets you provide your own
  3. Does not interfere with normal jupyter-book usage.

Usage

During Development

pip install pytest nbmake
pytest --nbmake

the output is a Jupyter book in a build directory:

_build/
  html/ # contains jupyter book static site with test results
  jupyter_execute/ # contains jupyter-book ipynbs

this can be viewed locally for debugging

open _build/html/index.html

Example release process

pytest --nbmake
netlify deploy dir=_build/html

Roadmap

Just some ideas:

Test Isolation

Improve virtualisation of individual tests, e.g. to prevent !pip install commands contaminating the test environment.

Pytest Fixture Integration

Make notebooks a first-class pytest citizen by providing a mechanism for enabling pytest fixtures

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbmake-0.0.1.tar.gz (6.9 kB view hashes)

Uploaded Source

Built Distribution

nbmake-0.0.1-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page