From 11c934a00eaae7947e920b6e389c6ed8aa752c9e Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Sun, 21 May 2023 16:55:55 +0000 Subject: [PATCH] python38Packages.eth-hash: fix the build by not depending on safe-pysha3 eth-hash can work with pycryptodome, which builds on Python 3.8. This fixes the build of grab-site, which is still stuck on Python 3.8, and depends on eth-hash through its authobahn dependency. --- pkgs/development/python-modules/eth-hash/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/eth-hash/default.nix b/pkgs/development/python-modules/eth-hash/default.nix index f1b22597f2c..aabd3b38f42 100644 --- a/pkgs/development/python-modules/eth-hash/default.nix +++ b/pkgs/development/python-modules/eth-hash/default.nix @@ -1,6 +1,7 @@ { lib , fetchFromGitHub , buildPythonPackage +, pythonAtLeast , pythonOlder , pytest , safe-pysha3 @@ -22,10 +23,14 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest ] ++ passthru.optional-dependencies.pycryptodome - ++ passthru.optional-dependencies.pysha3; + # eth-hash can use either safe-pysha3 or pycryptodome; + # safe-pysha3 requires Python 3.9+ while pycryptodome does not. + # https://github.com/ethereum/eth-hash/issues/46#issuecomment-1314029211 + ++ lib.optional (pythonAtLeast "3.9") passthru.optional-dependencies.pysha3; checkPhase = '' pytest tests/backends/pycryptodome/ + '' + lib.optionalString (pythonAtLeast "3.9") '' pytest tests/backends/pysha3/ '';