ElementTree - Why not part of the core?

Fredrik Lundh fredrik at pythonware.com
Thu Dec 8 06:29:21 EST 2005


Magnus Lycka wrote:

> We're deploying our software on a number of different platforms. We
> certainly depend on Python, so a standard Python install will always
> be included. Using standard library modules is for free. Using yet
> another third party library has a cost, even if some Cheese Shop or
> whatever might make the cost slightly lower.
>
> We have very friendly configuration management guys here, so if I
> insisted, I'm sure they'd let me have elementTree included, but I
> hesitate to ask for it. It does add a burden on CM, increases the
> risk that a deployment will fail, and from a code maintenance point
> of view, it's a double edged sword: On one hand, it's a much better
> API, but on the other hand, it's not documented in the standard
> Python docs or in the Nutshell book, and a new developer would need
> to figure out what this foreign beast was, and where to find docs.
> (Alternatively, I'd have to (God forbid) document my actions. ;)

on the other hand, you can bundle ElementTree with your applications simply
by including the ElementTree.py and (optionally) the ElementPath.py modules.

(you are allowed to add new Python modules to the project, I hope ;-)

(and yes, HTML documentation is included in the source distribution kit)


but seriously, given how easy it is to build things with distutils, I don't think your
configuration folks would have much trouble adding support for "anything that has
a setup file, and is reasonably self-contained" to their build scripts.

we usually use one large shell script with a bunch of "cd source; run setup install"
sections in it, e.g.

    cd $PREFIX
    cd src/griblib-2.1.1-20051125
    $PYTHON setup.py install --prefix=$PREFIX

plus a Python script that does a sanity check at the end to make sure that the build
script actually managed to build and install everything we need.  running the regression
test suite on the build is a good way to weed out build problems too; just make sure
you redirect the build output to a file, so you can check the logs afterwards.

all source kits are checked into the version management system, of course.  no tarballs
are involved in the build process.  just check things out and run the script, wait a couple
of minutes, and you're done.

</F> 






More information about the Python-list mailing list