[Python-Dev] setuptools in 2.5.

Phillip J. Eby pje at telecommunity.com
Fri Apr 21 19:19:33 CEST 2006


At 12:51 PM 4/21/2006 -0400, Jim Jewett wrote:
>Phillip J. Eby wrote:
>
> > Such packages may have customized their installation process
> > by extending the distutils, *without* overriding get_outputs().  Since few
> > people actually use the --record option for anything important, nobody
> > notices when it breaks.
>
>I just searched through the (2.4.2) documentation, and could find no
>reference to either get_outputs or --record.  I also looked through
>the source, and couldn't find any reference to --record.  (I later
>found one in bdist_rpm, but "build a binary for Red Hat Linux" isn't a
>natural thing for anyone not on Linux to even try.)
>
>When I did a grep (which I wouldn't do unless I already knew I needed
>to worry about it), I finally found a few references in install.py
>which boiled down to "nothing happens, but you could get a list of
>files if you went through enough contortions".  This looks more like a
>debugging aid than something I would have to worry about.

As I said, this is probably why most actual system packaging tools use 
--root to record the results instead.  Of course, it's still possible for 
people to do extensions that break --root, so what it basically boils down 
to is that customizing the distutils is generally a bad idea -- except that 
for lots of things there seems to be no other choice.


> > 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.
>
>Use of a third-party extension (that isn't mentioned in the docs) is
>hardly intuitive.

Python 2.4 has the package_data option, and it is documented.  This feature 
was first implemented in setuptools, and then Fred Drake backported it to 
Python and wrote documentation for it.


>   If it is really required, that is far more
>intrusive than the stdlib changes setuptools makes.  (Would it only
>intrude on the packager, at least?  But then how could he or she be
>confident that the package would work on someone else's box?)

I'm not sure I follow you.  If you want to install data inside your package 
directories, and you don't have at least Python 2.4, you'll have to extend 
the distutils.  You can do it yourself (possibly borrowing code from 
another package that looks like it does what you want) or you can use 
setuptools; those are pretty much your only options.



More information about the Python-Dev mailing list