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