summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pgcli/default.nix
blob: 7821a0d96e764d71ba9a498b5b142b82057123ef (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchPypi,
  cli-helpers,
  click,
  configobj,
  prompt-toolkit,
  psycopg,
  pygments,
  sqlparse,
  pgspecial,
  setproctitle,
  keyring,
  pendulum,
  pytestCheckHook,
  setuptools,
  setuptools-scm,
  sshtunnel,
  mock,
  tzlocal,
}:

# this is a pythonPackage because of the ipython line magics in pgcli.magic
# integrating with ipython-sql
buildPythonPackage rec {
  pname = "pgcli";
  version = "4.4.0";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-vV+NaK8o/WlVGjy0iihJytX2hUqkgCLp2YxiNtEJ7q4=";
  };

  pythonRelaxDeps = [ "click" ];

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    cli-helpers
    click
    configobj
    prompt-toolkit
    psycopg
    pygments
    sqlparse
    pgspecial
    setproctitle
    keyring
    pendulum
    sshtunnel
    tzlocal
  ];

  nativeCheckInputs = [
    pytestCheckHook
    mock
  ];

  disabledTests = [
    # requires running postgres and postgresqlTestHook does not work
    "test_application_name_in_env"
    "test_init_command_option"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_application_name_db_uri" ];

  meta = {
    description = "Command-line interface for PostgreSQL";
    mainProgram = "pgcli";
    longDescription = ''
      Rich command-line interface for PostgreSQL with auto-completion and
      syntax highlighting.
    '';
    homepage = "https://pgcli.com";
    changelog = "https://github.com/dbcli/pgcli/raw/v${version}/changelog.rst";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [
      SuperSandro2000
    ];
  };
}