1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 pytest,
7 requests,
8 process-tests,
9}:
10
11buildPythonPackage rec {
12 pname = "manhole";
13 version = "1.8.0";
14 format = "setuptools";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "bada20a25b547b395d472e2e08928f0437df26bbdbda4797c55863198e29a21f";
19 };
20
21 # test_help expects architecture-dependent Linux signal numbers.
22 #
23 # {test_locals,test_socket_path} fail to remove /tmp/manhole-socket
24 # on the x86_64-darwin builder.
25 #
26 # TODO: change this back to `doCheck = stdenv.isLinux` after
27 # https://github.com/ionelmc/python-manhole/issues/54 is fixed
28 doCheck = false;
29
30 nativeCheckInputs = [
31 pytest
32 requests
33 process-tests
34 ];
35 checkPhase = ''
36 # Based on its tox.ini
37 export PYTHONUNBUFFERED=yes
38 export PYTHONPATH=.:tests:$PYTHONPATH
39
40 # The tests use manhole-cli
41 export PATH="$PATH:$out/bin"
42
43 # test_uwsgi fails with:
44 # http.client.RemoteDisconnected: Remote end closed connection without response
45 py.test -vv -k "not test_uwsgi"
46 '';
47
48 meta = with lib; {
49 homepage = "https://github.com/ionelmc/python-manhole";
50 description = "Debugging manhole for Python applications";
51 mainProgram = "manhole-cli";
52 license = licenses.bsd2;
53 maintainers = with maintainers; [ ivan ];
54 };
55}