1{ lib
2, aiomysql
3, aiopg
4, aiosqlite
5, asyncmy
6, asyncpg
7, buildPythonPackage
8, fetchFromGitHub
9, pytestCheckHook
10, pythonOlder
11, sqlalchemy
12}:
13
14buildPythonPackage rec {
15 pname = "databases";
16 version = "0.8.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "encode";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-e3iMZBPdldZFuS7FyhbGj9SufnH5hBBt8MEUjixXfqA=";
26 };
27
28 propagatedBuildInputs = [
29 sqlalchemy
30 ];
31
32 passthru.optional-dependencies = {
33 postgresql = [
34 asyncpg
35 ];
36 asyncpg = [
37 asyncpg
38 ];
39 aiopg = [
40 aiopg
41 ];
42 mysql = [
43 aiomysql
44 ];
45 aiomysql = [
46 aiomysql
47 ];
48 asyncmy = [
49 asyncmy
50 ];
51 sqlite = [
52 aiosqlite
53 ];
54 aiosqlite = [
55 aiosqlite
56 ];
57 };
58
59 nativeCheckInputs = [
60 pytestCheckHook
61 ];
62
63 disabledTestPaths = [
64 # circular dependency on starlette
65 "tests/test_integration.py"
66 # TEST_DATABASE_URLS is not set.
67 "tests/test_databases.py"
68 "tests/test_connection_options.py"
69 ];
70
71 pythonImportsCheck = [
72 "databases"
73 ];
74
75 meta = with lib; {
76 description = "Async database support for Python";
77 homepage = "https://github.com/encode/databases";
78 changelog = "https://github.com/encode/databases/releases/tag/${version}";
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ ];
81 # https://github.com/encode/databases/issues/530
82 broken = lib.versionAtLeast sqlalchemy.version "2.0.0";
83 };
84}