1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
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"
15 KEYWORDS="amd64 ~arm arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
19 dev-python/docutils[${PYTHON_USEDEP}]
20 <dev-python/mistune-2.0[${PYTHON_USEDEP}]
21 dev-python/setuptools[${PYTHON_USEDEP}]
25 dev-python/pygments[${PYTHON_USEDEP}]
26 $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
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"
38 distutils_enable_tests pytest
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
50 python_install_all() {
51 distutils-r1_python_install_all