about summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiohttp-fast-zlib/default.nix
blob: e770098d63b3af9951d4ab2ad2d97c132400fed5 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  aiohttp,
  isal,
  zlib-ng,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "aiohttp-fast-zlib";
  version = "0.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "bdraco";
    repo = "aiohttp-fast-zlib";
    rev = "v${version}";
    hash = "sha256-nR/0hVe5zAhLXu+kBOBH+whIjUV44c5yuNOj+Zl+eFo=";
  };

  postPatch = ''
    sed -i "/addopts =/d" pyproject.toml
  '';

  build-system = [ poetry-core ];

  dependencies = [ aiohttp ];

  optional-dependencies = {
    isal = [ isal ];
    zlib_ng = [ zlib-ng ];
  };

  nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);

  pythonImportsCheck = [ "aiohttp_fast_zlib" ];

  meta = with lib; {
    description = "Use the fastest installed zlib compatible library with aiohttp";
    homepage = "https://github.com/bdraco/aiohttp-fast-zlib";
    changelog = "https://github.com/bdraco/aiohttp-fast-zlib/blob/${src.rev}/CHANGELOG.md";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
  };
}