diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix index 088541552ec2..b461bc6fdcf0 100644 --- a/pkgs/development/python-modules/psutil/default.nix +++ b/pkgs/development/python-modules/psutil/default.nix @@ -1,29 +1,42 @@ -{ lib, stdenv, buildPythonPackage, fetchPypi, isPy27, python -, CoreFoundation, IOKit +{ lib +, stdenv +, buildPythonPackage +, CoreFoundation +, fetchPypi +, IOKit , pytestCheckHook -, mock -, unittest2 +, python +, pythonOlder }: buildPythonPackage rec { pname = "psutil"; - version = "5.9.2"; + version = "5.9.3"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-/rhhoQtsO7AHAQY7N+Svx1T4IX8PCcQigFhr1qxxK1w="; + hash = "sha256-fM/N/qT8SwoCyiwx3n/NGGvrnP+CB4AOFKtm95x3OvY="; }; - # We have many test failures on various parts of the package: - # - segfaults on darwin: - # https://github.com/giampaolo/psutil/issues/1715 - # - swap (on linux) might cause test failures if it is fully used: - # https://github.com/giampaolo/psutil/issues/1911 - # - some mount paths are required in the build sanbox to make the tests succeed: - # https://github.com/giampaolo/psutil/issues/1912 - doCheck = false; - checkInputs = [ pytestCheckHook ] - ++ lib.optionals isPy27 [ mock unittest2 ]; + buildInputs = + # workaround for https://github.com/NixOS/nixpkgs/issues/146760 + lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ + CoreFoundation + ] ++ lib.optionals stdenv.isDarwin [ + IOKit + ]; + + checkInputs = [ + pytestCheckHook + ]; + + # Segfaults on darwin: + # https://github.com/giampaolo/psutil/issues/1715 + doCheck = !stdenv.isDarwin; + # In addition to the issues listed above there are some that occure due to # our sandboxing which we can work around by disabling some tests: # - cpu_times was flaky on darwin @@ -34,22 +47,19 @@ buildPythonPackage rec { # Note: $out must be referenced as test import paths are relative disabledTests = [ - "user" + "cpu_freq" + "cpu_times" "disk_io_counters" "sensors_battery" - "cpu_times" - "cpu_freq" + "user" ]; - buildInputs = - # workaround for https://github.com/NixOS/nixpkgs/issues/146760 - lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ CoreFoundation ] ++ - lib.optionals stdenv.isDarwin [ IOKit ]; - - pythonImportsCheck = [ "psutil" ]; + pythonImportsCheck = [ + "psutil" + ]; meta = with lib; { - description = "Process and system utilization information interface for python"; + description = "Process and system utilization information interface"; homepage = "https://github.com/giampaolo/psutil"; license = licenses.bsd3; maintainers = with maintainers; [ jonringer ];