[IPython-dev] Editing manifest.in

Fernando Perez Fernando.Perez at colorado.edu
Sun Jan 22 13:38:54 CST 2006


Ville Vainio wrote:
> I'd like to make ipython.py in the ipython root dir a standard part of
> the source distribution (setup.py sdist). Can I just add it to
> Manifest.in, or is there something else to do? It's handy in Windows,
> but it's also helpful on non-root Unix installs.

No: the trick this relies on, which is that it says

import IPython

and since the 'IPython/' directory is directly below, it imports it right 
away, will cease to work very soon:

http://www.python.org/peps/pep-0328.html

On Unix, or even on windows with NTFS, there is no need for this at all, you 
just use a symlink.  I'm constantly switching between the development version 
of ipython and old releases, trunks and branches, and there's no need for this 
root-level ipython.py at all.  In fact, I wanted to explain this to you 
earlier, because I don't like polluting things like this with duplicated scripts.

All you need to do is to drop a symlink to the version you are currently 
running in a directory which is in your PYTHONPATH.  This is what mine looks like:

abdul[~/ipython]> d
/home/fperez/ipython
total 108
drwxr-xr-x   9 fperez 4096 Jun  2  2005 0.6.15/
lrwxrwxrwx   1 fperez   47 Jan 21 18:17 0.7.1 -> 
/home/fperez/ipython/svn/ipython/branches/0.7.1/
drwxr-xr-x   5 fperez 4096 Jul 16  2005 attic/
drwxr-xr-x   3 fperez 4096 Jan 10 01:10 backup/
lrwxrwxrwx   1 fperez   29 Oct 23 22:16 chainsaw -> svn/ipython/branches/chainsaw/
drwxr-xr-x   2 fperez 4096 Jan 21 17:18 contrib/
drwxr-xr-x   4 fperez 4096 Dec 21 10:33 epydocs/
drwxr-xr-x   8 fperez 4096 Dec 29 11:56 homepage/
lrwxrwxrwx   1 fperez    5 Jan 21 18:17 ipython -> 0.7.1/
drwxr-xr-x   4 fperez 4096 Oct  7 17:30 misc/
-rw-r--r--   1 fperez 2396 Aug 15 15:43 notes_svn
drwxr-xr-x   6 fperez 4096 Jan 10 13:23 projects.svn/
-rw-r--r--   1 fperez  380 Jul 17  2005 py_questions
-rw-r--r--   1 fperez  775 Sep  5 15:09 rkern
drwxr-xr-x   2 fperez 4096 Jan 12 23:41 sf.net/
drwxr-xr-x   7 fperez 4096 Aug 24 17:07 svn/
drwxr-xr-x  15 fperez 4096 Jan 22 01:43 test/
lrwxrwxrwx   1 fperez   17 Oct 23 22:16 trunk -> svn/ipython/trunk/


As you see, there I have an 'ipython' link, which is currently pointed at teh 
0.7.1 dir, so ipython/IPython resolves out to 0.7.1.  But I have sitting there 
0.6.15, trunk and chainsaw, and I can switch between all 4 in a second just by 
repointing a symlink.

This solution will work on any system with symlinks, which only excludes 
FAT32.  Since the one you propose causes duplication of scripts, and will stop 
working anyway for 2.5, I think this is cleaner.

Cheers,

f




More information about the IPython-dev mailing list