From 7221014609cddfac1a28eb44bfb5b28eb53d97fc Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 21 Jan 2023 16:07:43 +0100 Subject: [PATCH] python311Packages.merkletools: remove pysha3 --- .../python-modules/merkletools/default.nix | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/merkletools/default.nix b/pkgs/development/python-modules/merkletools/default.nix index a57f926a615f..b5dc5adf3dcc 100644 --- a/pkgs/development/python-modules/merkletools/default.nix +++ b/pkgs/development/python-modules/merkletools/default.nix @@ -1,19 +1,42 @@ -{ lib, buildPythonPackage, fetchPypi, pysha3 }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +}: buildPythonPackage rec { pname = "merkletools"; version = "1.0.3"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "0pdik5sil0xcrwdcgdfy86c5qcfrz24r0gfc8m8bxa0i7h7x2v9l"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "Tierion"; + repo = "pymerkletools"; + rev = "refs/tags/${version}"; + hash = "sha256-pd7Wxi7Sk95RcrFOTOtl725nIXidva3ftdKSGxHYPTA="; }; - propagatedBuildInputs = [ pysha3 ]; + postPatch = '' + # pysha3 is deprecated and not needed for Python > 3.6 + substituteInPlace setup.py \ + --replace "install_requires=install_requires" "install_requires=[]," + ''; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "merkletools" + ]; meta = with lib; { description = "Python tools for creating Merkle trees, generating Merkle proofs, and verification of Merkle proofs"; homepage = "https://github.com/Tierion/pymerkletools"; + changelog = "https://github.com/Tierion/pymerkletools/releases/tag/${version}"; license = licenses.mit; maintainers = with maintainers; [ Madouura ]; };