[Python-Dev] setuptools in 2.5.

Barry Warsaw barry at python.org
Fri Apr 21 05:08:52 CEST 2006


On Thu, 2006-04-20 at 19:43 -0400, Phillip J. Eby wrote:

> >I may be way out of date with the state of the art these days, but in
> >the past, I've had a difficult time making this work for Mailman.  For
> >example, at various times we've had to distribute our own email package
> >and Asian codecs packages.  The only way I've gotten things to work is
> >by specifying --install-lib --install-data and --install-purelib
> >switches, which was pretty difficult (IIRC) to figure out.
> 
> I'm surprised you needed --install-purelib; it seems like install-lib 
> should have been sufficient.
> 
> As for --install-data, just put your data in the packages and use Python 
> 2.4's ability to install package data, or one of the pre-existing distutils 
> extensions that beat install_data over the head to make it install the data 
> with the packages.

I should have been clearer -- these weren't /my/ packages that I was
installing, they were packages that others wrote that Mailman needed,
but I didn't want to require them to be in site-packages.  IIRC, I need
all of those switches to get some of those packages to not try to
install stuff in the default (i.e. system) locations.

Now that could all be because of buggy 3rd party packages, old versions
of Python or distutils, or my own stupidity, so I should probably
re-examine why ... or if those switches are still needed.

> >Again, maybe there's an easy way to do this with modern distutils, but I
> >just want to make sure this is a use case that's on the radar.
> 
> In the easy_install case, "easy_install -d wherever" puts everything (and I 
> do mean *everything*, including scripts) under the 'wherever' 
> directory.  

See, now that's cool.  I want that! :)

> If you want scripts to go someplace different, there's a 
> separate option.  But if you don't specify these things, easy_install gets 
> its defaults from those defined for  distutils, specifically the 
> --install-lib and --install-scripts options of the "install" command.
> 
> However, easy_install will gripe if the "-d wherever" isn't in PYTHONPATH 
> and isn't site-packages, and you aren't saying you don't need it to be 
> importable.  If you promise to make sure the installed packages will be on 
> sys.path when you want to import them, you use -m or --multi-version and 
> easy_install will happily put the packages anywhere you like and leave it 
> to you to get them on sys.path.

That's exactly what I want.  I do add some additional directories to
sys.path at run time, but I'm also not opposed to setting $PYTHONPATH in
a makefile rule at install time.  What I really want is for my Mailman
installation to be completely self-contained, including the 3rd-party
packages (specific versions of which) Mailman depends on.

Question out of total ignorance: say I get a 3rd party package that has
a standard distutils setup.py but knows nothing of setuptools.  Say I
install my own copy of setuptools (or have Python 2.5).  Can that 3rd
party package still be installed "the setuptools way" without
modification?  My guess is that the original packager has to
do /something/ to utilize setuptools (which is fine really -- I'm mostly
just curious).

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 309 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20060420/28b6f634/attachment.pgp 


More information about the Python-Dev mailing list