citeproc-py icon indicating copy to clipboard operation
citeproc-py copied to clipboard

Remove lxml dependency

Open brechtm opened this issue 8 years ago • 5 comments

ElementTree from the Python standard library should be fast enough. However, it is missing some of lxml's features:

The XPath searches in model.py might require a lot of code to replace.

Losing validation is not a big deal IMO, as a downloaded CSL style file will probably have been validated already.

brechtm avatar Oct 06 '15 09:10 brechtm

Just noting that lxml apparently crashed on pypy according to this commit https://github.com/brechtm/citeproc-py/commit/370e1187c79f8b6229195f37e91a1e853cd892b7 Would be good to make that reproducible and raise a bug upstream.

We could look for a suitable alternative XPath implementation that depends only on the Python standard library ElementTree. Maybe something like https://pypi.python.org/pypi/py-dom-xpath or https://pypi.python.org/pypi/PDIS-XPath , but hopefully a more active project.

jayvdb avatar Oct 20 '15 02:10 jayvdb

The lxml bug is reported here: https://bugs.launchpad.net/lxml/+bug/1503241

brechtm avatar Dec 14 '15 09:12 brechtm

The problem with lxml+PyPy was that PyPy's C api layer was never good enough to run lxml. The official advice used to be that on PyPy you should use their forked lxml-cffi library instead, but just recently (last week) they released a new version of PyPy that fixes the underlying bugs, and now lxml is supported: http://morepypy.blogspot.com.co/2016/02/c-api-support-update.html?m=1

So if you're using the latest version of lxml and PyPy then it should work now (and if it doesn't then probably you should file bugs with PyPy, not lxml).

njsmith avatar Mar 17 '16 17:03 njsmith

Thanks for the update @njsmith . After working around #63, the previous lxml problems have disappeared (or moved from sight). However something else is making the build fail. https://travis-ci.org/jayvdb/citeproc-py/builds/116795654 PyPy passes the nosetests, and fails to run the test suite. PyPy3 fails during the nosetests.

jayvdb avatar Mar 18 '16 01:03 jayvdb

https://bugs.launchpad.net/lxml/+bug/1442427 "lxml fails to install on pypy3" has been marked wont fix with comment

  Marking as "won't fix" because it's up to PyPy to come up with a working pypy3 release.

jayvdb avatar Mar 18 '16 23:03 jayvdb