aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/aiomysql/default.nix
blob: acaeb0ba783e8fc90981e5d27c35fb1e953a2b13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, buildPythonPackage
, fetchFromGitHub
, pymysql
, pytest
, isPy27
}:

buildPythonPackage rec {
  pname = "aiomysql";
  version = "0.0.20";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "aio-libs";
    repo = pname;
    rev = "v${version}";
    sha256 = "1mxih81zc2k64briirpp5wz4f72l8v05avfyfibaq9fr6lcbih9b";
  };

  propagatedBuildInputs = [
    pymysql
  ];

  checkInputs = [
    pytest
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "PyMySQL>=0.9,<=0.9.2" "PyMySQL"
  '';

  checkPhase = ''
    pytest
  '';

  # tests require mysql database
  doCheck = false;

  meta = with lib; {
    description = "MySQL driver for asyncio";
    homepage = "https://github.com/aio-libs/aiomysql";
    license = licenses.mit;
    maintainers = [ maintainers.costrouc ];
  };
}