summary refs log tree commit diff
path: root/pkgs/by-name/mi/migra/package.nix
blob: 8fd3ef6332edc25ef921ca6e3e88b6ae4559d812 (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
{ lib
, python3
, fetchFromGitHub
, postgresql
, postgresqlTestHook
,
}:
python3.pkgs.buildPythonApplication rec {
  pname = "migra";
  version = "3.0.1647431138";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "djrobstep";
    repo = pname;
    rev = version;
    hash = "sha256-LSCJA5Ym1LuV3EZl6gnl9jTHGc8A1LXmR1fj0ZZc+po=";
  };

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

  propagatedBuildInputs = with python3.pkgs; [
    schemainspect
    six
    sqlbag
  ];

  nativeCheckInputs = with python3.pkgs; [
    pytestCheckHook
    postgresql
    postgresqlTestHook
  ];
  preCheck = ''
    export PGUSER="nixbld";
  '';
  disabledTests = [
    # These all fail with "List argument must consist only of tuples or dictionaries":
    # See this issue: https://github.com/djrobstep/migra/issues/232
    "test_excludeschema"
    "test_fixtures"
    "test_rls"
    "test_singleschema"
  ];

  pytestFlagsArray = [
    "-x"
    "-svv"
    "tests"
  ];

  meta = with lib; {
    description = "Like diff but for PostgreSQL schemas";
    homepage = "https://github.com/djrobstep/migra";
    license = with licenses; [ unlicense ];
    maintainers = with maintainers; [ soispha ];
  };
}