*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / whoosh / whoosh-2.6.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 PYTHON_COMPAT=( python2_7 python3_6 )
7
8 MY_PN="Whoosh"
9
10 inherit distutils-r1
11
12 DESCRIPTION="Fast, pure-Python full text indexing, search and spell checking library"
13 HOMEPAGE="https://bitbucket.org/mchaput/whoosh/wiki/Home/ https://pypi.org/project/Whoosh/"
14 SRC_URI="mirror://pypi/W/${MY_PN}/${MY_PN}-${PV}.zip"
15
16 DEPEND="app-arch/unzip
17         dev-python/setuptools[${PYTHON_USEDEP}]
18         test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
19
20 LICENSE="BSD-2"
21 SLOT="0"
22 KEYWORDS="amd64 x86"
23 IUSE="doc test"
24 RESTRICT="!test? ( test )"
25
26 S="${WORKDIR}/${MY_PN}-${PV}"
27
28 python_prepare_all() {
29         # (backport from upstream)
30         sed -i -e '/cmdclass/s:pytest:PyTest:' setup.py || die
31
32         # Prevent un-needed download during build
33         sed -e "/^              'sphinx.ext.intersphinx',/d" -i docs/source/conf.py || die
34
35         distutils-r1_python_prepare_all
36 }
37
38 python_compile_all() {
39         # https://bitbucket.org/mchaput/whoosh/issue/403/
40         use doc && sphinx-build -b html -c docs/source/ docs/source/ docs/source/build/html
41 }
42
43 python_test() {
44         esetup.py test
45 }
46
47 python_install_all() {
48         local DOCS=( README.txt )
49         use doc && local HTML_DOCS=( docs/source/build/html/. )
50         distutils-r1_python_install_all
51 }