1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 wheel,
7
8 psycopg,
9 aiosqlite,
10 asyncmy,
11
12 # test
13 pytest-asyncio,
14 pytest-cov-stub,
15
16 pytestCheckHook,
17}:
18
19buildPythonPackage rec {
20 pname = "mayim";
21 version = "1.1.0";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "ahopkins";
26 repo = "mayim";
27 tag = "v${version}";
28 hash = "sha256-nb0E9kMEJUihaCp8RnqGh0nSyDQo50eL1C4K5lBPlPQ=";
29 };
30
31 build-system = [
32 setuptools
33 wheel
34 ];
35
36 optional-dependencies = {
37 postgres = [ psycopg ] ++ psycopg.optional-dependencies.pool;
38 mysql = [ asyncmy ];
39 sqlite = [ aiosqlite ];
40 };
41
42 nativeCheckInputs =
43 [
44 pytestCheckHook
45 pytest-asyncio
46 pytest-cov-stub
47 ]
48 ++ (with optional-dependencies; [
49 postgres
50 mysql
51 sqlite
52 ]);
53
54 pythonImportsCheck = [ "mayim" ];
55
56 meta = with lib; {
57 description = "Asynchronous SQL hydrator";
58 homepage = "https://github.com/ahopkins/mayim";
59 license = licenses.mit;
60 maintainers = with maintainers; [ huyngo ];
61 };
62}