[Distutils] Just downloading an egg

Pascoe, S (Stephen) S.Pascoe at rl.ac.uk
Wed Oct 1 13:35:48 CEST 2008


 
I feel foolish now.  The bit I was always missing was "-m" which stops
easy_install complaining about "." not being on PYTHONPATH.

I really think this should be more obvious though.  Something this basic
could do with it's own option.  It would help demystify what
easy_install does.  The basic use case of "Just download and install" is
so intuitive but doing individual steps like "Just download" requires
understanding how all these options interact.

Yes, I see "-zmaxd" is mentioned in
http://peak.telecommunity.com/DevCenter/EasyInstall but it isn't made to
sound that useful.

I'm a big fan of easy_install but I do have problems selling it to my
co-developers sometimes.  Little things like this would help.

Cheers,
Stephen.


---
Stephen Pascoe  +44 (0)1235 445980
British Atmospheric Data Centre
Rutherford Appleton Laboratory

-----Original Message-----
From: Jeff Rush [mailto:jeff at taupro.com] 
Sent: 30 September 2008 23:42
To: Pascoe, S (Stephen)
Cc: distutils-sig at python.org
Subject: Re: [Distutils] Just downloading an egg

Pascoe, S (Stephen) wrote:
> I often just want to do with easy_install is download an egg from pypi
without installing it.  I've studied the easy_install documentation and
never found a way to do it.  Even giving it the "-d" option results in
easy-install.pth being created and other unwanted stuff.
> 
> Looking at the setuptools pydoc I worked out a way to do it:
> 
>>>> import setuptools
>>>> d = setuptools.Distribution()
>>>> d.fetch_build_egg(requirement)
> 
> Voila! the egg is downloaded into cwd.  It even seems built an egg
from a tarball.
> 
> My question is, can I rely on this feature and is it the best way of
doing what I want?  I'd like to use it in my code and hope it stays.  It
would be ideal if I could do this through easy_install.

Actually this command will download the egg and just the egg:

    easy_install -zmaxd . -N SQLObject

or if you want the egg -and- its dependencies (as eggs too):

    easy_install -zmaxd . SQLObject

-Jeff



More information about the Distutils-SIG mailing list