nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 84 lines 2.2 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 setuptools, 7 pytestCheckHook, 8 pytest-instafail, 9 pytest-xdist, 10 gitUpdater, 11}: 12 13buildPythonPackage rec { 14 pname = "psutil"; 15 version = "7.2.1"; 16 pyproject = true; 17 18 src = fetchFromGitHub { 19 owner = "giampaolo"; 20 repo = "psutil"; 21 tag = "release-${version}"; 22 hash = "sha256-HGIFf7E356o0OcgLOPjACmrPXneQt/8IhzyudKKuLdg="; 23 }; 24 25 postPatch = '' 26 # stick to the old SDK name for now 27 # https://developer.apple.com/documentation/iokit/kiomasterportdefault/ 28 # https://developer.apple.com/documentation/iokit/kiomainportdefault/ 29 substituteInPlace psutil/arch/osx/cpu.c \ 30 --replace-fail kIOMainPortDefault kIOMasterPortDefault 31 ''; 32 33 build-system = [ setuptools ]; 34 35 nativeCheckInputs = [ 36 pytestCheckHook 37 pytest-instafail 38 pytest-xdist 39 ]; 40 41 # Segfaults on darwin: 42 # https://github.com/giampaolo/psutil/issues/1715 43 doCheck = !stdenv.hostPlatform.isDarwin; 44 45 # In addition to the issues listed above there are some that occure due to 46 # our sandboxing which we can work around by disabling some tests: 47 # - cpu_times was flaky on darwin 48 # - the other disabled tests are likely due to sandboxing (missing specific errors) 49 enabledTestPaths = [ 50 # Note: $out must be referenced as test import paths are relative 51 "tests/test_system.py" 52 ]; 53 54 disabledTests = [ 55 # Some of the tests have build-system hardware-based impurities (like 56 # reading temperature sensor values). Disable them to avoid the failures 57 # that sometimes result. 58 "cpu_freq" 59 "cpu_times" 60 "disk_io_counters" 61 "sensors_battery" 62 "sensors_temperatures" 63 "user" 64 "test_disk_partitions" # problematic on Hydra's Linux builders, apparently 65 ]; 66 67 preCheck = '' 68 rm -rf psutil 69 ''; 70 71 pythonImportsCheck = [ "psutil" ]; 72 73 passthru.updateScript = gitUpdater { 74 rev-prefix = "release-"; 75 }; 76 77 meta = { 78 description = "Process and system utilization information interface"; 79 homepage = "https://github.com/giampaolo/psutil"; 80 changelog = "https://github.com/giampaolo/psutil/blob/${src.tag}/HISTORY.rst"; 81 license = lib.licenses.bsd3; 82 maintainers = [ ]; 83 }; 84}