diff --git a/pkgs/development/python-modules/aiopg/default.nix b/pkgs/development/python-modules/aiopg/default.nix new file mode 100644 index 000000000000..cb9cd327e8ce --- /dev/null +++ b/pkgs/development/python-modules/aiopg/default.nix @@ -0,0 +1,42 @@ +{ lib +, async-timeout +, buildPythonPackage +, fetchFromGitHub +, psycopg2 +, pythonOlder +}: + +buildPythonPackage rec { + pname = "aiopg"; + version = "1.2.1"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "aio-libs"; + repo = pname; + rev = "v${version}"; + sha256 = "0c6s2p1fjbdk1ygpl6a1s1rbnsk8gw9kj99pf98nxhb9j3iahas4"; + }; + + propagatedBuildInputs = [ + async-timeout + psycopg2 + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "psycopg2-binary" "psycopg2" + ''; + + # Tests requires a PostgreSQL Docker instance + doCheck = false; + + pythonImportsCheck = [ "aiopg" ]; + + meta = with lib; { + description = "Python library for accessing a PostgreSQL database"; + homepage = "https://aiopg.readthedocs.io/"; + license = with licenses; [ bsd2 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cc390b22213f..ec086cb2c7f2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -311,6 +311,8 @@ in { aionotion = callPackage ../development/python-modules/aionotion { }; + aiopg = callPackage ../development/python-modules/aiopg { }; + aioprocessing = callPackage ../development/python-modules/aioprocessing { }; aiopulse = callPackage ../development/python-modules/aiopulse { };