summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pgspecial/default.nix
blob: b481f1e6b4117d5c0540e44f86a9627035834c22 (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
{
  lib,
  buildPythonPackage,
  click,
  configobj,
  fetchPypi,
  postgresql,
  postgresqlTestHook,
  psycopg,
  pytestCheckHook,
  setuptools,
  setuptools-scm,
  sqlparse,
  stdenv,
}:

buildPythonPackage rec {
  pname = "pgspecial";
  version = "2.2.1";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-2mx/zHvve7ATLcIEb3TsZROx/m8MgOVSjWMNFLfEhJ0=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    click
    sqlparse
    psycopg
  ];

  # postgresqlTestHook is not available on Darwin
  doCheck = stdenv.hostPlatform.isLinux;

  nativeCheckInputs = [
    configobj
    pytestCheckHook
    postgresqlTestHook
    postgresql
  ];

  pytestFlagsArray = [ "-vvv" ];

  env = {
    PGDATABASE = "_test_db";
    PGUSER = "postgres";
  };

  disabledTests = [
    "test_slash_d_view_verbose"
    "test_slash_ddp"
    "test_slash_ddp_pattern"
  ];

  meta = {
    description = "Meta-commands handler for Postgres Database";
    homepage = "https://github.com/dbcli/pgspecial";
    changelog = "https://github.com/dbcli/pgspecial/releases/tag/v${version}";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.SuperSandro2000 ];
  };
}