From 0d1d43d49c20a14c253bc73bb1ac2123f2997588 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 21 Feb 2020 20:22:10 -0800 Subject: [PATCH] pythonPackages.psutil: 5.6.7 -> 5.7.0 --- .../python-modules/psutil/default.nix | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix index 388716cb7005..59dd94b30188 100644 --- a/pkgs/development/python-modules/psutil/default.nix +++ b/pkgs/development/python-modules/psutil/default.nix @@ -1,26 +1,41 @@ -{ stdenv -, buildPythonPackage -, fetchPypi +{ lib, stdenv, buildPythonPackage, fetchPypi, isPy27, python , darwin +, pytest +, mock +, ipaddress }: buildPythonPackage rec { pname = "psutil"; - version = "5.6.7"; + version = "5.7.0"; src = fetchPypi { inherit pname version; - sha256 = "ffad8eb2ac614518bbe3c0b8eb9dffdb3a8d2e3a7d5da51c5b974fb723a5c5aa"; + sha256 = "03jykdi3dgf1cdal9bv4fq9zjvzj9l9bs99gi5ar81sdl5nc2pk8"; }; - # No tests in archive - doCheck = false; + # arch doesn't report frequency is the same way + doCheck = stdenv.isx86_64; + checkInputs = [ pytest ] + ++ lib.optionals isPy27 [ mock ipaddress ]; + # out must be referenced as test import paths are relative + # disable tests which don't work in sandbox + # cpu_times is flakey on darwin + checkPhase = '' + pytest $out/${python.sitePackages}/psutil/tests/test_system.py \ + -k 'not user \ + and not disk_io_counters and not sensors_battery \ + and not cpu_times' + ''; - buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.IOKit ]; + buildInputs = lib.optionals stdenv.isDarwin [ darwin.IOKit ]; - meta = { + pythonImportsCheck = [ "psutil" ]; + + meta = with lib; { description = "Process and system utilization information interface for python"; - homepage = https://github.com/giampaolo/psutil; - license = stdenv.lib.licenses.bsd3; + homepage = "https://github.com/giampaolo/psutil"; + license = licenses.bsd3; + maintainers = with maintainers; [ jonringer ]; }; }