Skip to content

Commit 795915d

Browse files
authored
Merge pull request #284 from minrk/always-setuptools
unconditionally use setuptools
2 parents 1c506c0 + ddca09f commit 795915d

File tree

3 files changed

+25
-50
lines changed

3 files changed

+25
-50
lines changed

scripts/jupyter-kernelspec

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/jupyter-run

Lines changed: 0 additions & 8 deletions
This file was deleted.

setup.py

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
#-----------------------------------------------------------------------------
2929

3030
import os
31-
from glob import glob
3231

33-
from distutils.core import setup
32+
from setuptools import setup
3433

3534
pjoin = os.path.join
3635
here = os.path.abspath(os.path.dirname(__file__))
@@ -45,16 +44,26 @@
4544
with open(pjoin(here, name, '_version.py')) as f:
4645
exec(f.read(), {}, version_ns)
4746

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+
4858

4959
setup_args = dict(
5060
name = name,
5161
version = version_ns['__version__'],
52-
scripts = glob(pjoin('scripts', '*')),
5362
packages = packages,
5463
description = "Jupyter protocol implementation and client libraries",
5564
author = 'Jupyter Development Team',
5665
author_email = '[email protected]',
57-
url = 'http://jupyter.org',
66+
url = 'https://jupyter.org',
5867
license = 'BSD',
5968
platforms = "Linux, Mac OS X, Windows",
6069
keywords = ['Interactive', 'Interpreter', 'Shell', 'Web'],
@@ -68,38 +77,20 @@
6877
'Programming Language :: Python :: 3',
6978
'Programming Language :: Python :: 3.3',
7079
],
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+
},
7192
)
7293

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)
10394

10495
if __name__ == '__main__':
10596
setup(**setup_args)

0 commit comments

Comments
 (0)