dev-perl/Class-Inspector: amd64 stable
[gentoo.git] / dev-python / cssselect / cssselect-1.0.1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
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 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-fbsd"
18 IUSE="doc test"
19
20 # No tests.py file in this release.
21 # Please check on version bumps if it's still missing.
22 RESTRICT="test"
23
24 DEPEND="
25         dev-python/setuptools[${PYTHON_USEDEP}]
26         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
27         test? ( dev-python/lxml[${PYTHON_USEDEP}] )"
28
29 RDEPEND=""
30
31 python_prepare_all() {
32         # prevent non essential d'load of files in doc build
33         sed -e 's:intersphinx_:#&:' -i docs/conf.py || die
34         distutils-r1_python_prepare_all
35 }
36
37 python_compile_all() {
38         if use doc ; then
39                 "${PYTHON}" setup.py build_sphinx || die
40         fi
41 }
42
43 python_test() {
44         "${PYTHON}" ${PN}/tests.py -v || die "Tests fail with ${EPYTHON}"
45 }
46
47 python_install_all() {
48         use doc && local HTML_DOCS=( docs/_build/html/. )
49         distutils-r1_python_install_all
50 }