Skip to content

Commit

Permalink
Clean up entry point definition is setup.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
epatters committed May 10, 2011
1 parent 87eb19d commit df41710
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
find_packages,
find_package_data,
find_scripts,
find_gui_scripts,
find_data_files,
check_for_dependencies,
record_commit_info,
Expand Down Expand Up @@ -211,10 +210,7 @@ def cleanup():

if 'setuptools' in sys.modules:
setuptools_extra_args['zip_safe'] = False
setuptools_extra_args['entry_points'] = {
'console_scripts': find_scripts(True),
'gui_scripts': find_gui_scripts(True),
}
setuptools_extra_args['entry_points'] = find_scripts(True)
setup_args['extras_require'] = dict(
parallel = 'pyzmq>=2.1.4',
zmq = 'pyzmq>=2.0.10.1',
Expand Down Expand Up @@ -247,7 +243,7 @@ def cleanup():
# check for dependencies an inform the user what is needed. This is
# just to make life easy for users.
check_for_dependencies()
setup_args['scripts'] = find_scripts(False) + find_gui_scripts(False)
setup_args['scripts'] = find_scripts(False)

#---------------------------------------------------------------------------
# Do the actual setup now
Expand Down
27 changes: 6 additions & 21 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def find_scripts(entry_points=False):
return file paths of plain scripts [default]
"""
if entry_points:
scripts = [
console_scripts = [
'ipython = IPython.frontend.terminal.ipapp:launch_new_instance',
'pycolor = IPython.utils.PyColorize:main',
'ipcontroller = IPython.parallel.apps.ipcontrollerapp:launch_new_instance',
Expand All @@ -279,6 +279,10 @@ def find_scripts(entry_points=False):
'iptest = IPython.testing.iptest:main',
'irunner = IPython.lib.irunner:main'
]
gui_scripts = [
'ipython-qtconsole = IPython.frontend.qt.console.ipythonqt:main',
]
scripts = dict(console_scripts=console_scripts, gui_scripts=gui_scripts)
else:
parallel_scripts = pjoin('IPython','parallel','scripts')
main_scripts = pjoin('IPython','scripts')
Expand All @@ -288,32 +292,13 @@ def find_scripts(entry_points=False):
pjoin(parallel_scripts, 'ipcluster'),
pjoin(parallel_scripts, 'iplogger'),
pjoin(main_scripts, 'ipython'),
pjoin(main_scripts, 'ipython-qtconsole'),
pjoin(main_scripts, 'pycolor'),
pjoin(main_scripts, 'irunner'),
pjoin(main_scripts, 'iptest')
]
return scripts

def find_gui_scripts(entry_points=False):
"""Find IPython's GUI scripts.
if entry_points is True:
return setuptools entry_point-style definitions
else:
return file paths of plain scripts [default]
"""
if entry_points:
scripts = [
'ipython-qtconsole = IPython.frontend.qt.console.ipythonqt:main',
]
else:
parallel_scripts = pjoin('IPython','parallel','scripts')
main_scripts = pjoin('IPython','scripts')
scripts = [
pjoin(main_scripts, 'ipython-qtconsole'),
]
return scripts

#---------------------------------------------------------------------------
# Verify all dependencies
#---------------------------------------------------------------------------
Expand Down

0 comments on commit df41710

Please sign in to comment.