1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mbstrdecoder,
6 setuptools,
7 simplesqlite,
8 sqliteschema,
9 tabledata,
10 typepy,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "sqliteschema";
16 version = "1.4.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "thombashi";
21 repo = "sqliteschema";
22 rev = "v${version}";
23 hash = "sha256-IzHdYBnh6udVsanWTPSsX4p4PG934YCdzs9Ow/NW86E=";
24 };
25
26 nativeBuildInputs = [ setuptools ];
27
28 propagatedBuildInputs = [
29 mbstrdecoder
30 tabledata
31 typepy
32 ];
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 simplesqlite
37 sqliteschema
38 ];
39
40 pythonImportsCheck = [ "sqliteschema" ];
41
42 # Enabling tests would trigger infinite recursion due to circular
43 # dependency between this package and simplesqlite.
44 # Therefore, we enable tests only when building passthru.tests.
45 doCheck = false;
46 passthru.tests.pytest = sqliteschema.overridePythonAttrs (_: {
47 doCheck = true;
48 });
49
50 meta = with lib; {
51 description = "Python library to dump table schema of a SQLite database file";
52 homepage = "https://github.com/thombashi/sqliteschema";
53 license = licenses.mit;
54 maintainers = with maintainers; [ henrirosten ];
55 };
56}