forked from jupyter/nbdime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
156 lines (129 loc) · 4.35 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import io
import os
import sys
from glob import glob
from setuptools import setup, find_packages
from setupbase import (create_cmdclass, install_npm, ensure_targets,
combine_commands, ensure_python, get_version)
pjoin = os.path.join
here = os.path.abspath(os.path.dirname(__file__))
# Minimal Python version sanity check
ensure_python(('>=2.7', '>=3.4'))
# the name of the project
name = 'nbdime'
version = get_version(pjoin(name, '_version.py'))
# Representative files that should exist after a successful build
jstargets = [
os.path.join(here, name, 'webapp', 'static', 'nbdime.js'),
]
package_data = {
name: [
'tests/files/*.*',
'tests/filters/*.py',
'*.schema.json',
'webapp/static/*.*',
'webapp/templates/*.*',
'webapp/testnotebooks/*.*',
'notebook_ext/*.*',
]
}
data_spec = [
('share/jupyter/nbextensions/nbdime', name + '/notebook_ext', '*.js'),
]
cmdclass = create_cmdclass('js', data_files_spec=data_spec)
cmdclass['js'] = combine_commands(
install_npm(here),
ensure_targets(jstargets),
)
setup_args = dict(
name = name,
description = "Diff and merge of Jupyter Notebooks",
version = version,
scripts = glob(pjoin('scripts', '*')),
cmdclass = cmdclass,
packages = find_packages(here),
package_data = package_data,
author = 'Jupyter Development Team',
author_email = '[email protected]',
url = 'http://jupyter.org',
license = 'BSD',
platforms = "Linux, Mac OS X, Windows",
keywords = ['Interactive', 'Interpreter', 'Shell', 'Web'],
classifiers = [
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Framework :: Jupyter',
],
)
setuptools_args = {}
install_requires = setuptools_args['install_requires'] = [
'nbformat',
'six',
'colorama',
'tornado',
'requests',
'GitPython!=2.1.4, !=2.1.5, !=2.1.6', # For difftool taking git refs
'notebook',
'jinja2>=2.9',
]
extras_require = setuptools_args['extras_require'] = {
'test': [
'pytest>=3.3',
'pytest-cov',
'pytest-timeout',
'pytest-tornado5',
'jsonschema',
'mock',
'requests',
'tabulate', # For profiling
],
'docs': [
'sphinx',
'recommonmark',
'sphinx_rtd_theme'
],
':python_version == "2.7"': [
'backports.shutil_which',
'backports.functools_lru_cache',
],
}
setuptools_args['python_requires'] = '>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*'
if 'setuptools' in sys.modules:
setup_args.update(setuptools_args)
# force entrypoints with setuptools (needed for Windows, unconditional because of wheels)
setup_args['entry_points'] = {
'console_scripts': [
'nbdime = nbdime.__main__:main_dispatch',
'nbshow = nbdime.nbshowapp:main',
'nbdiff = nbdime.nbdiffapp:main',
'nbdiff-web = nbdime.webapp.nbdiffweb:main',
'nbmerge = nbdime.nbmergeapp:main',
'nbmerge-web = nbdime.webapp.nbmergeweb:main',
'git-nbdiffdriver = nbdime.vcs.git.diffdriver:main',
'git-nbdifftool = nbdime.vcs.git.difftool:main',
'git-nbmergedriver = nbdime.vcs.git.mergedriver:main',
'git-nbmergetool = nbdime.vcs.git.mergetool:main',
'hg-nbdiff = nbdime.vcs.hg.diff:main',
'hg-nbdiffweb = nbdime.vcs.hg.diffweb:main',
'hg-nbmerge = nbdime.vcs.hg.merge:main',
'hg-nbmergeweb = nbdime.vcs.hg.mergeweb:main',
]
}
setup_args.pop('scripts', None)
setup_args.update(setuptools_args)
if __name__ == '__main__':
setup(**setup_args)