about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/aiomysql/default.nix
blob: acd3cc56e4a843da3ff1de474d91af04d3b4e926 (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pymysql
, pythonOlder
, setuptools-scm
, wheel
}:

buildPythonPackage rec {
  pname = "aiomysql";
  version = "0.2.0";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "aio-libs";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-m/EgoBU3e+s3soXyYtACMDSjJfMLBOk/00qPtgawwQ8=";
  };

  patches = [
    # https://github.com/aio-libs/aiomysql/pull/955
    (fetchpatch {
      name = "remove-setuptools-scm-git-archive-dependency.patch";
      url = "https://github.com/aio-libs/aiomysql/commit/fee997d2e848b634a84ce0c4e9025e3b3e761640.patch";
      hash = "sha256-qKcOfdDaA9DLS2fdHOEUW37aCCdtZjN0zsFV9dK/umQ=";
      includes = [ "pyproject.toml" ];
    })
  ];

  nativeBuildInputs = [
    setuptools-scm
    wheel
  ];

  propagatedBuildInputs = [
    pymysql
  ];

  # Tests require MySQL database
  doCheck = false;

  pythonImportsCheck = [
    "aiomysql"
  ];

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