dev-perl/Class-Inspector: amd64 stable
[gentoo.git] / dev-python / cssselect / cssselect-0.9.1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="parses CSS3 Selectors and translates them to XPath 1.0"
11 HOMEPAGE="https://cssselect.readthedocs.io/en/latest/
12         https://pypi.python.org/pypi/cssselect"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
18 IUSE="doc test"
19
20 DEPEND="
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
23         test? ( dev-python/lxml[${PYTHON_USEDEP}] )"
24 RDEPEND=""
25
26 python_prepare_all() {
27         # prevent non essential d'load of files in doc build
28         sed -e 's:intersphinx_:#&:' -i docs/conf.py || die
29         distutils-r1_python_prepare_all
30 }
31
32 python_compile_all() {
33         if use doc ; then
34                 "${PYTHON}" setup.py build_sphinx || die
35         fi
36 }
37
38 python_test() {
39         "${PYTHON}" ${PN}/tests.py -v || die "Tests fail with ${EPYTHON}"
40 }
41
42 python_install_all() {
43         use doc && local HTML_DOCS=( docs/_build/html/. )
44         distutils-r1_python_install_all
45 }