*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / mock / mock-1.0.1-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 python3_6 pypy3 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="A Python Mocking and Patching Library for Testing"
11 HOMEPAGE="http://www.voidspace.org.uk/python/mock/ https://pypi.org/project/mock/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 # dev-python/unittest2 is not required with Python >=3.2.
21 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
22         test? (
23                 dev-python/nose[${PYTHON_USEDEP}]
24                 $(python_gen_cond_dep 'dev-python/unittest2[${PYTHON_USEDEP}]' python2_7 pypy)
25         )"
26 RDEPEND=""
27
28 PATCHES=( "${FILESDIR}"/${P}-fix-python3.4.patch )
29
30 python_test() {
31         nosetests || die "Tests fail with ${EPYTHON}"
32 }
33
34 python_install_all() {
35         local DOCS=( docs/*.txt )
36
37         distutils-r1_python_install_all
38
39         if use doc; then
40                 dohtml -r html/ -x html/objects.inv -x html/output.txt -x html/_sources
41         fi
42 }