[lxml-dev] lxml Mac installation idea

Chris Withers chris at simplistix.co.uk
Sun Nov 9 20:35:56 CET 2008


Paul wrote:
>>>>> Stefan Behnel wrote:
>>>>> but I'd like it to work without buildout, and there's also several
>>>>> buildout recipes and configurations out there and not one clear
>>>>> canonical way to build lxml.

Out of interest, what's the canonical way to build lxml when you're 
developing it? What's the canonical way to run the unit tests?

I seem to be moving more and more to using buildout for each of the 
packages I maintain as it provides a simple answer to both these questions.

> Here's the buildout.cfg that we've used:
> 
> [libxml2]
> recipe = zc.recipe.cmmi
> url = http://somecustomer.agendaless.com/indexes/karl/cmmi/libxml2-2.6.32.tar.gz
> extra_options = --without-python
> 
> [libxslt]
> recipe = zc.recipe.cmmi
> url = http://somecustomer.agendaless.com/indexes/karl/cmmi/libxslt-1.1.24.tar.gz
> extra_options = --with-libxml-prefix=${libxml2:location}
>                   --without-python
> 
> [lxml-environment]
> XSLT_CONFIG=${buildout:directory}/parts/libxslt/bin/xslt-config
> XML2_CONFIG=${buildout:directory}/parts/libxml2/bin/xml2-config
> 
> [lxml]
> recipe = zc.recipe.egg:custom
> egg = lxml
> include-dirs = ${libxml2:location}/include/libxml2
>                 ${libxslt:location}/include
> library-dirs = ${libxml2:location}/lib
>                 ${libxslt:location}/lib
> rpath = ${libxml2:location}/lib
>          ${libxslt:location}/lib
> environment = lxml-environment

This looks quite similar to the buildout Martijn originally came up with 
back in 2005. Is it related to that?

>> One problem with buildout recipes is that they aren't, AFAIK, very  
>> compatible with other systems.  That is, they can build the egg, but  
>> the egg isn't on the path of any interpreter, so unless you use  
>> buildout entirely you'll have to do some further manipulation to  
>> make lxml available.

Well, that's true, but surely lxml should or is ending up as a binary 
egg or few up on PyPI?

http://pypi.python.org/pypi/lxml/2.1.2

...would seem to suggest that this is the case. In which case, I guess 
buildout would help for building libxml2 and libxslt on environments 
other than Windows, but other than that?

> Right.  On one hand, I'm reluctant to put all lxml's eggs in the  
> buildout basket [wink] for that reason.

...I honestly don't think there's anything better in the python world. 
It's just a shame buildout's docs suck so much. Sometimes doctests have 
a *lot* to answer for!

> lxml is much bigger than the  
> world of Zope.  

So is buildout ;-)

> Being confronted with something you didn't know  
> (buildout) just to get to the thing you wanted (lxml) is a pain.

Yes, I agree that simply for using lxml that shouldn't be the case. But, 
what about developing lxml? And what about if your project is using 
buildout already?

> OTOH, I wonder if the solution is to simply provide a number of  
> options.  We're really only talking about Mac users, so it isn't as  
> big of a decision.

What's special about Mac users? (sorry for being dumb...)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the lxml-dev mailing list