Skip to content

Commit 2ef8631

Browse files
committed
adding tox
1 parent 1b03f27 commit 2ef8631

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ global-exclude *.pyc
3232
global-exclude *.pyo
3333
global-exclude .git
3434
global-exclude .ipynb_checkpoints
35+
36+
# Binder files to be excluded
37+
exclude binder
38+
recursive-exclude binder *.ipynb
39+
recursive-exclude binder *.txt

binder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy
22
pandas
3-
scrapbook
3+
nteract-scrapbook
44
nbformat
55
./

binder/run_nbclient.ipynb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@
4545
"# We use nbformat to represent our empty notebook in-memory\n",
4646
"nb = nbf.read('./empty_notebook.ipynb', nbf.NO_CONVERT)\n",
4747
"\n",
48-
"# The Executor class handles execution of the notebook\n",
49-
"executor = nbclient.execute.Executor(nb)\n",
50-
"\n",
51-
"# Update our in-memory notebook, which will now have outputs\n",
52-
"nb = executor.execute()"
48+
"# Execute our in-memory notebook, which will now have outputs\n",
49+
"nb = nbclient.execute(nb)"
5350
]
5451
},
5552
{

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ basepython =
5151
deps = .[dev]
5252
commands =
5353
pytest -vv --maxfail=2 --cov=nbclient -W always {posargs}
54+
55+
# Binder
56+
[testenv:binder]
57+
description = ensure /binder/*ipynb are runnable
58+
deps =
59+
-r binder/requirements.txt
60+
commands = python -c "from glob import glob; from nbclient import execute; import nbformat as nbf; [execute(nbf.read(input, nbf.NO_CONVERT), cwd='./binder') for input in glob('binder/**/*.ipynb')]"

0 commit comments

Comments
 (0)