[IPython-user] Got bdist_wininst working for IPython ...

Fernando Perez Fernando.Perez at colorado.edu
Sun Jan 9 19:54:43 CST 2005


Viktor Ransmayr wrote:

> No problem. I'm happy if I can contribute. - Now about this next version.
> I don't know how much time you spent looking at my modifications yet.
> However I still have a few questions about the further proceeding:
> 
> 1) There is no need to install pywin32 for the installation process on 
> window.
>     - At least not for bdist_wininst. - Should anything be checked 
> during the
>     import or do you think a simple message, stating that pywin32, ctypes
>    and readline are recommended is sufficient ?

I'd say printing a user message would be a very good idea.  ipython will 
_work_ without this stuff, but it will lack some of its nicest functionality 
(readline and coloring).  So a prominent message in this direction would 
certainly help.  A simple

try:
   import ctypes
except ImportError:
   print 'get ctypes from http://....'

and similar for readline would be very good to have.  No need to bother users 
who already have them with this, though.

> 2) I'm not sure what should be done in the case of cmd=bdist ? - What I did
>     not like about the way "IPython-0.6.6.zip" worked, was the fact that 
> it did
>     install files outside of ..\Lib\site-packages\IPython\ without 
> giving me any
>     means to deinstall. (Other than saving the complete output of the 
> install-
>     cmd into a log-file and removing everything by hand :-)
> 
>     Do you have an idea/ a plan or do you think that simply removing the
>     usage of the post-installation script completely from the zip-archive is
>     sufficient and/or acceptable ?

Mmh, I think I'm a bit confused here.  I guess our ultimate goal is the following:

1.  An ipython_setup.exe real windows installer is available, which can both 
install AND uninstall ipython by the usual windows mechanisms, leaving no junk 
behind it after uninstallation.

2.  The ability for windows users, if necessary, to run by hand in a terminal 
'python setup.py install' and have the thing work as well.   I think it's 
acceptable in this scenario to lose uninstallation capabilities, since they 
don't really exist with a manual install under unix either.  Under unix, if 
you want uninstall capabilities, you need to use a package manager (rpm, apt, 
fink), so the same applies for windows (the .exe installer playing the role of 
a package manager).

My understanding is that we already have #1 with your work.  It's just a 
matter of keeping #2 as an option, for those who download the sources.  I'm 
even willing to stop distributing .zips once the .exe installer becomes 
available: a source install for windows users will be at that point a much 
more rare occurrence, and I expect it to be done only by very technically 
minded users.  Since winzip can handle .tar.gz files just fine, they can 
always grab that.

This means that it's OK to remove the hacks I had to inject an 'install' 
command into sys.argv in setup.py for windows users.   The question I have is, 
what does setup.py see when it is called by the .exe installer?  What does 
sys.argv look like in that scenario?  We basically need some way of 
distinguishing if it's being called by the .exe installer, who will in turn 
execute the post_install script itself, or by a user at a command line, case 
in which we need to run it ourselves.  Is this possible?

Cheers,

f




More information about the IPython-user mailing list