*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / dulwich / dulwich-0.19.4.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=( python{2_7,3_6} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Pure-Python implementation of the Git file formats and protocols"
11 HOMEPAGE="https://github.com/jelmer/dulwich/ https://pypi.org/project/dulwich/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="GPL-2+"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="doc examples test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="
21         dev-python/certifi[${PYTHON_USEDEP}]
22         >=dev-python/urllib3-1.21[${PYTHON_USEDEP}]
23 "
24 DEPEND="
25         dev-python/setuptools[${PYTHON_USEDEP}]
26         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
27         test? (
28                 ${RDEPEND}
29                 dev-python/gevent[${PYTHON_USEDEP}]
30                 dev-python/geventhttpclient[${PYTHON_USEDEP}]
31                 dev-python/mock[${PYTHON_USEDEP}]
32                 dev-python/python-fastimport[${PYTHON_USEDEP}]
33         )"
34
35 DISTUTILS_IN_SOURCE_BUILD=1
36
37 # One test sometimes fails
38 # https://github.com/jelmer/dulwich/issues/541
39 PATCHES=( "${FILESDIR}/${PN}-0.18.3-skip-failing-test.patch" )
40
41 python_compile_all() {
42         use doc && emake -C docs html
43 }
44
45 python_test() {
46         # Do not use make check which rebuilds the extension and uses -Werror,
47         # causing unexpected failures.
48         "${EPYTHON}" -m unittest dulwich.tests.test_suite \
49                 || die "tests failed with ${EPYTHON}"
50 }
51
52 python_install_all() {
53         use doc && local HTML_DOCS=( docs/build/html/. )
54         if use examples; then
55                 docompress -x "/usr/share/doc/${PF}/examples"
56                 dodoc -r examples
57         fi
58         distutils-r1_python_install_all
59 }