From d4fdd9a19cf149ea4009bb344f4100930ad39ff1 Mon Sep 17 00:00:00 2001 From: Louis Bettens Date: Sun, 9 May 2021 16:01:13 +0200 Subject: [PATCH] pythonPackages.keyrings-cryptfile: init at 1.3.4 --- .../keyrings-cryptfile/default.nix | 59 +++++++++++++++++++ .../keyrings-cryptfile/fix-testsuite.patch | 14 +++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/keyrings-cryptfile/default.nix create mode 100644 pkgs/development/python-modules/keyrings-cryptfile/fix-testsuite.patch diff --git a/pkgs/development/python-modules/keyrings-cryptfile/default.nix b/pkgs/development/python-modules/keyrings-cryptfile/default.nix new file mode 100644 index 00000000000..7f2cacea629 --- /dev/null +++ b/pkgs/development/python-modules/keyrings-cryptfile/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fetchpatch +, argon2_cffi +, keyring +, pycryptodome +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "keyrings.cryptfile"; + # NOTE: newer releases are bugged/incompatible + # https://github.com/frispete/keyrings.cryptfile/issues/15 + version = "1.3.4"; + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-jW+cKMm+xef8C+fl0CGe+6SEkYBHDjFX2/kLCZ62j6c="; + }; + + patches = [ + # upstream setup.cfg has an option that is not supported + ./fix-testsuite.patch + # change of API in keyrings.testing + (fetchpatch { + url = "https://github.com/frispete/keyrings.cryptfile/commit/6fb9e45f559b8b69f7a0a519c0bece6324471d79.patch"; + sha256 = "sha256-1878pMO9Ed1zs1pl+7gMjwx77HbDHdE1CryN8TPfPdU="; + }) + ]; + + propagatedBuildInputs = [ + argon2_cffi + keyring + pycryptodome + ]; + + pythonImportsCheck = [ + "keyrings.cryptfile" + ]; + + checkInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + "test_set_properties" + "UncryptedFileKeyringTestCase" + ]; + + meta = with lib; { + description = "Encrypted file keyring backend"; + homepage = "https://github.com/frispete/keyrings.cryptfile"; + license = licenses.mit; + maintainers = teams.chia.members; + }; +} diff --git a/pkgs/development/python-modules/keyrings-cryptfile/fix-testsuite.patch b/pkgs/development/python-modules/keyrings-cryptfile/fix-testsuite.patch new file mode 100644 index 00000000000..8e32a64e529 --- /dev/null +++ b/pkgs/development/python-modules/keyrings-cryptfile/fix-testsuite.patch @@ -0,0 +1,14 @@ +diff --git a/setup.cfg b/setup.cfg +index ec7eb30..7ffd831 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -5,9 +5,6 @@ dists = clean --all sdist bdist_wheel + [wheel] + universal = 1 + +-[tool:pytest] +-addopts = -s --cov=keyrings/cryptfile +- + [egg_info] + tag_build = + tag_date = 0 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a5dfeb10118..79779fa9f1d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3661,6 +3661,8 @@ in { keyring = callPackage ../development/python-modules/keyring { }; + keyrings-cryptfile = callPackage ../development/python-modules/keyrings-cryptfile { }; + keyrings-alt = callPackage ../development/python-modules/keyrings-alt { }; keystone-engine = callPackage ../development/python-modules/keystone-engine { };