|
28 | 28 | #-----------------------------------------------------------------------------
|
29 | 29 |
|
30 | 30 | import os
|
31 |
| -from glob import glob |
32 | 31 |
|
33 |
| -from distutils.core import setup |
| 32 | +from setuptools import setup |
34 | 33 |
|
35 | 34 | pjoin = os.path.join
|
36 | 35 | here = os.path.abspath(os.path.dirname(__file__))
|
|
45 | 44 | with open(pjoin(here, name, '_version.py')) as f:
|
46 | 45 | exec(f.read(), {}, version_ns)
|
47 | 46 |
|
| 47 | +from setuptools.command.bdist_egg import bdist_egg |
| 48 | + |
| 49 | +class bdist_egg_disabled(bdist_egg): |
| 50 | + """Disabled version of bdist_egg |
| 51 | +
|
| 52 | + Prevents setup.py install from performing setuptools' default easy_install, |
| 53 | + which it should never ever do. |
| 54 | + """ |
| 55 | + def run(self): |
| 56 | + sys.exit("Aborting implicit building of eggs. Use `pip install .` to install from source.") |
| 57 | + |
48 | 58 |
|
49 | 59 | setup_args = dict(
|
50 | 60 | name = name,
|
51 | 61 | version = version_ns['__version__'],
|
52 |
| - scripts = glob(pjoin('scripts', '*')), |
53 | 62 | packages = packages,
|
54 | 63 | description = "Jupyter protocol implementation and client libraries",
|
55 | 64 | author = 'Jupyter Development Team',
|
56 | 65 | author_email = '[email protected]',
|
57 |
| - url = 'http://jupyter.org', |
| 66 | + url = 'https://jupyter.org', |
58 | 67 | license = 'BSD',
|
59 | 68 | platforms = "Linux, Mac OS X, Windows",
|
60 | 69 | keywords = ['Interactive', 'Interpreter', 'Shell', 'Web'],
|
|
68 | 77 | 'Programming Language :: Python :: 3',
|
69 | 78 | 'Programming Language :: Python :: 3.3',
|
70 | 79 | ],
|
| 80 | + install_requires = [ |
| 81 | + 'traitlets', |
| 82 | + 'jupyter_core', |
| 83 | + 'pyzmq>=13', |
| 84 | + 'python-dateutil>=2.1', |
| 85 | + ], |
| 86 | + extras_require = { |
| 87 | + 'test': ['ipykernel', 'ipython', 'mock', 'pytest'], |
| 88 | + }, |
| 89 | + cmdclass = { |
| 90 | + 'bdist_egg': bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled, |
| 91 | + }, |
71 | 92 | )
|
72 | 93 |
|
73 |
| -# require setuptools for these cases |
74 |
| -if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv): |
75 |
| - import setuptools |
76 |
| - |
77 |
| -setuptools_args = {} |
78 |
| -install_requires = setuptools_args['install_requires'] = [ |
79 |
| - 'traitlets', |
80 |
| - 'jupyter_core', |
81 |
| - 'pyzmq>=13', |
82 |
| - 'python-dateutil>=2.1', |
83 |
| -] |
84 |
| - |
85 |
| -extras_require = setuptools_args['extras_require'] = { |
86 |
| - 'test': ['ipykernel', 'ipython', 'mock', 'pytest'], |
87 |
| -} |
88 |
| - |
89 |
| -# always try to use setuptools if available |
90 |
| -try: |
91 |
| - import setuptools |
92 |
| -except ImportError: |
93 |
| - pass |
94 |
| -else: |
95 |
| - setup_args.update(setuptools_args) |
96 |
| - setup_args['entry_points'] = { |
97 |
| - 'console_scripts': [ |
98 |
| - 'jupyter-kernelspec = jupyter_client.kernelspecapp:KernelSpecApp.launch_instance', |
99 |
| - 'jupyter-run = jupyter_client.runapp:RunApp.launch_instance', |
100 |
| - ] |
101 |
| - } |
102 |
| - setup_args.pop('scripts', None) |
103 | 94 |
|
104 | 95 | if __name__ == '__main__':
|
105 | 96 | setup(**setup_args)
|
0 commit comments