-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
39 lines (33 loc) · 1.28 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
#!/usr/bin/env python
from setuptools import setup, find_packages
import os
import sys
import shutil
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
HERE = os.path.abspath(os.path.dirname(__file__))
BASE = os.path.join(HERE, 'nbextension')
VERSION_NS = {}
with open(os.path.join(BASE, 'lc_notebook_diff', '_version.py')) as f:
exec(f.read(), {}, VERSION_NS)
for ext in ['.css', '.js']:
shutil.copy(os.path.join(HERE, 'html', 'jupyter-notebook-diff' + ext),
os.path.join(BASE, 'lc_notebook_diff', 'nbextension'))
with open(os.path.join(BASE, 'lc_notebook_diff', 'nbextension', 'diff_match_patch.js'), 'wb') as f:
f.write(urlopen('https://github.com/google/diff-match-patch/raw/master/javascript/diff_match_patch.js').read())
setup_args = dict (name='lc-notebook-diff',
version=VERSION_NS['__version__'],
description='LC notebook diff extension',
packages=['lc_notebook_diff'],
package_dir={'lc_notebook_diff': 'nbextension/lc_notebook_diff'},
include_package_data=True,
platforms=['Jupyter Notebook 4.2.x', 'Jupyter Notebook 5.x', 'Jupyter Notebook 6.x'],
zip_safe=False,
install_requires=[
'notebook>=4.2.0',
]
)
if __name__ == '__main__':
setup(**setup_args)