1{ lib
2, stdenv
3, fetchFromGitHub
4, buildPythonPackage
5, poetry-core
6, pytest-rerunfailures
7, pytestCheckHook
8, procps
9, tmux
10, ncurses
11}:
12
13buildPythonPackage rec {
14 pname = "libtmux";
15 version = "0.23.2";
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "tmux-python";
20 repo = pname;
21 rev = "refs/tags/v${version}";
22 hash = "sha256-W1gBhukBooPo8uej6i8i3UxLuDeBBeSX5xU50SyjjlA=";
23 };
24
25 postPatch = ''
26 sed -i '/addopts/d' setup.cfg
27 '';
28
29 nativeBuildInputs = [
30 poetry-core
31 ];
32
33 nativeCheckInputs = [
34 procps
35 tmux
36 ncurses
37 pytest-rerunfailures
38 pytestCheckHook
39 ];
40
41 pytestFlagsArray = [ "tests" ];
42
43 disabledTests = [
44 # Fail with: 'no server running on /tmp/tmux-1000/libtmux_test8sorutj1'.
45 "test_new_session_width_height"
46 # Assertion error
47 "test_capture_pane_start"
48 ] ++ lib.optionals stdenv.isDarwin [
49 # tests/test_pane.py:113: AssertionError
50 "test_capture_pane_start"
51 ];
52
53 disabledTestPaths = lib.optionals stdenv.isDarwin [
54 "tests/test_test.py"
55 "tests/legacy_api/test_test.py"
56 ];
57
58 pythonImportsCheck = [
59 "libtmux"
60 ];
61
62 meta = with lib; {
63 description = "Typed scripting library / ORM / API wrapper for tmux";
64 homepage = "https://libtmux.git-pull.com/";
65 changelog = "https://github.com/tmux-python/libtmux/raw/v${version}/CHANGES";
66 license = licenses.mit;
67 maintainers = with maintainers; [ ];
68 };
69}