Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 468538 - dev-python/lxml and pypy support
Summary: dev-python/lxml and pypy support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL: https://bugs.launchpad.net/lxml/+bug/...
Whiteboard:
Keywords: TESTED
Depends on:
Blocks:
 
Reported: 2013-05-04 06:39 UTC by Ian Delaney (RETIRED)
Modified: 2016-03-17 21:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
a diff -u from cvs (lxml-diff.patch,2.40 KB, text/plain)
2013-05-04 06:39 UTC, Ian Delaney (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Delaney (RETIRED) gentoo-dev 2013-05-04 06:39:02 UTC
Created attachment 347318 [details]
a diff -u from cvs

adding pypy support and there's a seg fault under running test.py.

IUSE="doc examples test +threads

test? ( !dev-python/elementtree )"

This is what was causing the test fail for py2.6 2.7. The installed instance was found first by the test.  Once removed, passes.

einfo "Many tests not compatible to py3.1"

	elif [[ "${EPYTHON}" == 'pypy-c2.0' ]]; then

		for test in selftest.py selftest2.py; do

skips test.py

python_configure() {
        if [[ "${EPYTHON}" != python3* ]]; then
                append-flags -fno-strict-aliasing

return append-flags -fno-strict-aliasing
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2013-05-06 06:29:39 UTC
see https://bugs.launchpad.net/lxml/+bug/1176283 #c3

Making the issue, combined with asking on #pypy, lead to learning of and acquiring lxml-cffi which is a dropin replacement for lxml.  The package's maintainer could do with refining it in terms of deleting cython related content.  As Mike observed, it lacks any release, though it has a version.

1. It requires the latest py2.0 beta2 for adequate compatibility.

2. That is atm bumped in portage and has some rough edges consequent to it having its own inbuilt cffi which is what the lxml-cffi package utilises to 'work' lxml in place of the cpython oriented cython.

3. Having filed "apparent regression in import in py2.0 b2" at pypy.org, we have

"It's a regression in cffi I filed yesterday:
https://bitbucket.org/cffi/cffi/issue/81/exported-variables-are-not-listed-in-dir"

making for 2 rough edges, both consequent to it's new inbuilt cffi, making for Mike masking it, fair enough too.

4.  So from the #c3

Well, all it means is that it may or may not work for a given code base,
and there certainly is code that works with it.

As long as no-one takes the time to investigate the remaining crash in the
test suite, it'll just continue to be unclear what's wrong and how
difficult or easy it would be to fix it.

His current status is "I've done enough pypy devs ought sort it."
That test.py, being a test, makes for pypy support for lxml main being underdone.  The lxml-cffi is essentially a work in progress, and it's fairly close. 

amaury, a pypy maintainer and the maker of lxml-cffi, does appear active in pursuing these issues, and I'm inclined to think the interest expressed by me on behalf of gentoo is enough to make him hone it and make it production ready, so come on men tell amaury 'yes please more of the same'.

Until then, floppym and radhermit, care to do a commit on the remaining couple of changes I submitted here now -fno-strict-aliasing has been done???
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2013-05-06 10:38:06 UTC
hmm; just found 

Here is a test fix that a) prefers the stdlib version over an externally installed ET and b) adapts the tests to also work with older versions of ET (i.e. it fixes the failures you showed).

https://github.com/lxml/lxml/commit/a7853944dacbe12097c1ef15836caeffbab8396c

https://github.com/lxml/lxml/commit/66549611ed4173457ddbb9565ee81eec32d71cc8.

This makes an alternative to adding test to IUSE and 
"test? ( !dev-python/elementtree )"
Comment 3 Mike Gilbert gentoo-dev 2013-05-08 15:00:37 UTC
(In reply to comment #2)

I have already applied the first patch, and the second is unnecessary given the first.
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2016-03-17 21:03:49 UTC
I think this stuff has landed upstream by now.