*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / psutil / psutil-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 PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Retrieve information on running processes and system utilization"
10 HOMEPAGE="https://github.com/giampaolo/psutil https://pypi.org/project/psutil/"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="test"
17
18 DEPEND="
19         dev-python/setuptools[${PYTHON_USEDEP}]
20         test? (
21                 dev-python/mock[${PYTHON_USEDEP}]
22                 dev-python/ipaddress[${PYTHON_USEDEP}]
23         )
24 "
25
26 RESTRICT="!test? ( test )"
27
28 PATCHES=(
29         "${FILESDIR}/psutil-5.6.5-tests.patch"
30 )
31
32 python_test() {
33         if [[ ${EPYTHON} == pypy* ]]; then
34                 ewarn "Not running tests on ${EPYTHON} since they are broken"
35                 return 0
36         fi
37
38         # since we are running in an environment a bit similar to CI,
39         # let's skip the tests that are disable for CI
40         TRAVIS=1 APPVEYOR=1 PYTHONPATH="${BUILD_DIR}/lib" ${PYTHON} psutil/tests/__main__.py || \
41                 die "tests failed with ${EPYTHON}"
42 }