-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
134 lines (108 loc) · 3.32 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from setuptools import setup
long_description = """run\_ipynbs
===========
Run non-interactively ipython notebook files. Strongly inspired from
https://gist.github.com/minrk/2620876.
Features
--------
- run several notebooks
- reporte failed cells and display error (traceback)
- display cell output in live !
Easy installation
-----------------
Copy paste run\_ipynbs.py to your system and execute it.
Or with pip : ``pip install run_ipynbs``
Usage
-----
::
$ ./run_ipynbs.py --help
2013-12-12 13:27:24:INFO: Use standard KernelManager
usage: run_ipynbs.py [-h] [--output] ipynbs [ipynbs ...]
positional arguments:
ipynbs Ipynb files you want to run
optional arguments:
-h, --help show this help message and exit
--output, -o Display cells output while they run
Execute a notebook without output :
::
$ ./run_ipynbs.py test.ipynb
2013-12-12 13:27:53:INFO: Use standard KernelManager
2013-12-12 13:27:53:INFO: Running test.ipynb
2013-12-12 13:27:55:INFO: Run cell #0
2013-12-12 13:27:55:INFO: Done
2013-12-12 13:27:55:INFO: Run cell #1
2013-12-12 13:27:55:ERROR: Fail to execute cell #2
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-43a14fcd4265> in <module>()
----> 1 print(hello)
NameError: name 'hello' is not defined
2013-12-12 13:27:55:INFO: Run cell #2
2013-12-12 13:27:55:INFO: Done
2013-12-12 13:27:55:INFO: Run cell #3
2013-12-12 13:27:59:INFO: Done
2013-12-12 13:27:59:INFO: 4 cells runned with 1 cells failed
Execute a notebook with live output :
::
$ ./run_ipynbs.py test.ipynb -l
2013-12-12 13:28:40:INFO: Use standard KernelManager
2013-12-12 13:28:40:INFO: Running test.ipynb
2013-12-12 13:28:42:INFO: Run cell #0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2013-12-12 13:28:42:INFO: Done
2013-12-12 13:28:42:INFO: Run cell #1
2013-12-12 13:28:42:ERROR: Fail to execute cell #2
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-43a14fcd4265> in <module>()
----> 1 print(hello)
NameError: name 'hello' is not defined
2013-12-12 13:28:42:INFO: Run cell #2
Hello !
2013-12-12 13:28:43:INFO: Done
2013-12-12 13:28:43:INFO: Run cell #3
I'm gonna sleep 3s
I wake up now :-D
2013-12-12 13:28:46:INFO: Done
2013-12-12 13:28:46:INFO: 4 cells runned with 1 cells failed"""
setup(name='run_ipynbs',
version='1.2',
license='GPLv3',
description='Run non-interactively ipython notebook files',
long_description=long_description,
keywords='ipython, notebooks, non-interactive, console',
url='https://github.com/hadim/run_ipynbs',
author='Hadrien Mary',
author_email='hadrien.mary@gmail.com',
classifiers=[
'Framework :: IPython',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
],
install_requires=[
'ipython',
'pyzmq',
],
scripts=[
'run_ipynbs.py'
]
)