Have some time before a client meeting this afternoon... so here's the issue I've been turning over in my mind since it was brought up at the last PyGTA. We've run into the same issue at multiple clients and while the "right" solution would likely be to make easy_install/distutils record the information, I've spent way too much of my life inside the distutils code-base already (we used to have custom distutils code in PyOpenGL).
So here's the problem/use-case:
You run easy_install to install TurboGears (or any other huge multi-package system) into a virtualenv, it downloads 45 (or so) eggs. You run setup.py on your TG application... another 4 (or so) eggs. You hand the package to someone else, they run the setup... and it doesn't work, some dependency changed version ever so slightly, you now get to track down which one and fix it.
Buildout, PoachEggs and the like seem to want you to manually specify all 49 packages (with the idea that you do it once and then everyone shares the joy). Problem is, I'm a lazy cuss. I may have issues with easy_install, but it's the closest thing we've got to a package manager for Python eggs at the moment, so how do I just ask easy_install to do "exactly the same install" as it just did on some other machine?
If you're me, you hack up a dumb script that processes the output of easy_install looking for "Downloading " lines. You make the script download those files into a directory (and record an index file so it knows the order), you then add an option to the same script to replay the install with extremely restrictive easy_install options (i.e. no hosts, no dependency resolution, etceteras).
Obviously this falls into the "expediant hack" rather than "properly engineered" pile, but it does look like it would work. It generates an editable file you can tweak, just as you might tweak a "recipe" base system's configuration, but it automates the initial generation of that recipe.
The project is on LaunchPad, as is the code (bzr branch lp:recordeggs) and the downloads are in PyPI.
To use it:
easy_install -i http://www.turbogears.org/2.0/downloads/2.0.1/index tg.devtools 2>&1 | recordeggs.py ../egg-sources
recordeggs -p ../egg-sources
The "redirect stderr to stdout" stuff is one of those things I always need to look up, so maybe I should just run easy_install as a captive process, but for now this seems to work.
[Update] usage is now:
recordeggs ../egg-sources [easy_install options/args]
recordeggs -p ../egg-sources
which feels a lot more natural, but I haven't yet got the pipes aligned so you could see the easy_install output as it processes (at the moment it kicks all the output out at the end of the run).


Comments
2009-07-02 10:54
pip -- yup, basically it look s like it should do the job. But for some reason it's picki ng up all installed pack [...]
2009-06-30 20:49
Try pip's freeze command: $ pip freeze stable-req.txt Also note that Buildout doesn' t want you to have to ma [...]
2009-06-30 16:36
Check PIP: http://pip.openplan s.org/ I think this suits your needs better
2009-06-20 12:51
Currently PyQNet is about 20KB compressed, and I consider th at to be a bit heavy. Once I get a presence mechanism [...]
2009-06-20 04:35
A word of warning about compre ssed JSON and similar dynamic self-defining protocol schemes : there is the potential [...]
2009-06-20 04:22
How big is "too big"? Do you have a metric for what the rig ht size of a dependency is? D o you mean in terms of o [...]
2009-06-18 23:34
I'm not all that interested in maintaining a C++ wrapper to a GPL program. I might work on an existing open-sou [...]
2009-06-18 22:39
Rewriting the wheel gets dismi ssed a lot, but as someone who has worked on networking fram eworks within games, the [...]
2009-06-18 13:13
before you go and write someth ing yourself, just stand on th e shoulders of giants, http:// sourceforge.net/projects [...]
2009-06-18 11:54
Looking for safe communication s between machines. Twisted is wonderful, but it's way too big a dependency IMO [...]
2009-06-18 10:31
I'm not sure what your require ments are... but binary pic kles are a great format when y ou're dealing with a clo [...]
2009-06-15 14:31
Nice. My first experience with PyCairo is this wonderful sin gle-file dot-renderer. http ://code.google.com/p/jrf [...]
2009-06-13 23:04
I've spent all evening trying to understand VBOs, which I'd like to use for fast 2d drawin g on a mobile device and [...]
2009-06-10 11:22
Unfortunately no, I've tried s witching terminals, killing th e X server, sending sysreqs to try to kill all process [...]
2009-06-09 16:45
In the past I've had some succ ess recovering this situation by changing to a virtual termi nal and then changing ba [...]