ddcfe184a05db164d3e062f348b9385a00122ff9
[gentoo.git] / dev-python / pyquery / pyquery-1.4.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy{,3} )
7
8 inherit distutils-r1 eutils
9
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"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~s390 ~sh ~sparc ~x86"
17 IUSE="test"
18
19 RDEPEND="
20         >=dev-python/lxml-2.1[${PYTHON_USEDEP}]
21         >dev-python/cssselect-0.7.9[${PYTHON_USEDEP}]
22         >=dev-python/webob-1.1.9[${PYTHON_USEDEP}]"
23 DEPEND="
24         dev-python/setuptools[${PYTHON_USEDEP}]
25         test? ( ${RDEPEND}
26                 dev-python/beautifulsoup[${PYTHON_USEDEP}]
27                 dev-python/requests[${PYTHON_USEDEP}]
28                 dev-python/nose[${PYTHON_USEDEP}]
29                 dev-python/webtest[${PYTHON_USEDEP}]
30                 $(python_gen_cond_dep 'dev-python/restkit[${PYTHON_USEDEP}]' 'python2_7')
31         )"
32
33 RESTRICT+=" !test? ( test )"
34
35 PATCHES=(
36         "${FILESDIR}/pyquery-1.4.1-network-tests.patch"
37         "${FILESDIR}/pyquery-1.4.1-tests-pypy.patch"
38 )
39
40 python_test() {
41         # The suite, it appears, requires this hard setting of PYTHONPATH!
42         PYTHONPATH=. nosetests || die "Tests fail with ${EPYTHON}"
43 }
44
45 pkg_postinst() {
46         optfeature "Support for BeautifulSoup3 as a parser backend" dev-python/beautifulsoup
47 }