Make ipython-qtconsole a GUI script in setuptools.

This commit is contained in:
Evan Patterson 2011-05-09 15:48:49 -05:00
parent 82f5eb7122
commit 3ba4061e0e
2 changed files with 24 additions and 6 deletions

View File

@ -58,6 +58,7 @@ from setupbase import (
find_packages,
find_package_data,
find_scripts,
find_gui_scripts,
find_data_files,
check_for_dependencies,
record_commit_info,
@ -211,7 +212,8 @@ setuptools_extra_args = {}
if 'setuptools' in sys.modules:
setuptools_extra_args['zip_safe'] = False
setuptools_extra_args['entry_points'] = {
'console_scripts': find_scripts(True)
'console_scripts': find_scripts(True),
'gui_scripts': find_gui_scripts(True),
}
setup_args['extras_require'] = dict(
parallel = 'pyzmq>=2.1.4',
@ -245,7 +247,7 @@ else:
# 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)
setup_args['scripts'] = find_scripts(False) + find_gui_scripts(False)
#---------------------------------------------------------------------------
# Do the actual setup now

View File

@ -267,12 +267,10 @@ def find_scripts(entry_points=False):
return setuptools entry_point-style definitions
else:
return file paths of plain scripts [default]
"""
if entry_points:
scripts = [
'ipython = IPython.frontend.terminal.ipapp:launch_new_instance',
'ipython-qtconsole = IPython.frontend.qt.console.ipythonqt:main',
'pycolor = IPython.utils.PyColorize:main',
'ipcontroller = IPython.parallel.apps.ipcontrollerapp:launch_new_instance',
'ipengine = IPython.parallel.apps.ipengineapp:launch_new_instance',
@ -290,12 +288,30 @@ 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
#---------------------------------------------------------------------------