[Distutils] Removing the hack from setup.py - Setup.py as a Class, not a Procedure

Jeff Rush jeff at taupro.com
Wed Jul 22 05:20:15 CEST 2009


David Lyon wrote:
> On Tue, 21 Jul 2009 14:12:48 -0400, "P.J. Eby" <pje at telecommunity.com>
> wrote:
>> The concept of "package data" is data in the same directory as the 
>> package's Python code.  Using it to install libraries is a bit of a 
>> hack in the first place.
> 
> Too right it's a hack - haha. I'm glad that I'm not the only one who's 
> noticed.

You're misreading him - the hack is using an attribute of
"package_data", which is intended for describing "data files residing
within a package directory", in a way in which it was not intended to
describe data _outside_ a package directory.  That's a definition of a hack.

If an egg wants to splatter data files outside the Python package area,
other than scripts in /usr/local/bin/, I'd consider that very bad
behavior.   My reasons are that (1) such splattering is usually very
OS/platform-specific, (2) the files splattered may have overwritten
files under the control of a native system packaging system, with no way
to recover the originals and (3) there is no real metadata or directory
proximity linking the splattered files to a particular Python
distribution.  These properties have a destabilizing effect on a system
over time.


> Now it's somewhat restrictive. And my guess + experience is that it
> can take about 3+ days to get a "typical" setup.py to work properly
> because of all the hacks. (For a newcomer)

Setuptools is not the hack (by the definition of 'hack') -- using
setuptools in unusual ways is the hack.  Most often the problems I see
people have are they do not grok the problem that setuptools is solving
and want it to solve some other problem.  When used for the purpose
intended, setuptools is quite good.

-Jeff


More information about the Distutils-SIG mailing list