[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: __file__ is a disease



Le samedi 30 janvier 2010 à 17:22 -0500, Barry Warsaw a écrit : 
> Do you feel the same way about pkg_resources?

pkg_resources allows to do things correctly, but I find it too complex;
it’s no wonder why people still hack stuff around __file__: it’s much
simpler.

Basically, I’d say it tries to address the problem at the wrong level:
build/installation issues should be addressed by the build system, not
by the code.

> I've never used waf or cmake, but tools like autoconf and scons are
> not trivial systems to use, modify or debug. I don't think that they
> make life easier for a robust open source project.

I beg to disagree. For a simple project, the autotools use files just as
light and simple as setuptools, and if you look at a few sample Python
projects using them, you will see the amount and the complexity of build
scripts is similar.

And as soon as you are not dealing only with pure Python code, the
difference becomes dramatic. For example the absence of pkg-config
support in setuptools makes it require specific code for each and every
dependency - except those that provide dependency information in the
Python-specific egg-info format, ha, ha.

There are huge projects that use the autotools without needing to jump
through hoops. A simple look at NumPy and its 10000+ lines of specific
Python code just to be able to build the C pieces should be enough to
convince anyone to use a better tool.

I’m not implying the autotools don’t have flaws: the insanity of libtool
bugs, the arcanes of m4 and the gazillions of broken m4 scripts that lie
around… But these flaws are about features that don’t even exist in
Python-specific tools.

Cheers,
-- 
 .''`.      Josselin Mouette
: :' :
`. `'   “I recommend you to learn English in hope that you in
  `-     future understand things”  -- Jörg Schilling

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=


Reply to: