[IPython-dev] Distribution via "Easy Install"?

Fernando Perez Fernando.Perez at colorado.edu
Thu Dec 22 18:41:05 CST 2005

Robert Kern wrote:
> Fernando Perez wrote:

>>Robert Kern wrote:

>>Should I distribute the .egg in this 
>>manner as well at ipython/dist?  I'm perfectly happy installing setuptools and 
>>adding the above to my release script, but I don't know if that's the 
>>preferred mechanism.
> Since ipython is pure Python, yes, providing an egg in addition to the source
> tarball would be great. It won't have the documentation, though, unless if it is
> included as package_data.

Mmh, this would force me to jump to py2.4, it seems:

abdul[distutils]> grep package_data /usr/lib/python2.3/distutils/*.py
abdul[distutils]> grep package_data /usr/lib/python2.4/distutils/*.py
/usr/lib/python2.4/distutils/dist.py:        self.package_data = {}

otherwise the package_data keyword will bork 2.2-2.3 installs.  I guess I can 
build the dict of options dynamically, and then call


instead.  Ugly, but it will do the job.  Is it worth it?  What else does it 
buy us?

>>>* The /usr/bin/ipython contents that Ville posted is automatically generated by
>>>easy_install (the actual scripts live inside the egg; the scripts installed to
>>>/usr/whatever/bin are bootstraps to load and run those scripts), so Fernando
>>>doesn't need to worry about wrapping anything with try: except: blocks.
>>Do you mean that we shouldn't add 'import egg_stuff' _anywhere_ in the ipython 
>>code, or do you refer only to the scripts?  If the latter, which components do 
>>still require egg yolks in them?
> The only places where you might want to use pkg_resources are the places where
> you use __file__ and such. Doing that would make the egg zip-safe so it doesn't
> have to be unpacked, but it's not necessary. Specifically, here are the things
> that make the egg not zip-safe:
> zip_safe flag not set; analyzing archive contents...
> IPython.deep_reload: module references __path__
> IPython.ipmaker: module references __file__
> IPython.Magic: module MAY be using inspect.getabsfile
> IPython.OInspect: module MAY be using inspect.getsource
> IPython.OInspect: module MAY be using inspect.getabsfile
> IPython.ultraTB: module MAY be using inspect.getinnerframes
> So no, there are no *requirements* at this time to import any egg_stuff in the
> ipython package or the setup.py. It would enable some minor conveniences, but at
> the cost of a (buildtime or runtime) dependency on setuptools and Python 2.3.
> It's probably not worthwhile at this time.
>>>* I think the only thing that really needs to happen now is that the PyPI record
>>>needs a link to the actual download location or the tarballs could be uploaded
>>>to PyPI itself.
>>I can do that, as I already register.  Should this be a link to the actual raw 
> A link to http://ipython.scipy.org/dist/ is sufficient. easy_install can
> screenscrape that page just fine. In fact, this works right now:
> [src]$ easy_install -f http://ipython.scipy.org/dist ipython


nice.  How is that link provided to setuptools?  Is it just a matter of 
passing in the download_url keyword to the normal setup() call, or does 
setuptools need the info elsewhere?

I guess what I'm asking is: given that easy_install in your example already 
works, how much exactly should I do to provide 'good citizen' egg support? 
Would the following be enough?

1. Adding download_url='http://ipython.scipy.org/dist' to setup.py.

2. Installing setuptools on my system, so that I can build an egg and put it 
up at /dist/ when new releases are made.



More information about the IPython-dev mailing list