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