forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
140 lines (111 loc) · 4.11 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
#!/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
#-----------------------------------------------------------------------------
# Minimal Python version sanity check
#-----------------------------------------------------------------------------
import sys
v = sys.version_info
if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
print(error, file=sys.stderr)
sys.exit(1)
PY3 = (sys.version_info[0] >= 3)
#-----------------------------------------------------------------------------
# get on with it
#-----------------------------------------------------------------------------
from distutils import log
import json
import os
from glob import glob
from distutils.command.build_ext import build_ext
from setuptools.command.sdist import sdist
from setuptools import setup
from setuptools.command.bdist_egg import bdist_egg
# Our own imports
from setupbase import (
bdist_egg_disabled,
find_packages,
find_package_data,
js_prerelease,
CheckAssets,
version_ns,
name
)
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
here = os.path.dirname(os.path.abspath(__file__))
pjoin = os.path.join
DESCRIPTION = 'An alpha preview of the JupyterLab notebook server extension.'
LONG_DESCRIPTION = 'This is an alpha preview of JupyterLab. It is not ready for general usage yet. Development happens on https://github.com/jupyter/jupyterlab, with chat on https://gitter.im/jupyter/jupyterlab.'
setup_args = dict(
name = name,
description = DESCRIPTION,
long_description = LONG_DESCRIPTION,
version = version_ns['__version__'],
scripts = glob(pjoin('scripts', '*')),
packages = find_packages(),
package_data = find_package_data(),
author = 'Jupyter Development Team',
author_email = '[email protected]',
url = 'http://jupyter.org',
license = 'BSD',
platforms = "Linux, Mac OS X, Windows",
keywords = ['ipython', 'jupyter', 'Web'],
classifiers = [
'Development Status :: 3 - Alpha',
'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',
],
)
cmdclass = dict(
build_ext = build_ext,
sdist = js_prerelease(sdist, strict=True),
bdist_egg = bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled,
jsdeps = CheckAssets
)
try:
from wheel.bdist_wheel import bdist_wheel
cmdclass['bdist_wheel'] = js_prerelease(bdist_wheel, strict=True)
except ImportError:
pass
setup_args['cmdclass'] = cmdclass
setuptools_args = {}
install_requires = setuptools_args['install_requires'] = [
'notebook>=4.3.1',
'jupyterlab_launcher>=0.3.0'
]
extras_require = setuptools_args['extras_require'] = {
'test:python_version == "2.7"': ['mock'],
'test': ['pytest'],
'docs': [
'sphinx',
'recommonmark',
'sphinx_rtd_theme'
],
}
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': [
'jupyter-lab = jupyterlab.labapp:main',
'jupyter-labextension = jupyterlab.labextensions:main',
'jupyter-labhub = jupyterlab.labhubapp:main'
]
}
setup_args.pop('scripts', None)
setup_args.update(setuptools_args)
if __name__ == '__main__':
setup(**setup_args)