pythonPackages.python-prctl: init at 1.7 (#42353)

authored by catern and committed by Orivej Desh (NixOS) eb8e68b4 46c96698

+62
+26
pkgs/development/python-modules/python-prctl/default.nix
···
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 4 + , libcap 5 + }: 6 + 7 + buildPythonPackage rec { 8 + pname = "python-prctl"; 9 + version = "1.7"; 10 + 11 + src = fetchPypi { 12 + inherit pname version; 13 + sha256 = "1njgixnavmwq45r3gpkhn1y760sax204clagg4gzwvvdc5bdbssp"; 14 + }; 15 + 16 + patches = [ ./skip_bad_tests.patch ]; 17 + buildInputs = [ libcap ]; 18 + 19 + meta = { 20 + description = "Python(ic) interface to the linux prctl syscall"; 21 + homepage = https://github.com/seveas/python-prctl; 22 + license = lib.licenses.gpl3; 23 + platforms = lib.platforms.linux; 24 + maintainers = with lib.maintainers; [ catern ]; 25 + }; 26 + }
+34
pkgs/development/python-modules/python-prctl/skip_bad_tests.patch
···
··· 1 + --- ./test_prctl.py 2018-01-26 16:02:52.000000000 -0500 2 + +++ ./test_prctl.py 2018-06-21 18:26:43.370065009 -0400 3 + @@ -154,6 +154,7 @@ 4 + prctl.set_keepcaps(False) 5 + self.assertEqual(prctl.get_keepcaps(), False) 6 + 7 + + @unittest.skip("No access to /proc in the Nix build sandbox") 8 + @require('set_mce_kill') 9 + def test_mce_kill(self): 10 + """Test the MCE_KILL setting""" 11 + @@ -173,6 +174,7 @@ 12 + prctl.set_name(name) 13 + self.assertEqual(prctl.get_name(), name[:15]) 14 + 15 + + @unittest.skip("The Nix build sandbox has no_new_privs already enabled") 16 + @require('get_no_new_privs') 17 + def test_no_new_privs(self): 18 + """Test the no_new_privs function""" 19 + @@ -189,6 +191,7 @@ 20 + self.assertNotEqual(sp.returncode, 0) 21 + os._exit(0) 22 + 23 + + @unittest.skip("No access to /proc in the Nix build sandbox") 24 + def test_proctitle(self): 25 + """Test setting the process title, including too long titles""" 26 + title = "This is a test!" 27 + @@ -225,6 +228,7 @@ 28 + os._exit(0) 29 + self.assertRaises(OSError, prctl.set_ptracer, new_pid) 30 + 31 + + @unittest.skip("The Nix build sandbox has seccomp already enabled") 32 + @require('get_seccomp') 33 + def test_seccomp(self): 34 + """Test manipulation of the seccomp setting"""
+2
pkgs/top-level/python-packages.nix
··· 440 441 python-periphery = callPackage ../development/python-modules/python-periphery { }; 442 443 python-sql = callPackage ../development/python-modules/python-sql { }; 444 445 python-stdnum = callPackage ../development/python-modules/python-stdnum { };
··· 440 441 python-periphery = callPackage ../development/python-modules/python-periphery { }; 442 443 + python-prctl = callPackage ../development/python-modules/python-prctl { }; 444 + 445 python-sql = callPackage ../development/python-modules/python-sql { }; 446 447 python-stdnum = callPackage ../development/python-modules/python-stdnum { };