sys-apps/groff: stable 1.22.4 for hppa, bug #704420
[gentoo.git] / dev-python / pygit2 / pygit2-1.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=( python3_{6,7,8} )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Python bindings for libgit2"
10 HOMEPAGE="https://github.com/libgit2/pygit2 https://pypi.org/project/pygit2/"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-2-with-linking-exception"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="test"
17 RESTRICT="!test? ( test )"
18
19 RDEPEND="
20         =dev-libs/libgit2-1.0*
21         dev-python/cached-property[${PYTHON_USEDEP}]
22         >=dev-python/cffi-1.0:=[${PYTHON_USEDEP}]
23 "
24 DEPEND="${RDEPEND}
25         test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
26
27 src_prepare() {
28         distutils-r1_src_prepare
29
30         # unconditionally prevent it from using network
31         sed -i -e '/def no_network/a \
32     return True' test/utils.py || die
33
34         # we need to move them away to prevent pytest from forcing '..'
35         # for imports
36         mkdir hack || die
37         mv test hack/ || die
38         ln -s hack/test test || die
39 }
40
41 python_test() {
42         pytest -vv hack/test || die
43 }