#976148 lxml: enable test suite during build

Package:
src:lxml
Source:
lxml
Submitter:
Emilio Pozuelo Monfort
Date:
2021-06-08 12:03:03 UTC
Severity:
normal
Tags:
#976148#5
Date:
2020-11-30 13:36:23 UTC
From:
To:
Hi,

The attached patch runs the test suite for each supported python
version. It'd be good to do that to ensure lxml's funcionality.
The patch needs to do an in-tree build so that etree.so can be found.
I couldn't find a workaround for that but if that's a blocker I could
investigate further to avoid that in-tree build.

We could further enable autopkgtests to detect if a dep introduces a
regression, I could look into writing a patch for that if that'd be
desired.

Thanks,
Emilio

#976148#10
Date:
2021-05-19 08:01:43 UTC
From:
To:
do we get that "for free" when using pybuild for the build?

sure, that would be appreciated.

#976148#15
Date:
2021-06-08 11:59:37 UTC
From:
To:
problem arises, I somehow can't get the out of tree etree.so picked up (setting
up PYTHONPATH), perhaps because some files are being read from src/lxml/*.py
(package lxml), while others (etree.so) need to be read from
.pybuild/cpython3_3.9/build/lxml/ (also package lxml).

This seems to work:

cp .pybuild/cpython3_3.9/build/lxml/etree.cpython-39-x86_64-linux-gnu.so
src/lxml/etree.so
cp .pybuild/cpython3_3.9/build/lxml/objectify.cpython-39-x86_64-linux-gnu.so
src/lxml/objectify.so

python3.9 ./test.py
Skipping tests in lxml.cssselect - external cssselect package is not installed
Comparing with ElementTree 1.3.0

TESTED VERSION: 4.6.1
     Python:           sys.version_info(major=3, minor=9, micro=2,
releaselevel='final', serial=0)
     lxml.etree:       (4, 6, 1, 0)
     libxml used:      (2, 9, 10)
     libxml compiled:  (2, 9, 10)
     libxslt used:     (1, 1, 34)
     libxslt compiled: (1, 1, 34)
     FS encoding:      utf-8
     Default encoding: utf-8
     Max Unicode:      1114111
----------------------------------------------------------------------
Ran 1938 tests in 3.742s


...but it's still somewhat hacky. Perhaps more modules need to be listed in
setupinfo.py, and not just the compiled ones, so that src/*.py end up in
.pybuild/cpython3_3.9/build/ and we don't have compiled and non-compiled modules
split across two dirs? Or maybe there's something else I have missed that can be
done to load the extension.

Cheers,
Emilio