summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/aiomysql/default.nix
blob: 57ec0b009e4100a08e4e55e3ae63b3d3bd3ecac1 (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
48
49
50
51
52
53
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  setuptools-scm,

  # dependencies
  pymysql,
}:

buildPythonPackage (finalAttrs: {
  pname = "aiomysql";
  version = "0.3.2";
  pyproject = true;
  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "aio-libs";
    repo = "aiomysql";
    tag = "v${finalAttrs.version}";
    hash = "sha256-DBNLmroR1W/gsYtW0iGNpki6EYUq6MyHI2pCRdyapU4=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail \
        "setuptools_scm[toml] >= 7, < 10" \
        "setuptools_scm[toml]"
  '';

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [ pymysql ];

  # Tests require MySQL database
  doCheck = false;

  pythonImportsCheck = [ "aiomysql" ];

  meta = {
    description = "MySQL driver for asyncio";
    homepage = "https://github.com/aio-libs/aiomysql";
    changelog = "https://github.com/aio-libs/aiomysql/blob/${finalAttrs.src.rev}/CHANGES.txt";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
})