[Distutils] Easy Install source download
Phillip J. Eby
pje at telecommunity.com
Sat Jul 23 17:37:15 CEST 2005
At 10:48 AM 7/23/2005 +0200, Vincenzo Di Massa wrote:
>Hi,
>I'm developing an easy_install based packager.
>It will create distribution specific packages containing eggs. (deb, rpm...)
>
>I would like to generate source packages from which binary egg-packages are
>built.
>
>I spent one day looking at setuptools code, but I did not find how to force
>easy_install to download a source distribution even if an egg is available.
>
>I think package_index has code I can call to download just the tar.gz or zip
>source... but how?
Just give easy_install the URL of the source archive. You can use a
standalone PackageIndex to do your PyPI search ahead of time; just use the
find_packages() method, then do something similar to what the obtain()
function does to iterate over the available packages. A package with a
precedence of SOURCE_DIST or CHECKOUT_DIST is presumably what you want, and
its 'location' attribute will be what you should give to easy_install.
(Note that what I'm saying is correct only for the CVS HEAD (0.6a0) of
setuptools, not the released 0.5 versions, which don't have a 'location'
attribute or CHECKOUT_DIST precedence.)
More information about the Distutils-SIG
mailing list