*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / rst-linker / rst-linker-1.11.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( pypy3 python{2_7,3_{6,7}} )
7
8 inherit distutils-r1
9
10 MY_PN="${PN/-/.}"
11 DESCRIPTION="Sphinx plugin to add links and timestamps to the changelog"
12 HOMEPAGE="https://github.com/jaraco/rst.linker"
13 SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
14
15 LICENSE="MIT"
16 SLOT="0"
17 KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
18 IUSE="doc test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         dev-python/importlib_metadata[${PYTHON_USEDEP}]
23         dev-python/python-dateutil[${PYTHON_USEDEP}]
24         dev-python/six[${PYTHON_USEDEP}]
25 "
26 DEPEND="
27         dev-python/setuptools[${PYTHON_USEDEP}]
28         >=dev-python/setuptools_scm-1.15.0[${PYTHON_USEDEP}]
29         doc? (
30                 >=dev-python/jaraco-packaging-3.2[${PYTHON_USEDEP}]
31                 dev-python/sphinx[${PYTHON_USEDEP}]
32         )
33         test? (
34                 ${RDEPEND}
35                 dev-python/path-py[${PYTHON_USEDEP}]
36                 >=dev-python/pytest-3.4[${PYTHON_USEDEP}]
37         )
38 "
39
40 S="${WORKDIR}/${MY_PN}-${PV}"
41
42 python_compile_all() {
43         if use doc; then
44                 sphinx-build docs docs/_build/html || die
45                 HTML_DOCS=( docs/_build/html/. )
46         fi
47 }
48
49 python_test() {
50         # Ignore the module from ${S}, use the one from ${BUILD_DIR}
51         # Otherwise, ImportMismatchError may occur
52         # https://github.com/gentoo/gentoo/pull/1622#issuecomment-224482396
53         # Override pytest options to skip flake8
54         py.test -v --ignore=rst --override-ini="addopts=--doctest-modules" \
55                 || die "tests failed with ${EPYTHON}"
56 }