1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 eth-hash,
6 eth-typing,
7 eth-utils,
8 hypothesis,
9 parsimonious,
10 pytestCheckHook,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "eth-abi";
16 version = "4.1.0";
17 format = "setuptools";
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "ethereum";
22 repo = "eth-abi";
23 rev = "v${version}";
24 hash = "sha256-CGAfu3Ovz2WPJOD+4W2+cOAz+wYvuIyFL333Jw66ozA=";
25 };
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace "parsimonious>=0.9.0,<0.10.0" "parsimonious"
30 '';
31
32 propagatedBuildInputs = [
33 eth-typing
34 eth-utils
35 parsimonious
36 ];
37
38 # lots of: TypeError: isinstance() arg 2 must be a type or tuple of types
39 doCheck = false;
40
41 nativeCheckInputs = [
42 hypothesis
43 pytestCheckHook
44 ] ++ eth-hash.optional-dependencies.pycryptodome;
45
46 disabledTests = [
47 # boolean list representation changed
48 "test_get_abi_strategy_returns_certain_strategies_for_known_type_strings"
49 # hypothesis.errors.Flaky
50 "test_base_equals_has_expected_behavior_for_parsable_types"
51 "test_has_arrlist_has_expected_behavior_for_parsable_types"
52 "test_is_base_tuple_has_expected_behavior_for_parsable_types"
53 ];
54
55 pythonImportsCheck = [ "eth_abi" ];
56
57 meta = with lib; {
58 description = "Ethereum ABI utilities";
59 homepage = "https://github.com/ethereum/eth-abi";
60 license = licenses.mit;
61 maintainers = with maintainers; [ ];
62 };
63}