about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/databases/default.nix
blob: 98e047836d015b59d0681b84960f0821d7c8b924 (plain) (blame)
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
63
64
65
66
67
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, sqlalchemy
, aiocontextvars
, isPy27
, pytestCheckHook
, pymysql
, asyncpg
, aiomysql
, aiosqlite
}:

buildPythonPackage rec {
  pname = "databases";
  version = "0.4.3";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "encode";
    repo = pname;
    rev = version;
    sha256 = "0aq88k7d9036cy6qvlfv9p2dxd6p6fic3j0az43gn6k1ardhdsgf";
  };

  patches = [
    # sqlalchemy 1.4 compat, https://github.com/encode/databases/pull/299
    (fetchpatch {
      url = "https://github.com/encode/databases/commit/9d6e0c024833bd41421f0798a94ef2bbf27a31d5.patch";
      sha256 = "0wz9dz6g88ifvvwlhy249cjvqpx72x99wklzcl7b23srpcvb5gv1";
    })
    (fetchpatch {
      url = "https://github.com/encode/databases/commit/40c41c2b7b3fedae484ad94d81b27ce88a09c5ed.patch";
      sha256 = "0z458l3vkg4faxbnf31lszfby5d10fa9kgxxy4xxcm0py6d8a2pi";
    })
  ];

  propagatedBuildInputs = [
    aiocontextvars
    sqlalchemy
  ];

  checkInputs = [
    aiomysql
    aiosqlite
    asyncpg
    pymysql
    pytestCheckHook
  ];

  disabledTestPaths = [
    # ModuleNotFoundError: No module named 'aiopg'
    "tests/test_connection_options.py"
    # circular dependency on starlette
    "tests/test_integration.py"
    # TEST_DATABASE_URLS is not set.
    "tests/test_databases.py"
  ];

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