1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7} )
8 inherit distutils-r1 eutils
10 DESCRIPTION="A jQuery-like library for python"
11 HOMEPAGE="https://github.com/gawel/pyquery"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~s390 ~sparc ~x86"
18 RESTRICT="!test? ( test )"
21 >=dev-python/lxml-2.1[${PYTHON_USEDEP}]
22 >dev-python/cssselect-0.7.9[${PYTHON_USEDEP}]
23 >=dev-python/webob-1.1.9[${PYTHON_USEDEP}]"
25 dev-python/setuptools[${PYTHON_USEDEP}]
27 dev-python/beautifulsoup[${PYTHON_USEDEP}]
28 dev-python/requests[${PYTHON_USEDEP}]
29 dev-python/nose[${PYTHON_USEDEP}]
30 dev-python/webtest[${PYTHON_USEDEP}]
31 $(python_gen_cond_dep 'dev-python/restkit[${PYTHON_USEDEP}]' 'python2_7') )"
33 python_prepare_all() {
34 # Disable tests needing a network connection
35 sed -i -e "s/HAS_REQUEST = True/HAS_REQUEST = False/" tests/test_pyquery.py || die
36 distutils-r1_python_prepare_all
40 # The suite, it appears, requires this hard setting of PYTHONPATH!
41 PYTHONPATH=. nosetests || die "Tests fail with ${EPYTHON}"
45 optfeature "Support for BeautifulSoup3 as a parser backend" dev-python/beautifulsoup