2011-10-10 02:28:13 +08:00
|
|
|
#!/usr/bin/env python
|
2011-12-09 06:34:22 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
2015-04-11 04:20:40 +08:00
|
|
|
"""Setup script for Jupyter Notebook"""
|
2011-12-09 06:34:22 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2015-04-11 04:20:40 +08:00
|
|
|
# Copyright (c) 2015-, Jupyter Development Team.
|
|
|
|
# Copyright (c) 2008-2015, IPython Development Team.
|
2011-12-09 06:34:22 +08:00
|
|
|
#
|
|
|
|
# Distributed under the terms of the Modified BSD License.
|
|
|
|
#
|
2015-04-11 04:20:40 +08:00
|
|
|
# The full license is in the file COPYING.md, distributed with this software.
|
2011-12-09 06:34:22 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2015-04-11 04:20:40 +08:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2018-01-13 00:09:17 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2015-05-14 01:56:32 +08:00
|
|
|
name = "notebook"
|
2015-04-11 04:20:40 +08:00
|
|
|
|
2011-12-09 06:34:22 +08:00
|
|
|
# Minimal Python version sanity check
|
2014-04-03 02:59:27 +08:00
|
|
|
v = sys.version_info
|
|
|
|
if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
|
2015-04-11 04:20:40 +08:00
|
|
|
error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
|
2013-09-10 02:13:28 +08:00
|
|
|
print(error, file=sys.stderr)
|
|
|
|
sys.exit(1)
|
2011-12-09 06:34:22 +08:00
|
|
|
|
|
|
|
# At least we're on the python version we need, move on.
|
|
|
|
|
|
|
|
# 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')
|
|
|
|
|
2018-01-13 00:09:17 +08:00
|
|
|
from setuptools import setup
|
2011-12-09 06:34:22 +08:00
|
|
|
|
|
|
|
from setupbase import (
|
2015-04-11 04:20:40 +08:00
|
|
|
version,
|
2011-12-09 06:34:22 +08:00
|
|
|
find_packages,
|
|
|
|
find_package_data,
|
2014-02-08 06:12:53 +08:00
|
|
|
check_package_data_first,
|
2013-09-15 03:21:05 +08:00
|
|
|
CompileCSS,
|
2015-05-05 06:51:56 +08:00
|
|
|
CompileJS,
|
2016-12-23 01:44:46 +08:00
|
|
|
Bower,
|
2013-10-26 05:01:31 +08:00
|
|
|
JavascriptVersion,
|
2014-07-24 05:19:27 +08:00
|
|
|
css_js_prerelease,
|
2011-12-09 06:34:22 +08:00
|
|
|
)
|
|
|
|
|
2015-04-11 04:20:40 +08:00
|
|
|
setup_args = dict(
|
|
|
|
name = name,
|
2015-09-09 06:41:33 +08:00
|
|
|
description = "A web-based notebook environment for interactive computing",
|
2015-09-10 07:49:29 +08:00
|
|
|
long_description = """
|
2015-09-23 02:16:06 +08:00
|
|
|
The Jupyter Notebook is a web application that allows you to create and
|
|
|
|
share documents that contain live code, equations, visualizations, and
|
|
|
|
explanatory text. The Notebook has support for multiple programming
|
|
|
|
languages, sharing, and interactive widgets.
|
2015-09-10 07:49:29 +08:00
|
|
|
|
2016-10-10 04:56:18 +08:00
|
|
|
Read `the documentation <https://jupyter-notebook.readthedocs.io>`_
|
2015-09-23 02:16:06 +08:00
|
|
|
for more information.
|
2015-09-10 07:49:29 +08:00
|
|
|
""",
|
2015-04-11 04:20:40 +08:00
|
|
|
version = version,
|
|
|
|
packages = find_packages(),
|
2016-06-11 04:57:55 +08:00
|
|
|
package_data = find_package_data(),
|
2015-04-11 04:20:40 +08:00
|
|
|
author = 'Jupyter Development Team',
|
|
|
|
author_email = 'jupyter@googlegroups.com',
|
|
|
|
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',
|
|
|
|
],
|
2018-01-13 00:09:17 +08:00
|
|
|
zip_safe = False,
|
|
|
|
install_requires = [
|
|
|
|
'jinja2',
|
|
|
|
'tornado>=4',
|
|
|
|
'ipython_genutils',
|
|
|
|
'traitlets>=4.2.1',
|
|
|
|
'jupyter_core>=4.4.0',
|
|
|
|
'jupyter_client>=5.2.0',
|
|
|
|
'nbformat',
|
|
|
|
'nbconvert',
|
|
|
|
'ipykernel', # bless IPython kernel for now
|
|
|
|
'Send2Trash',
|
|
|
|
'terminado>=0.8.1'
|
|
|
|
],
|
|
|
|
extras_require = {
|
|
|
|
'test:python_version == "2.7"': ['mock'],
|
2018-02-14 01:01:00 +08:00
|
|
|
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters',
|
|
|
|
'nbval', 'nose-exclude'],
|
2018-01-13 00:09:17 +08:00
|
|
|
'test:sys_platform == "win32"': ['nose-exclude'],
|
|
|
|
},
|
|
|
|
entry_points = {
|
|
|
|
'console_scripts': [
|
|
|
|
'jupyter-notebook = notebook.notebookapp:main',
|
|
|
|
'jupyter-nbextension = notebook.nbextensions:main',
|
|
|
|
'jupyter-serverextension = notebook.serverextensions:main',
|
|
|
|
'jupyter-bundlerextension = notebook.bundler.bundlerextensions:main',
|
|
|
|
]
|
|
|
|
},
|
2015-04-11 04:20:40 +08:00
|
|
|
)
|
2011-12-09 06:34:22 +08:00
|
|
|
|
2018-01-13 00:09:17 +08:00
|
|
|
# Custom distutils/setuptools commands ----------
|
2015-04-11 04:20:40 +08:00
|
|
|
from distutils.command.build_py import build_py
|
2012-07-01 06:17:46 +08:00
|
|
|
from distutils.command.sdist import sdist
|
2018-01-13 00:09:17 +08:00
|
|
|
from setuptools.command.bdist_egg import bdist_egg
|
|
|
|
from setuptools.command.develop import develop
|
|
|
|
|
|
|
|
class bdist_egg_disabled(bdist_egg):
|
|
|
|
"""Disabled version of bdist_egg
|
2015-04-11 04:20:40 +08:00
|
|
|
|
2018-01-13 00:09:17 +08:00
|
|
|
Prevents setup.py install from performing setuptools' default easy_install,
|
|
|
|
which it should never ever do.
|
|
|
|
"""
|
|
|
|
def run(self):
|
|
|
|
sys.exit("Aborting implicit building of eggs. Use `pip install .` to install from source.")
|
2012-07-01 04:41:30 +08:00
|
|
|
|
2012-07-01 06:17:46 +08:00
|
|
|
setup_args['cmdclass'] = {
|
2014-07-24 06:33:08 +08:00
|
|
|
'build_py': css_js_prerelease(
|
2015-04-11 04:20:40 +08:00
|
|
|
check_package_data_first(build_py)),
|
2015-05-05 06:51:56 +08:00
|
|
|
'sdist' : css_js_prerelease(sdist, strict=True),
|
2018-01-13 00:09:17 +08:00
|
|
|
'develop': css_js_prerelease(develop),
|
2013-09-15 03:21:05 +08:00
|
|
|
'css' : CompileCSS,
|
2015-05-05 06:51:56 +08:00
|
|
|
'js' : CompileJS,
|
2016-12-23 01:44:46 +08:00
|
|
|
'jsdeps' : Bower,
|
2013-10-26 05:01:31 +08:00
|
|
|
'jsversion' : JavascriptVersion,
|
2018-01-13 00:09:17 +08:00
|
|
|
'bdist_egg': bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled,
|
2012-07-01 06:17:46 +08:00
|
|
|
}
|
2012-07-01 04:41:30 +08:00
|
|
|
|
2018-01-13 00:09:17 +08:00
|
|
|
try:
|
|
|
|
from wheel.bdist_wheel import bdist_wheel
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
setup_args['cmdclass']['bdist_wheel'] = css_js_prerelease(bdist_wheel)
|
2015-04-01 03:00:56 +08:00
|
|
|
|
2018-01-13 00:09:17 +08:00
|
|
|
# Run setup --------------------
|
2011-12-09 06:34:22 +08:00
|
|
|
def main():
|
|
|
|
setup(**setup_args)
|
2010-01-13 13:03:16 +08:00
|
|
|
|
2011-12-09 06:34:22 +08:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|