Commit 11c934a0 authored by Ivan Kozik's avatar Ivan Kozik
Browse files

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.
parent 9089fe15
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
{ 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/
  '';