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.2.0";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "ahopkins";
26 repo = "mayim";
27 tag = "v${version}";
28 hash = "sha256-azAx/+y1wrUsacCmQ1SCSkn4svf6GzSfhEW3WJwjoks=";
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 pytestCheckHook
44 pytest-asyncio
45 pytest-cov-stub
46 ]
47 ++ (with optional-dependencies; [
48 postgres
49 mysql
50 sqlite
51 ]);
52
53 pythonImportsCheck = [ "mayim" ];
54
55 meta = with lib; {
56 description = "Asynchronous SQL hydrator";
57 homepage = "https://github.com/ahopkins/mayim";
58 license = licenses.mit;
59 maintainers = with maintainers; [ huyngo ];
60 };
61}