1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, eth-hash
5, eth-typing
6, cytoolz
7, hypothesis
8, isPyPy
9, pytestCheckHook
10, pythonOlder
11, toolz
12}:
13
14buildPythonPackage rec {
15 pname = "eth-utils";
16 version = "2.0.0";
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "ethereum";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-E2vUROc2FcAv00k50YpdxaaYIRDk1yGSPB8cHHw+7Yw=";
24 };
25
26 propagatedBuildInputs = [
27 eth-hash
28 eth-typing
29 ] ++ lib.optional (!isPyPy) cytoolz
30 ++ lib.optional isPyPy toolz;
31
32
33 nativeCheckInputs = [
34 hypothesis
35 pytestCheckHook
36 ] ++ eth-hash.optional-dependencies.pycryptodome;
37
38 pythonImportsCheck = [ "eth_utils" ];
39
40 meta = {
41 description = "Common utility functions for codebases which interact with ethereum";
42 homepage = "https://github.com/ethereum/eth-utils";
43 license = lib.licenses.mit;
44 maintainers = with lib.maintainers; [ SuperSandro2000 ];
45 };
46}