about summary refs log tree commit diff
path: root/pkgs/development/python-modules/eth-hash/default.nix
blob: f1b22597f2c327b4721b4060b37288e4738f2628 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib
, fetchFromGitHub
, buildPythonPackage
, pythonOlder
, pytest
, safe-pysha3
, pycryptodome
}:

buildPythonPackage rec {
  pname = "eth-hash";
  version = "0.3.2";
  disabled = pythonOlder "3.5";

  src = fetchFromGitHub {
    owner = "ethereum";
    repo = "eth-hash";
    rev = "v${version}";
    hash = "sha256-LMDtFUrsPYgj/Fl9aBW1todlj1D3LlFxAkzNFAzCGLQ=";
  };

  nativeCheckInputs = [
    pytest
  ] ++ passthru.optional-dependencies.pycryptodome
  ++ passthru.optional-dependencies.pysha3;

  checkPhase = ''
    pytest tests/backends/pycryptodome/
    pytest tests/backends/pysha3/
  '';

  passthru.optional-dependencies = {
    pycryptodome = [ pycryptodome ];
    pysha3 = [ safe-pysha3 ];
  };

  meta = with lib; {
    description = "The Ethereum hashing function keccak256";
    homepage = "https://github.com/ethereum/eth-hash";
    license = licenses.mit;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}