at 23.11-beta 2.0 kB view raw
1{ lib 2, stdenv 3, buildPythonPackage 4, CoreFoundation 5, fetchPypi 6, IOKit 7, pytestCheckHook 8, python 9, pythonOlder 10}: 11 12buildPythonPackage rec { 13 pname = "psutil"; 14 version = "5.9.6"; 15 format = "setuptools"; 16 17 inherit stdenv; 18 19 disabled = pythonOlder "3.7"; 20 21 src = fetchPypi { 22 inherit pname version; 23 hash = "sha256-5Lkt3NfdTN0/kAGA6h4QSTLHvOI0+4iXbio7KWRBIlo="; 24 }; 25 26 buildInputs = 27 # workaround for https://github.com/NixOS/nixpkgs/issues/146760 28 lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ 29 CoreFoundation 30 ] ++ lib.optionals stdenv.isDarwin [ 31 IOKit 32 ]; 33 34 nativeCheckInputs = [ 35 pytestCheckHook 36 ]; 37 38 # Segfaults on darwin: 39 # https://github.com/giampaolo/psutil/issues/1715 40 doCheck = !stdenv.isDarwin; 41 42 # In addition to the issues listed above there are some that occure due to 43 # our sandboxing which we can work around by disabling some tests: 44 # - cpu_times was flaky on darwin 45 # - the other disabled tests are likely due to sanboxing (missing specific errors) 46 pytestFlagsArray = [ 47 # Note: $out must be referenced as test import paths are relative 48 "$out/${python.sitePackages}/psutil/tests/test_system.py" 49 ]; 50 51 disabledTests = [ 52 # Some of the tests have build-system hardware-based impurities (like 53 # reading temperature sensor values). Disable them to avoid the failures 54 # that sometimes result. 55 "cpu_freq" 56 "cpu_times" 57 "disk_io_counters" 58 "sensors_battery" 59 "sensors_temperatures" 60 "user" 61 "test_disk_partitions" # problematic on Hydra's Linux builders, apparently 62 ]; 63 64 pythonImportsCheck = [ 65 "psutil" 66 ]; 67 68 meta = with lib; { 69 description = "Process and system utilization information interface"; 70 homepage = "https://github.com/giampaolo/psutil"; 71 changelog = "https://github.com/giampaolo/psutil/blob/release-${version}/HISTORY.rst"; 72 license = licenses.bsd3; 73 maintainers = with maintainers; [ jonringer ]; 74 }; 75}