summary refs log tree commit diff
path: root/pkgs/development/python-modules/eth-hash/default.nix
blob: 1c60a2d59489621e9cfc16c6d36118122d791374 (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
, 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}";
    sha256 = "sha256-LMDtFUrsPYgj/Fl9aBW1todlj1D3LlFxAkzNFAzCGLQ=";
  };

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

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

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

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