1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pymysql,
7 pythonOlder,
8 setuptools,
9 setuptools-scm,
10 wheel,
11}:
12
13buildPythonPackage rec {
14 pname = "aiomysql";
15 version = "0.2.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "aio-libs";
22 repo = "aiomysql";
23 tag = "v${version}";
24 hash = "sha256-m/EgoBU3e+s3soXyYtACMDSjJfMLBOk/00qPtgawwQ8=";
25 };
26
27 patches = [
28 # https://github.com/aio-libs/aiomysql/pull/955
29 (fetchpatch {
30 name = "remove-setuptools-scm-git-archive-dependency.patch";
31 url = "https://github.com/aio-libs/aiomysql/commit/fee997d2e848b634a84ce0c4e9025e3b3e761640.patch";
32 hash = "sha256-qKcOfdDaA9DLS2fdHOEUW37aCCdtZjN0zsFV9dK/umQ=";
33 includes = [ "pyproject.toml" ];
34 })
35 ];
36
37 nativeBuildInputs = [
38 setuptools
39 setuptools-scm
40 wheel
41 ];
42
43 propagatedBuildInputs = [ pymysql ];
44
45 # Tests require MySQL database
46 doCheck = false;
47
48 pythonImportsCheck = [ "aiomysql" ];
49
50 meta = with lib; {
51 description = "MySQL driver for asyncio";
52 homepage = "https://github.com/aio-libs/aiomysql";
53 license = licenses.mit;
54 maintainers = [ ];
55 };
56}