about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorIvan Kozik <ivan@ludios.org>2018-12-13 06:05:46 +0000
committerIvan Kozik <ivan@ludios.org>2018-12-13 09:07:13 +0000
commite7ec6cdf1183be826807ab3b29166756893b46e7 (patch)
tree028300cd82175311c8d978cce171fd2844632fbf /pkgs
parent158f1300d1cb495d669038243c7a9696186d2d5f (diff)
pythonPackages.manhole: init at 1.5.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/manhole/default.nix44
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/manhole/default.nix b/pkgs/development/python-modules/manhole/default.nix
new file mode 100644
index 0000000000000..8c8c6bf350188
--- /dev/null
+++ b/pkgs/development/python-modules/manhole/default.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, pytest
+, requests
+, process-tests
+}:
+
+buildPythonPackage rec {
+  pname = "manhole";
+  version = "1.5.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "11ivy8qiv87jl2lc1ldhv9dc4jwf3hz7wysdfiagdcd9kkd48v8m";
+  };
+
+  # test_help expects architecture-dependent Linux signal numbers.
+  #
+  # {test_locals,test_socket_path} fail to remove /tmp/manhole-socket
+  # on the x86_64-darwin builder.
+  doCheck = stdenv.isLinux;
+
+  checkInputs = [ pytest requests process-tests ];
+  checkPhase = ''
+    # Based on its tox.ini
+    export PYTHONUNBUFFERED=yes
+    export PYTHONPATH=.:tests:$PYTHONPATH
+
+    # The tests use manhole-cli
+    export PATH="$PATH:$out/bin"
+
+    # test_uwsgi fails with:
+    # http.client.RemoteDisconnected: Remote end closed connection without response
+    py.test -vv -k "not test_uwsgi"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ionelmc/python-manhole;
+    description = "Debugging manhole for Python applications";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ ivan ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 949103211ff8a..4eab3845f3e8d 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -422,6 +422,8 @@ in {
 
   mail-parser = callPackage ../development/python-modules/mail-parser { };
 
+  manhole = callPackage ../development/python-modules/manhole { };
+
   markerlib = callPackage ../development/python-modules/markerlib { };
 
   matchpy = callPackage ../development/python-modules/matchpy { };