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