2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, eth-hash
|
|
|
|
, eth-typing
|
|
|
|
, cytoolz
|
|
|
|
, hypothesis
|
|
|
|
, isPyPy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, toolz
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "eth-utils";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.1.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-Ogp4o99smw5qVwDec6zd/xVqqKMyNk41iBfRNzrwuvE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
eth-hash
|
|
|
|
eth-typing
|
|
|
|
] ++ lib.optional (!isPyPy) cytoolz
|
|
|
|
++ lib.optional isPyPy toolz;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
hypothesis
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ eth-hash.optional-dependencies.pycryptodome;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Removing a poorly written test case from test suite.
|
|
|
|
# TODO work with the upstream
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/functional-utils/test_type_inference.py"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
pythonImportsCheck = [ "eth_utils" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Common utility functions for codebases which interact with ethereum";
|
|
|
|
homepage = "https://github.com/ethereum/eth-utils";
|
|
|
|
license = lib.licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|