diff --git a/setup.py b/setup.py index 5a99fd1bf..48fbc44cf 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,16 @@ def has_environment_marker_platform_impl_support(): extras_require = {} if has_environment_marker_platform_impl_support(): + extras_require[':platform_python_implementation == "CPython"'] = [ + 'lxml>=3.5.0', + ] extras_require[':platform_python_implementation == "PyPy"'] = [ + # Earlier lxml versions are affected by + # https://bitbucket.org/pypy/pypy/issues/2498/cython-on-pypy-3-dict-object-has-no, + # which was fixed in Cython 0.26, released on 2017-06-19, and used to + # generate the C headers of lxml release tarballs published since then, the + # first of which was: + 'lxml>=4.0.0', 'PyPyDispatcher>=2.1.0', ] @@ -71,7 +80,6 @@ setup( 'Twisted>=17.9.0', 'cryptography>=2.0', 'cssselect>=0.9.1', - 'lxml>=3.5.0', 'parsel>=1.5.0', 'PyDispatcher>=2.0.5', 'pyOpenSSL>=16.2.0', diff --git a/tox.ini b/tox.ini index fd807f971..bff758878 100644 --- a/tox.ini +++ b/tox.ini @@ -107,9 +107,8 @@ basepython = {[testenv:pypy3]basepython} commands = {[testenv:pypy3]commands} deps = {[pinned-common]deps} - # https://github.com/lxml/lxml/pull/187 - lxml==3.6.0 - + lxml==4.0.0 + PyPyDispatcher==2.1.0 [docs] changedir = docs