summary refs log tree commit diff
path: root/pkgs/tools/admin/iredis/default.nix
blob: bc38b606b2e7006d65e7a725e3fbeae5bc53d11e (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ lib
, stdenv
, python3
, fetchFromGitHub
}:

python3.pkgs.buildPythonApplication rec {
  pname = "iredis";
  version = "1.13.2";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "laixintao";
    repo = "iredis";
    rev = "refs/tags/v${version}";
    hash = "sha256-dGOB7emhuP+V0pHlSdS1L1OC4jO3jtf5RFOy0UFYiuY=";
  };

  pythonRelaxDeps = [
    "configobj"
    "wcwidth"
    "click"
    "packaging"
  ];

  nativeBuildInputs = with python3.pkgs; [
    poetry-core
    pythonRelaxDepsHook
  ];

  propagatedBuildInputs = with python3.pkgs; [
    pygments
    click
    configobj
    mistune
    packaging
    pendulum
    prompt-toolkit
    redis
    wcwidth
  ];

  nativeCheckInputs = with python3.pkgs; [
    pytestCheckHook
    pexpect
  ];

  pytestFlagsArray = [
    # Fails on sandbox
    "--ignore=tests/unittests/test_client.py"
    "--deselect=tests/unittests/test_render_functions.py::test_render_unixtime_config_raw"
    "--deselect=tests/unittests/test_render_functions.py::test_render_time"
    # Only execute unittests, because cli tests require a running Redis
    "tests/unittests/"
  ] ++ lib.optionals stdenv.isDarwin [
    # Flaky test
    "--deselect=tests/unittests/test_utils.py::test_timer"
  ];

  pythonImportsCheck = [ "iredis" ];

  meta = with lib; {
    description = "A Terminal Client for Redis with AutoCompletion and Syntax Highlighting";
    changelog = "https://github.com/laixintao/iredis/raw/${src.rev}/CHANGELOG.md";
    homepage = "https://iredis.io/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ marsam ];
  };
}