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.
This commit is contained in:
Ivan Kozik 2023-05-21 16:55:55 +00:00
parent 9089fe15c9
commit 11c934a00e

View file

@ -1,6 +1,7 @@
{ lib { lib
, fetchFromGitHub , fetchFromGitHub
, buildPythonPackage , buildPythonPackage
, pythonAtLeast
, pythonOlder , pythonOlder
, pytest , pytest
, safe-pysha3 , safe-pysha3
@ -22,10 +23,14 @@ buildPythonPackage rec {
nativeCheckInputs = [ nativeCheckInputs = [
pytest pytest
] ++ passthru.optional-dependencies.pycryptodome ] ++ 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 = '' checkPhase = ''
pytest tests/backends/pycryptodome/ pytest tests/backends/pycryptodome/
'' + lib.optionalString (pythonAtLeast "3.9") ''
pytest tests/backends/pysha3/ pytest tests/backends/pysha3/
''; '';