[Distutils] [tg-trunk] Re: [ANN] EggFreezer

Maurits van Rees m.van.rees at zestsoftware.nl
Thu Aug 7 22:51:45 CEST 2008


Ian Bicking, on 2008-08-07:
> Probably we're both having the same problem, which is that we're using 
> easy_install to download packages, but then of course it also installs 
> the packages, which is almost okay so long as you are okay with an egg. 
>   But if it just downloaded, that'd be better.  I'm sure some digging 
> would reveal a way to just download.

Hi,

Allow me to chip in with a few thoughts.

I have created z3c.recipe.eggbasket that may help there, if only as a
code example.  It is a recipe for zc.buildout, though you can use it
outside of a buildout with some lines of python like this:

  import z3c.recipe.eggbasket.utils

  z3c.recipe.eggbasket.utils.create_source_tarball(
      egg = 'grok',
      versionfile = 'http://grok.zope.org/releaseinfo/grok-0.13.cfg')

With those arguments it creates a tarball with grok and all its
dependencies, using the versions as specified in the versionfile.  The
tarball contains what I would call 'source eggs', so the files
downloaded from the cheese shop.  As an extra it looks for Windows
binary eggs for all those dependencies.  This is the result:

http://grok.zope.org/releaseinfo/grok-eggs-0.13.tgz

(That tarball is used within grokproject -using another part of this
same eggbasket recipe- to avoid install failures due to servers being
down, thereby lessening the number of single points of failure.  See
downloader.py.)

Look at utils.py in that package for how this is done.  The important
line is this one:

  zc.buildout.easy_install.download_cache(cache)

So zc.buildout does the real work here.  And it probably is just a
thin layer around setuptools in this spot.

BTW, this package was inspired by the zc.sourcerelease package by Jim
Fulton, stealing some ideas there.  Try that package if you want to
giftwrap a complete buildout with all source eggs and any other
downloaded stuff, including an install.py that you should run after
unpacking the generated tarball and that takes care of building up the
buildout again.

> The idea of PoachEggs, though, is that often a second-level requirement 
> effects the stability of an application.  So if you require 
> Pylons==0.9.6, but Pylons doesn't require a specific version of Beaker, 
> you might have problems when a newer version of Beaker appears. 
> Relatedly, it's awkward to even put a requirement like Pylons==0.9.6 in 
> your application, and you may not know one way or the other if Pylons 
> 0.9.7 would work.
>
> So PoachEggs just lets you put all these requirements in a separate 
> file, outside of any setup.py.  You can also get a working environment, 
> and then "freeze" the requirements to a set of exact versions of 
> packages.  It's equivalent to what people are doing with custom package 
> indexes.

Sounds like we have some overlap between PoachEggs and
z3c.recipe.eggbasket (and zc.buildout itself).

Cheers,

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]



More information about the Distutils-SIG mailing list