summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/libtmux/default.nix
blob: 836447ae1b4c0b4189296d51e451bd45a4c5636f (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  hatchling,
  ncurses,
  procps,
  pytest-rerunfailures,
  pytestCheckHook,
  tmux,
}:

buildPythonPackage rec {
  pname = "libtmux";
  version = "0.47.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "tmux-python";
    repo = "libtmux";
    tag = "v${version}";
    hash = "sha256-yrz9fMr33yj/u0uGUNHYv0zOTvtfJ2u0TKToBO8ha6U=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail '"--doctest-docutils-modules",' ""
  '';

  build-system = [ hatchling ];

  nativeCheckInputs = [
    procps
    tmux
    ncurses
    pytest-rerunfailures
    pytestCheckHook
  ];

  enabledTestPaths = [ "tests" ];

  disabledTests = [
    # Fail with: 'no server running on /tmp/tmux-1000/libtmux_test8sorutj1'.
    "test_new_session_width_height"
    # Assertion error
    "test_capture_pane_start"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # tests/test_pane.py:113: AssertionError
    "test_capture_pane_start"
    # assert (1740973920.500444 - 1740973919.015309) <= 1.1
    "test_retry_three_times"
    "test_function_times_out_no_raise"
    # assert False
    "test_retry_three_times_no_raise_assert"
  ];

  disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test/test_retry.py" ];

  pythonImportsCheck = [ "libtmux" ];

  meta = {
    description = "Typed scripting library / ORM / API wrapper for tmux";
    homepage = "https://libtmux.git-pull.com/";
    changelog = "https://github.com/tmux-python/libtmux/raw/v${version}/CHANGES";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ otavio ];
  };
}