1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build-system
7, cython
8, poetry-core
9, setuptools
10
11# propagates
12, cryptography
13
14# tests
15, pytestCheckHook
16}:
17
18let
19 pname = "chacha20poly1305-reuseable";
20 version = "0.4.2";
21in
22
23buildPythonPackage {
24 inherit pname version;
25 format = "pyproject";
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "bdraco";
31 repo = pname;
32 rev = "v${version}";
33 hash = "sha256-RBXEumw5A/XzB/LazUcvq8JM/Ahvcy9lCTYKpGcY7go=";
34 };
35
36 nativeBuildInputs = [
37 cython
38 poetry-core
39 setuptools
40 ];
41
42 propagatedBuildInputs = [
43 cryptography
44 ];
45
46 pythonImportsCheck = [
47 "chacha20poly1305_reuseable"
48 ];
49
50 preCheck = ''
51 substituteInPlace pyproject.toml \
52 --replace "--cov=chacha20poly1305_reuseable --cov-report=term-missing:skip-covered" ""
53 '';
54
55 nativeCheckInputs = [
56 pytestCheckHook
57 ];
58
59 meta = with lib; {
60 description = "ChaCha20Poly1305 that is reuseable for asyncio";
61 homepage = "https://github.com/bdraco/chacha20poly1305-reuseable";
62 changelog = "https://github.com/bdraco/chacha20poly1305-reuseable/blob/v${version}/CHANGELOG.md";
63 license = licenses.asl20;
64 maintainers = with maintainers; [ hexa ];
65 };
66}