Skip to content

Commit

Permalink
python312Packages.cgroup-utils: nose -> tests disabled
Browse files Browse the repository at this point in the history
They require privilaged filesystem access(/proc), so they do not run in
Nix's sandbox.
  • Loading branch information
pyrox0 committed Jul 9, 2024
1 parent dbcc4d6 commit ddda9d9
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions pkgs/development/python-modules/cgroup-utils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,41 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pep8,
nose,
setuptools,
}:

buildPythonPackage rec {
version = "0.8";
format = "setuptools";
pname = "cgroup-utils";

buildInputs = [
pep8
nose
];
# Pep8 tests fail...
doCheck = false;

postPatch = ''
sed -i -e "/argparse/d" setup.py
'';
pyproject = true;

src = fetchFromGitHub {
owner = "peo3";
repo = "cgroup-utils";
rev = "v${version}";
sha256 = "0qnbn8cnq8m14s8s1hcv25xjd55dyb6yy54l5vc7sby5xzzp11fq";
hash = "sha256-2IVw/+/FL33YLpQU783yrZQmexGbwaCRJqEibBmyy2I=";
};

meta = with lib; {
postPatch = ''
sed -i -e "/argparse/d" setup.py
substituteInPlace test_pep8.py --replace-fail \
'print message' 'print(message)'
rm test_pep8.py
'';

build-system = [ setuptools ];

# Importing causes it to check the /sys directory, which isn't allowed, and so
# tests fail. Therefore, tests can't be run.
doCheck = false;

pythonImportsCheck = [ "cgutils" ];

meta = {
description = "Utility tools for control groups of Linux";
mainProgram = "cgutil";
maintainers = with maintainers; [ layus ];
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with lib.maintainers; [ layus ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Plus;
};
}

0 comments on commit ddda9d9

Please sign in to comment.