2019-12-29 18:07:02 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pymysql
|
|
|
|
, pytest
|
|
|
|
, isPy27
|
2021-05-07 23:54:01 +01:00
|
|
|
, fetchpatch
|
2019-12-29 18:07:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiomysql";
|
2020-11-29 14:04:22 +00:00
|
|
|
version = "0.0.21";
|
2019-12-29 18:07:02 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aio-libs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-11-29 14:04:22 +00:00
|
|
|
sha256 = "1qvy3phbsxp55161dnppjfx2m1kn82v0irc3xzqw0adfd81vaiad";
|
2019-12-29 18:07:02 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 23:54:01 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# vendor functions previously provided by pymysql.util
|
|
|
|
url = "https://github.com/aio-libs/aiomysql/pull/554/commits/919b997a9de7f53d721af76762fba425e306531e.patch";
|
|
|
|
sha256 = "V1VYyqr6RwTXoVoGVyMuJst6uqTuuHbpMOpLoVZO1XA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-12-29 18:07:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pymysql
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2020-12-26 19:25:46 +00:00
|
|
|
--replace "PyMySQL>=0.9,<=0.9.3" "PyMySQL"
|
2019-12-29 18:07:02 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
pytest
|
|
|
|
'';
|
|
|
|
|
|
|
|
# tests require mysql database
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "MySQL driver for asyncio";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/aio-libs/aiomysql";
|
2019-12-29 18:07:02 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|