*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / PyUtilib / PyUtilib-5.6.5.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=( python3_6 )
7 inherit distutils-r1
8
9 DESCRIPTION="A collection of Python utilities"
10 HOMEPAGE="https://github.com/PyUtilib/pyutilib"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="test"
17 RESTRICT="!test? ( test )"
18
19 RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
20 BDEPEND="${RDEPEND}
21         test? (
22                 dev-python/nose[${PYTHON_USEDEP}]
23                 dev-python/six[${PYTHON_USEDEP}]
24         )"
25
26 PATCHES=(
27         "${FILESDIR}/pyutilib-5.6.5-tests.patch"
28 )
29
30 python_prepare() {
31         # shells out to run nosetests
32         rm pyutilib/dev/tests/test_runtests.py || die
33 }
34
35 python_install_all() {
36         distutils-r1_python_install_all
37         find "${ED}" -name '*.pth' -delete || die
38 }
39
40 python_install() {
41         distutils-r1_python_install
42
43         if ! python_is_python3; then
44                 printf "# Placeholder for python2\n" \
45                         > "${D}$(python_get_sitedir)/${PN,,}/__init__.py"
46         fi
47 }
48
49 python_test() {
50         COLUMNS="80" "${EPYTHON}" -W ignore::DeprecationWarning \
51                 -m unittest discover -v || die
52 }