1{ lib
2, async-timeout
3, buildPythonPackage
4, fetchFromGitHub
5, psycopg2
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "aiopg";
11 version = "1.4.0";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "aio-libs";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-GD5lRSUjASTwBk5vEK8v3xD8eNyxpwSrO3HHvtwubmk=";
21 };
22
23 propagatedBuildInputs = [
24 async-timeout
25 psycopg2
26 ];
27
28 postPatch = ''
29 substituteInPlace setup.py \
30 --replace "psycopg2-binary" "psycopg2"
31 '';
32
33 # Tests requires a PostgreSQL Docker instance
34 doCheck = false;
35
36 pythonImportsCheck = [
37 "aiopg"
38 ];
39
40 meta = with lib; {
41 description = "Python library for accessing a PostgreSQL database";
42 homepage = "https://aiopg.readthedocs.io/";
43 license = with licenses; [ bsd2 ];
44 maintainers = with maintainers; [ fab ];
45 };
46}