[lxml-dev] Building with distutils only
Stefan Behnel
stefan_ml at behnel.de
Thu Jun 28 08:44:23 CEST 2007
Itamar Shtull-Trauring wrote:
> Though it is possible to build lxml 1.2 with distutils only, no need to
> install anything extra, the try/except that used to be in 1.1 for this no
> longer exists. This is very frustrating since I don't want to use ezsetup
> or whatever it's called when building lxml; especially when at one point
> it tried to download egg from non-existent URL.
>
> At work we have the following patch; it could be easily replaced with a
> try/except that imports from distutils when setuptools is not installed:
>
> --- lxml-1.2.1/setup.py 2007-02-20 08:43:16.000000000 -0500
> +++ lxml-1.2.1.new/setup.py 2007-04-06 15:02:13.000000000 -0400
> @@ -1,7 +1,4 @@
> -from ez_setup import use_setuptools
> -use_setuptools(version="0.5")
> -
> -from setuptools import setup
> +from distutils.core import setup
> import sys, os
>
> # need to insert this to python path so we're sure we can import
> --- lxml-1.2.1/setupinfo.py 2007-02-27 03:23:38.000000000 -0500
> +++ lxml-1.2.1.new/setupinfo.py 2007-04-06 15:01:04.000000000 -0400
> @@ -1,5 +1,5 @@
> import sys, os
> -from setuptools.extension import Extension
> +from distutils.extension import Extension
>
> try:
> from Pyrex.Distutils import build_ext as build_pyx
Hmm, not that easily, though, as the first two lines trigger the installation
of setuptools if they are not yet installed. That's actually intended.
Do the additional keyword arguments in setup() - like zip_safe - actually pass
silently in Python 2.3 or do they produce errors? Otherwise, we'd have to go
back to adapting to both distutils and setuptools, which adds quite some overhead.
Stefan
More information about the lxml-dev
mailing list