2020-04-24 23:36:52 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, isPy27, python
|
|
|
|
, darwin
|
2021-03-19 17:17:44 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
|
|
|
, ipaddress
|
2020-08-20 17:08:02 +00:00
|
|
|
, unittest2
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "psutil";
|
2021-01-15 22:18:51 +00:00
|
|
|
version = "5.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-01-15 22:18:51 +00:00
|
|
|
sha256 = "1immnj532bnnrh1qmk5q3lsw3san8qfk9kxy1cpmy0knmfcwp70c";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# arch doesn't report frequency is the same way
|
|
|
|
# tests segfaults on darwin https://github.com/giampaolo/psutil/issues/1715
|
2020-06-15 15:56:04 +00:00
|
|
|
doCheck = !stdenv.isDarwin && stdenv.isx86_64;
|
2021-03-19 17:17:44 +00:00
|
|
|
checkInputs = [ pytestCheckHook ]
|
2020-08-20 17:08:02 +00:00
|
|
|
++ lib.optionals isPy27 [ mock ipaddress unittest2 ];
|
2021-03-19 17:17:44 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"$out/${python.sitePackages}/psutil/tests/test_system.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
# disable tests which don't work in sandbox
|
|
|
|
# cpu_times is flakey on darwin
|
2021-03-19 17:17:44 +00:00
|
|
|
disabledTests = [
|
|
|
|
"user"
|
|
|
|
"disk_io_counters"
|
|
|
|
"sensors_battery"
|
|
|
|
"cpu_times"
|
|
|
|
"cpu_freq"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.IOKit ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "psutil" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Process and system utilization information interface for python";
|
|
|
|
homepage = "https://github.com/giampaolo/psutil";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ jonringer ];
|
|
|
|
};
|
|
|
|
}
|