From 0646c131c20279e050b13a2c5a549585e5631f7c Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 25 Dec 2024 20:07:58 +0800 Subject: [PATCH] python312Packages.pgpy: fix build --- .../python-modules/pgpy/default.nix | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/pgpy/default.nix b/pkgs/development/python-modules/pgpy/default.nix index d9366a7542768..e3c5046754534 100644 --- a/pkgs/development/python-modules/pgpy/default.nix +++ b/pkgs/development/python-modules/pgpy/default.nix @@ -7,6 +7,7 @@ pyasn1, cryptography, pytestCheckHook, + standard-imghdr, }: buildPythonPackage rec { @@ -15,7 +16,7 @@ buildPythonPackage rec { disabled = pythonOlder "3.6"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "SecurityInnovation"; @@ -24,24 +25,31 @@ buildPythonPackage rec { hash = "sha256-47YiHNxmjyCOYHHUV3Zyhs3Att9HZtCXYfbN34ooTxU="; }; - nativeBuildInputs = [ setuptools ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ pyasn1 cryptography + standard-imghdr ]; + postPatch = '' + # https://github.com/SecurityInnovation/PGPy/issues/472 + substituteInPlace tests/test_10_exceptions.py \ + --replace-fail ", 512" ", 1024" # We need longer test key because pgp deprecated length=512 + ''; + nativeCheckInputs = [ pytestCheckHook ]; - meta = with lib; { + meta = { homepage = "https://github.com/SecurityInnovation/PGPy"; description = "Pretty Good Privacy for Python"; longDescription = '' PGPy is a Python library for implementing Pretty Good Privacy into Python programs, conforming to the OpenPGP specification per RFC 4880. ''; - license = licenses.bsd3; - maintainers = with maintainers; [ + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ eadwu dotlambda ];