*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pytest-shutil / pytest-shutil-1.7.0.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 DISTUTILS_USE_SETUPTOOLS=rdepend
7 PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
8
9 inherit distutils-r1
10
11 DESCRIPTION="A goodie-bag of unix shell and environment tools for py.test"
12 HOMEPAGE="https://github.com/man-group/pytest-plugins https://pypi.org/project/pytest-shutil/"
13 SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="MIT"
16 SLOT="0"
17 KEYWORDS="~amd64 ~hppa ~mips ~s390 ~sparc ~x86"
18 IUSE="test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         dev-python/pytest[${PYTHON_USEDEP}]
23         dev-python/six[${PYTHON_USEDEP}]
24         dev-python/contextlib2[${PYTHON_USEDEP}]
25         dev-python/execnet[${PYTHON_USEDEP}]
26         dev-python/path-py[${PYTHON_USEDEP}]
27         dev-python/mock[${PYTHON_USEDEP}]
28         dev-python/termcolor[${PYTHON_USEDEP}]
29 "
30
31 BDEPEND="
32         ${RDEPEND}
33 "
34
35 python_prepare_all() {
36         # keeps trying to install this in tests
37         sed -i 's:path.py::' setup.py || die
38
39         distutils-r1_python_prepare_all
40 }
41
42 python_test() {
43         # at this point let's not fix python2 stuff
44         if ! python_is_python3; then
45                 ewarn "Tests broken on python2, not runninge tests for ${EPYTHON}"
46                 return 0
47         fi
48
49         distutils_install_for_testing
50
51         esetup.py test || die "Tests failed under ${EPYTHON}"
52 }