about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorcatern <catern@catern.com>2018-07-04 07:54:00 -0400
committerOrivej Desh (NixOS) <40807862+orivej-nixos@users.noreply.github.com>2018-07-04 11:54:00 +0000
commiteb8e68b41b69f335877ce560dae00e93068cd76e (patch)
treee878f655a4f5dd3629fd20bfea4b57143db0c760 /pkgs
parent46c9669878ec5df73b7ba11fdc92cdc3edc5804a (diff)
downloadnixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.tar
nixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.tar.gz
nixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.tar.bz2
nixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.tar.lz
nixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.tar.xz
nixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.tar.zst
nixlib-eb8e68b41b69f335877ce560dae00e93068cd76e.zip
pythonPackages.python-prctl: init at 1.7 (#42353)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/python-prctl/default.nix26
-rw-r--r--pkgs/development/python-modules/python-prctl/skip_bad_tests.patch34
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/python-prctl/default.nix b/pkgs/development/python-modules/python-prctl/default.nix
new file mode 100644
index 000000000000..5d092f5e6eab
--- /dev/null
+++ b/pkgs/development/python-modules/python-prctl/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, libcap
+}:
+
+buildPythonPackage rec {
+  pname = "python-prctl";
+  version = "1.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1njgixnavmwq45r3gpkhn1y760sax204clagg4gzwvvdc5bdbssp";
+  };
+
+  patches = [ ./skip_bad_tests.patch ];
+  buildInputs = [ libcap ];
+
+  meta = {
+    description = "Python(ic) interface to the linux prctl syscall";
+    homepage = https://github.com/seveas/python-prctl;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/python-prctl/skip_bad_tests.patch b/pkgs/development/python-modules/python-prctl/skip_bad_tests.patch
new file mode 100644
index 000000000000..19d70f234a99
--- /dev/null
+++ b/pkgs/development/python-modules/python-prctl/skip_bad_tests.patch
@@ -0,0 +1,34 @@
+--- ./test_prctl.py	2018-01-26 16:02:52.000000000 -0500
++++ ./test_prctl.py	2018-06-21 18:26:43.370065009 -0400
+@@ -154,6 +154,7 @@
+         prctl.set_keepcaps(False)
+         self.assertEqual(prctl.get_keepcaps(), False)
+ 
++    @unittest.skip("No access to /proc in the Nix build sandbox")
+     @require('set_mce_kill')
+     def test_mce_kill(self):
+         """Test the MCE_KILL setting"""
+@@ -173,6 +174,7 @@
+         prctl.set_name(name)
+         self.assertEqual(prctl.get_name(), name[:15])
+ 
++    @unittest.skip("The Nix build sandbox has no_new_privs already enabled")
+     @require('get_no_new_privs')
+     def test_no_new_privs(self):
+         """Test the no_new_privs function"""
+@@ -189,6 +191,7 @@
+                 self.assertNotEqual(sp.returncode, 0)
+             os._exit(0)
+ 
++    @unittest.skip("No access to /proc in the Nix build sandbox")
+     def test_proctitle(self):
+         """Test setting the process title, including too long titles"""
+         title = "This is a test!"
+@@ -225,6 +228,7 @@
+             os._exit(0)
+         self.assertRaises(OSError, prctl.set_ptracer, new_pid)
+ 
++    @unittest.skip("The Nix build sandbox has seccomp already enabled")
+     @require('get_seccomp')
+     def test_seccomp(self):
+         """Test manipulation of the seccomp setting"""
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 5f8530cbc0f2..52ce93f8506e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -440,6 +440,8 @@ in {
 
   python-periphery = callPackage ../development/python-modules/python-periphery { };
 
+  python-prctl = callPackage ../development/python-modules/python-prctl { };
+
   python-sql = callPackage ../development/python-modules/python-sql { };
 
   python-stdnum = callPackage ../development/python-modules/python-stdnum { };