From 98e651e89148eab0afbe420e58fd80c9545f370c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 6 Jul 2022 21:38:42 +0200 Subject: [PATCH] python3Packages.chacha20poly1305-reusable: init at 0.0.4 --- .../chacha20poly1305-reuseable/default.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix diff --git a/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix b/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix new file mode 100644 index 000000000000..8f9408ec2fa2 --- /dev/null +++ b/pkgs/development/python-modules/chacha20poly1305-reuseable/default.nix @@ -0,0 +1,62 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder + +# build +, poetry-core + +# propagates +, cryptography + +# tests +, pytestCheckHook +}: + +let + pname = "chacha20poly1305-reuseable"; + version = "0.0.4"; +in + +buildPythonPackage { + inherit pname version; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "bdraco"; + repo = pname; + rev = "v${version}"; + hash = "sha256-iOGDTQyiznjYblT/NfHxewIwEZsPnp7bdNVD1p9/H1M="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + cryptography + ]; + + pythonImportsCheck = [ + "chacha20poly1305_reuseable" + ]; + + preCheck = '' + substituteInPlace pyproject.toml \ + --replace "--cov=chacha20poly1305_reuseable --cov-report=term-missing:skip-covered" "" + ''; + + checkInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + description = "ChaCha20Poly1305 that is reuseable for asyncio"; + homepage = "https://github.com/bdraco/chacha20poly1305-reuseable"; + changelog = "https://github.com/bdraco/chacha20poly1305-reuseable/blob/main/CHANGELOG.md"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0006a47025ef..c6043934d583 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1618,6 +1618,8 @@ in { cgroup-utils = callPackage ../development/python-modules/cgroup-utils { }; + chacha20poly1305-reuseable = callPackage ../development/python-modules/chacha20poly1305-reuseable { }; + chai = callPackage ../development/python-modules/chai { }; chainer = callPackage ../development/python-modules/chainer {