971ff1b20fb065e0c0fe9ac60292e2efa185bfd9
[gentoo.git] / dev-python / sphinxcontrib-issuetracker / sphinxcontrib-issuetracker-0.11-r2.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=( python{2_7,3_5,3_6} pypy )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Extension to sphinx to create links to issue trackers"
11 HOMEPAGE="http://sphinxcontrib-issuetracker.readthedocs.org/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD-2"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="
21         dev-python/namespace-sphinxcontrib[${PYTHON_USEDEP}]
22         dev-python/requests[${PYTHON_USEDEP}]
23         dev-python/sphinx[${PYTHON_USEDEP}]"
24 DEPEND="${RDEPEND}
25         dev-python/setuptools[${PYTHON_USEDEP}]
26         test? (
27                 dev-python/mock[${PYTHON_USEDEP}]
28                 dev-python/pytest[${PYTHON_USEDEP}]
29         )"
30
31 python_prepare_all() {
32         # test requires network access (bug #425694)
33         rm tests/test_builtin_trackers.py || die
34
35         # Tests from tests/test_stylesheet.py require dev-python/PyQt4[X,webkit]
36         # and virtualx.eclass.
37         rm tests/test_stylesheet.py || die
38
39         # Avoid redundant objects.inv from downloading, sed more lightweight
40         if use doc; then
41                 sed -e "s:^intersphinx_mapping:#intersphinx_mapping:" \
42                         -e "s:^                       'sphinx':#:" \
43                         -i doc/conf.py || die
44         fi
45
46         distutils-r1_python_prepare_all
47 }
48
49 python_compile_all() {
50         if use doc; then
51                 emake -C doc html
52                 HTML_DOCS=( doc/_build/html/. )
53         fi
54 }
55
56 python_test() {
57         py.test || die
58 }
59
60 python_install_all() {
61         distutils-r1_python_install_all
62         find "${ED}" -name '*.pth' -delete || die
63 }