summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/databases/default.nix
blob: 4c2aa67393e4738b27df051d3f08802d82680fde (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
{
  lib,
  aiomysql,
  aiopg,
  aiosqlite,
  asyncmy,
  asyncpg,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  setuptools,
  sqlalchemy,
}:

buildPythonPackage rec {
  pname = "databases";
  version = "0.9.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "encode";
    repo = "databases";
    tag = version;
    hash = "sha256-Zf9QqBgDhWAnHdNvzjXtri5rdT00BOjc4YTNzJALldM=";
  };

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [ sqlalchemy ];

  optional-dependencies = {
    postgresql = [ asyncpg ];
    asyncpg = [ asyncpg ];
    aiopg = [ aiopg ];
    mysql = [ aiomysql ];
    aiomysql = [ aiomysql ];
    asyncmy = [ asyncmy ];
    sqlite = [ aiosqlite ];
    aiosqlite = [ aiosqlite ];
  };

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTestPaths = [
    # circular dependency on starlette
    "tests/test_integration.py"
    # TEST_DATABASE_URLS is not set.
    "tests/test_databases.py"
    "tests/test_connection_options.py"
  ];

  pythonImportsCheck = [ "databases" ];

  meta = {
    description = "Async database support for Python";
    homepage = "https://github.com/encode/databases";
    changelog = "https://github.com/encode/databases/releases/tag/${version}";
    license = lib.licenses.bsd3;
    maintainers = [ ];
  };
}