dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / dev-python / psutil / psutil-5.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 PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} 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 RESTRICT="!test? ( test )"
18
19 DEPEND="
20         test? (
21                 $(python_gen_cond_dep '
22                         dev-python/mock[${PYTHON_USEDEP}]
23                         dev-python/ipaddress[${PYTHON_USEDEP}]
24                 ' -2)
25         )
26 "
27
28 PATCHES=(
29         "${FILESDIR}/psutil-5.7.0-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 "${EPYTHON}" psutil/tests/runner.py ||
41                 die "tests failed with ${EPYTHON}"
42 }
43
44 python_compile() {
45         # force -j1 to avoid .o linking race conditions
46         local MAKEOPTS=-j1
47         distutils-r1_python_compile
48 }