depot/third_party/nixpkgs/pkgs/development/python-modules/eth-hash/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

44 lines
994 B
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, pythonOlder
, pytest
, pysha3
, 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}";
sha256 = "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 = if pythonOlder "3.9" then [ pysha3 ] else [ 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 ];
};
}