1{
2 lib,
3 buildPythonPackage,
4 dirty-equals,
5 fastapi,
6 fetchFromGitHub,
7 pdm-backend,
8 pydantic,
9 pytest-asyncio,
10 pytest7CheckHook,
11 pythonOlder,
12 sqlalchemy,
13}:
14
15buildPythonPackage rec {
16 pname = "sqlmodel";
17 version = "0.0.18";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "tiangolo";
24 repo = "sqlmodel";
25 rev = "refs/tags/${version}";
26 hash = "sha256-2ens+wEFJThccBTBeBy8j1AzKJtebg3dJTGG6+Cpt+Q=";
27 };
28
29 build-system = [ pdm-backend ];
30
31 dependencies = [
32 pydantic
33 sqlalchemy
34 ];
35
36 nativeCheckInputs = [
37 dirty-equals
38 fastapi
39 pytest-asyncio
40 pytest7CheckHook
41 ];
42
43 pythonImportsCheck = [ "sqlmodel" ];
44
45 disabledTests = [
46 # AssertionError: assert 'enum_field VARCHAR(1)
47 "test_sqlite_ddl_sql"
48 ];
49
50 disabledTestPaths = [
51 # Coverage
52 "docs_src/tutorial/"
53 "tests/test_tutorial/"
54 ];
55
56 meta = with lib; {
57 description = "Module to work with SQL databases";
58 homepage = "https://github.com/tiangolo/sqlmodel";
59 changelog = "https://github.com/tiangolo/sqlmodel/releases/tag/${version}";
60 license = licenses.mit;
61 maintainers = with maintainers; [ fab ];
62 };
63}