1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, aiohttp
5, eth-abi
6, eth-account
7, eth-hash
8, eth-typing
9, eth-utils
10, eth-rlp
11, hexbytes
12, ipfshttpclient
13, jsonschema
14, lru-dict
15, protobuf
16, requests
17, typing-extensions
18, websockets
19# , eth-tester
20# , py-geth
21, pytestCheckHook
22, pythonOlder
23, pythonRelaxDepsHook
24}:
25
26buildPythonPackage rec {
27 pname = "web3";
28 version = "6.3.0";
29 format = "setuptools";
30
31 disabled = pythonOlder "3.7";
32
33 src = fetchFromGitHub {
34 owner = "ethereum";
35 repo = "web3.py";
36 rev = "v${version}";
37 hash = "sha256-p3Dpmb0BST1nbh42q/eK/DjQqoIPHvNr2KllRpTgFFw=";
38 };
39
40 nativeBuildInputs = [
41 pythonRelaxDepsHook
42 ];
43
44 propagatedBuildInputs = [
45 aiohttp
46 eth-abi
47 eth-account
48 eth-hash
49 eth-rlp
50 eth-typing
51 eth-utils
52 hexbytes
53 ipfshttpclient
54 jsonschema
55 lru-dict
56 protobuf
57 requests
58 websockets
59 ] ++ lib.optionals (pythonOlder "3.8") [
60 typing-extensions
61 ] ++ eth-hash.optional-dependencies.pycryptodome;
62
63 pythonRelaxDeps = true;
64
65 # TODO: package eth-tester
66 #nativeCheckInputs = [
67 # eth-tester
68 # eth-tester.optional-dependencies.py-evm
69 # py-geth
70 # pytestCheckHook
71 #];
72
73 doCheck = false;
74
75 postPatch = ''
76 substituteInPlace setup.py --replace "types-protobuf==3.19.13" "types-protobuf"
77 '';
78
79 pythonImportsCheck = [
80 "web3"
81 ];
82
83 meta = with lib; {
84 description = "Web3 library for interactions";
85 homepage = "https://github.com/ethereum/web3";
86 license = licenses.mit;
87 maintainers = with maintainers; [ raitobezarius ];
88 };
89}