f51bc3406ee7526550bc7b2a3d332e71f92bfa0c
[gentoo.git] / dev-python / pluginbase / pluginbase-0.5.ebuild
1 # Copyright 1999-2020 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_6 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Support library for building plugins sytems in Python"
11 HOMEPAGE="https://github.com/mitsuhiko/pluginbase"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND=""
21 DEPEND="${RDEPEND}
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
24         test? ( dev-python/pytest[${PYTHON_USEDEP}] )
25 "
26
27 python_prepare_all() {
28         sed -e "s/, 'sphinx.ext.intersphinx'//" \
29                 -i docs/conf.py || die
30         distutils-r1_python_prepare_all
31 }
32
33 python_compile_all() {
34         if use doc; then
35                 emake -C docs html
36                 HTML_DOCS=( docs/_build/html/. )
37         fi
38 }
39
40 python_test() {
41         cd tests && PYTHONPATH=.. py.test --tb=native || die "Tests fail with ${EPYTHON}"
42 }