dev-python/freezegun: amd64 stable wrt bug #706138
[gentoo.git] / dev-python / m2r / m2r-0.2.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Markdown to reStructuredText converter"
10 HOMEPAGE="https://github.com/miyakogi/m2r https://pypi.org/project/m2r/"
11 SRC_URI="https://github.com/miyakogi/m2r/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
16 IUSE="test"
17
18 RDEPEND="
19         dev-python/docutils[${PYTHON_USEDEP}]
20         <dev-python/mistune-2.0[${PYTHON_USEDEP}]
21         dev-python/setuptools[${PYTHON_USEDEP}]
22 "
23 BDEPEND="
24         test? (
25                 dev-python/pygments[${PYTHON_USEDEP}]
26                 $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
27         ${RDEPEND}
28 "
29
30 PATCHES=(
31         # pulled from upstream git
32         "${FILESDIR}/m2r-0.2.1-upstream-fix.patch"
33         "${FILESDIR}/m2r-0.2.1-tests.patch"
34         # skip tests that need internet
35         "${FILESDIR}/m2r-0.2.1-tests-network.patch"
36 )
37
38 distutils_enable_tests pytest
39
40 python_prepare_all() {
41         # fix a Q/A violation, trying to install the tests as an independant package
42         sed -e "s/packages=\['tests'\],/packages=[],/" -i setup.py
43         # add missing test files
44         cp "${FILESDIR}/"test.md tests/ || die
45         cp "${FILESDIR}/"test.rst tests/ || die
46         cp "${FILESDIR}/"m2r.1 "${S}" || die
47         distutils-r1_python_prepare_all
48 }
49
50 python_install_all() {
51         distutils-r1_python_install_all
52         doman m2r.1
53 }