1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, sqlalchemy
5, aiocontextvars
6, isPy27
7, pytest
8, asyncpg
9, aiomysql
10, aiosqlite
11}:
12
13buildPythonPackage rec {
14 pname = "databases";
15 version = "0.2.6";
16 disabled = isPy27;
17
18 src = fetchFromGitHub {
19 owner = "encode";
20 repo = pname;
21 rev = version;
22 sha256 = "0cdb4vln4zdmqbbcj7711b81b2l64jg1miihqcg8gpi35v404h2q";
23 };
24
25 propagatedBuildInputs = [
26 sqlalchemy
27 aiocontextvars
28 ];
29
30 checkInputs = [
31 pytest
32 asyncpg
33 aiomysql
34 aiosqlite
35 ];
36
37 # big chunk to tests depend on existing posgresql and mysql databases
38 # some tests are better than no tests
39 checkPhase = ''
40 pytest --ignore=tests/test_integration.py --ignore=tests/test_databases.py
41 '';
42
43 meta = with lib; {
44 description = "Async database support for Python";
45 homepage = https://github.com/encode/databases;
46 license = licenses.bsd3;
47 maintainers = [ maintainers.costrouc ];
48 };
49}