Unverified Commit dbe977e4 authored by Simon Bowly's avatar Simon Bowly
Browse files

Freeze requirements, fix test script.

parent a0cef143
""" Run notebook tests in a clean environment using requirements.txt. """
import nox
@nox.session(python=["3.9"], reuse_venv=True)
def nbtest(session):
session.install("-r", "requirements.txt")
session.run("bash", "test.sh", ".", external=True)
session.run("bash", "test.sh", "Machine-Learning", "Pandas-DataFrames", "Python-Jupyter", "Visualisation", external=True)
#!/bin/bash
# Try executing all notebooks and converting to html. Catches formatting and
# execution errors. Note that notebooks which intentionally have error cells
# won't make the 'ok' list. Run this using 'nox' to get the environment right.
# Find failures after the run using
#
# diff <(sort ok.lst) <(sort tested.lst) | egrep "^>"
#
rm -f tested.lst
git ls-files $1 | grep ipynb | xargs -I {} sh -c 'echo {} >> tested.lst; if jupyter nbconvert --to html --execute {}; then echo {}; fi' > ok.lst
git ls-files $@ | grep ipynb | xargs -I {} sh -c 'echo {} >> tested.lst; if jupyter nbconvert --to html --execute {}; then echo {}; fi' > ok.lst
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment