about summary refs log tree commit diff
path: root/pkgs/development/python-modules/sqliteschema/default.nix
blob: cb73b6e5a606b1c0c6cfedb546ff6d98b6c1421c (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, mbstrdecoder
, setuptools
, simplesqlite
, sqliteschema
, tabledata
, typepy
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "sqliteschema";
  version = "1.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "thombashi";
    repo = "sqliteschema";
    rev = "v${version}";
    hash = "sha256-IzHdYBnh6udVsanWTPSsX4p4PG934YCdzs9Ow/NW86E=";
  };

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    mbstrdecoder
    tabledata
    typepy
  ];

  nativeCheckInputs = [
    pytestCheckHook
    simplesqlite
    sqliteschema
  ];

  pythonImportsCheck = [ "sqliteschema" ];

  # Enabling tests would trigger infinite recursion due to circular
  # dependency between this package and simplesqlite.
  # Therefore, we enable tests only when building passthru.tests.
  doCheck = false;
  passthru.tests.pytest = sqliteschema.overridePythonAttrs (_: {
    doCheck = true;
  });

  meta = with lib; {
    description = "Python library to dump table schema of a SQLite database file";
    homepage = "https://github.com/thombashi/sqliteschema";
    license = licenses.mit;
    maintainers = with maintainers; [ henrirosten ];
  };
}