2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
async-timeout,
|
|
|
|
uvloop,
|
|
|
|
postgresql,
|
|
|
|
pythonOlder,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
2022-02-10 20:34:41 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "asyncpg";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.29.0";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-0cSeH0T/+v2aVeGpsQFZCFnYgdY56ikiUW9dnFEtNU4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
# sandboxing issues on aarch64-darwin, see https://github.com/NixOS/nixpkgs/issues/198495
|
|
|
|
doCheck = postgresql.doCheck;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# required for compatibility with Python versions older than 3.11
|
|
|
|
# see https://github.com/MagicStack/asyncpg/blob/v0.29.0/asyncpg/_asyncio_compat.py#L13
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ async-timeout ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
uvloop
|
|
|
|
postgresql
|
2023-03-30 22:05:00 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
preCheck = ''
|
|
|
|
rm -rf asyncpg/
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "asyncpg" ];
|
2021-02-17 17:02:09 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-02-10 20:34:41 +00:00
|
|
|
description = "Asyncio PosgtreSQL driver";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/MagicStack/asyncpg";
|
2023-03-30 22:05:00 +00:00
|
|
|
changelog = "https://github.com/MagicStack/asyncpg/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
Asyncpg is a database interface library designed specifically for
|
|
|
|
PostgreSQL and Python/asyncio. asyncpg is an efficient, clean
|
2022-02-10 20:34:41 +00:00
|
|
|
implementation of PostgreSQL server binary protocol for use with Python's
|
2020-04-24 23:36:52 +00:00
|
|
|
asyncio framework.
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|