*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / dev-python / beautifulsoup / beautifulsoup-4.5.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_{5,6} pypy pypy3 )
7
8 inherit distutils-r1
9
10 MY_PN=${PN}4
11 MY_P=${MY_PN}-${PV}
12
13 DESCRIPTION="Provides pythonic idioms for iterating, searching, and modifying an HTML/XML parse tree"
14 HOMEPAGE="https://bugs.launchpad.net/beautifulsoup/
15         https://pypi.org/project/beautifulsoup4/"
16 SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
17
18 LICENSE="MIT"
19 SLOT="4"
20 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
21
22 IUSE="doc test"
23 RESTRICT="!test? ( test )"
24
25 # html5lib is optional however hard coding since its use is actively discouraged in the devmanual
26 RDEPEND="
27         $(python_gen_cond_dep 'dev-python/html5lib[${PYTHON_USEDEP}]' python2_7 pypy)
28         $(python_gen_cond_dep 'dev-python/lxml[${PYTHON_USEDEP}]' python2_7 'python3*')"
29 DEPEND="
30         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
31         test? ( dev-python/nose[${PYTHON_USEDEP}] )
32         "
33
34 S=${WORKDIR}/${MY_P}
35
36 python_compile_all() {
37         use doc && emake -C doc html
38 }
39
40 python_test() {
41         nosetests --verbose -w "${BUILD_DIR}"/lib || die "Tests fail with ${EPYTHON}"
42 }
43
44 python_install_all() {
45         use doc && local HTML_DOCS=( doc/build/html/. )
46         distutils-r1_python_install_all
47 }