0acb7f7ad3e5858eff81831b170062e4f0863abf
[gentoo.git] / dev-python / dulwich / dulwich-0.18.6.ebuild
1 # Copyright 1999-2020 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_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 DEPEND="
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         test? (
23                 dev-python/gevent[${PYTHON_USEDEP}]
24                 dev-python/geventhttpclient[${PYTHON_USEDEP}]
25                 dev-python/mock[${PYTHON_USEDEP}]
26                 dev-python/python-fastimport[${PYTHON_USEDEP}]
27         )"
28
29 DISTUTILS_IN_SOURCE_BUILD=1
30
31 # One test sometimes fails
32 # https://github.com/jelmer/dulwich/issues/541
33 PATCHES=( "${FILESDIR}/${PN}-0.18.3-skip-failing-test.patch" )
34
35 python_compile_all() {
36         use doc && emake -C docs html
37 }
38
39 python_test() {
40         emake check
41 }
42
43 python_install_all() {
44         use doc && local HTML_DOCS=( docs/build/html/. )
45         if use examples; then
46                 insinto "/usr/share/doc/${PF}"
47                 docompress -x "/usr/share/doc/${PF}/examples"
48                 doins -r examples
49         fi
50         distutils-r1_python_install_all
51 }