Repository: ipython/ipython

Issue:
ipython-qtconsole script isn't installed for Python 2.x
Please see bug https://bugs.gentoo.org/show_bug.cgi?id=407823



Discussion:
How does Gentoo install the package? On my (Ubuntu) system, running `python3 setup.py install` installs a script called `ipython3-qtconsole`.

The ipython[3]-qtconsole script is only installed when an installation uses setuptools, rather than distutils, and is mainly intended for Windows use - on Linux, `ipython qtconsole` is the recommended way to start it. Because installing on Python 3 always uses setuptools, you'll always get a Python 3 version of the script, but it should have the `3` suffix.

For every available version of python setup.py is eventually called like: python2.7 setup.py [options], python3.2 setup.py [options] and so on and eventually end up with ipython-qtconsole-3.2 script and no ipython-qtconsole-2.7. As you suggested, for python 2.7 distutils are used. If ipython-qtconsole could be installed for distutils variant as well it would solve the issue. Another approach would be from Gentoo side and just drop qtconsole script and inform users to use "ipython qtconsole" as you suggested. But setup install also .desktop files and also only for python 3. It would be nice to have them both for python 2 and 3.

You can force it to use setuptools on all installations by using `setupegg.py` in place of `setup.py`. We don't make that the default because we don't want setuptools to be a strict dependency.

This looks to me more like a distribution issue than anything we can change on our side...

The issue from our side is that it's confusing - sometimes `ipython-qtconsole` exists, and sometimes it doesn't.  The fact is, it probably shouldn't exist anywhere but Windows, and that's an easy fix from us.  We can just exclude the `ipython-qtconsole` gui_script everywhere but Windows, so it's clearer what the point is: an executable on the one platform where setuptools makes useful double-click targets.

Yes, some consistent solution would be good. I considered either to write some wrapper script to use setuptools both for python2 and 3 or remove ipython-qtconsole. So if you're going to remove it, I'll take same approach in current versions. Thanks.

PR #1521 removes ipython-qtconsole except on Windows.

Thank you.

This can be closed, right?

This has not been fixed (PR #1521 didn't work, and wasn't merged).

Ah, I saw it was closed and didn't check why... OK, stays open then.

The endpoint of #1521 was that this was a more sensible approach:

> Maybe we shouldn't have this entry point at all, and only add the qtconsole to the Start Menu. That way it's in a clearer Windows-only role.

Sounds OK to me...


Resolving patch:
diff --git a/scripts/ipython_win_post_install.py b/scripts/ipython_win_post_install.py
--- a/scripts/ipython_win_post_install.py
+++ b/scripts/ipython_win_post_install.py
@@ -113,10 +113,10 @@ def install():
     mkshortcut(python, 'IPython engine', link, cmd, workdir)
 
     link = pjoin(ip_start_menu, 'ipythonqt.lnk')
-    cmdbase = suffix(pjoin(scripts, 'ipython')) + '-qtconsole'
+    cmdbase = suffix(pjoin(scripts, 'ipython'))
     if have_setuptools:
-        cmdbase += '-script.pyw'
-    cmd = '"%s"' % cmdbase
+        cmdbase += '-script.py'
+    cmd = '"%s" qtconsole' % cmdbase
     mkshortcut(pythonw, 'IPython Qt Console', link, cmd, workdir)
 
     # FIXME: These below are commented out because we don't ship the html built
diff --git a/setupbase.py b/setupbase.py
--- a/setupbase.py
+++ b/setupbase.py
@@ -318,9 +318,7 @@ def find_scripts(entry_points=False, suffix=''):
             'iptest%s = IPython.testing.iptest:main',
             'irunner%s = IPython.lib.irunner:main'
         ]]
-        gui_scripts = [s % suffix for s in [
-            'ipython%s-qtconsole = IPython.frontend.qt.console.qtconsoleapp:main',
-        ]]
+        gui_scripts = []
         scripts = dict(console_scripts=console_scripts, gui_scripts=gui_scripts)
     else:
         parallel_scripts = pjoin('IPython','parallel','scripts')


Test patch: