about summary refs log tree commit diff
path: root/pkgs/development/python-modules/manhole/default.nix
blob: d1ca10b9e81c317ab8ff4c121d1cfaf3d5052abc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  buildPythonPackage,
  fetchPypi,
  pytest,
  requests,
  process-tests,
}:

buildPythonPackage rec {
  pname = "manhole";
  version = "1.8.1";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-Nmj9r4OzPJQ9tOdQ4MVU4xwg9jM4SWiV3U1kEGgNnEs=";
  };

  # 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.
  #
  # TODO: change this back to `doCheck = stdenv.isLinux` after
  # https://github.com/ionelmc/python-manhole/issues/54 is fixed
  doCheck = false;

  nativeCheckInputs = [
    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 lib; {
    homepage = "https://github.com/ionelmc/python-manhole";
    description = "Debugging manhole for Python applications";
    mainProgram = "manhole-cli";
    license = licenses.bsd2;
    maintainers = with maintainers; [ ivan ];
  };
}