summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/mayim/default.nix
blob: f4206133a07ac4729c5f3d33b442dede5c8d21be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  wheel,

  psycopg,
  aiosqlite,
  asyncmy,

  # test
  pytest-asyncio,
  pytest-cov-stub,

  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "mayim";
  version = "1.3.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ahopkins";
    repo = "mayim";
    tag = "v${version}";
    hash = "sha256-RJMPqqmvpwvdRTaVznxGunvC0/KlL0z1GUX1VBTCbwo=";
  };

  build-system = [
    setuptools
    wheel
  ];

  optional-dependencies = {
    postgres = [ psycopg ] ++ psycopg.optional-dependencies.pool;
    mysql = [ asyncmy ];
    sqlite = [ aiosqlite ];
  };

  nativeCheckInputs = [
    pytestCheckHook
    pytest-asyncio
    pytest-cov-stub
  ]
  ++ (with optional-dependencies; [
    postgres
    mysql
    sqlite
  ]);

  pythonImportsCheck = [ "mayim" ];

  meta = {
    description = "Asynchronous SQL hydrator";
    homepage = "https://github.com/ahopkins/mayim";
    changelog = "https://github.com/ahopkins/mayim/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ huyngo ];
  };
}