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 = "5.31.1";
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-YsAbPI9Y6z+snKZ9NsA0YSpB38n+ra4+Ei6COYFe8v4=";
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 #checkInputs = [
67 # eth-tester
68 # eth-tester.optional-dependencies.py-evm
69 # py-geth
70 # pytestCheckHook
71 #];
72
73 doCheck = false;
74
75 pythonImportsCheck = [
76 "web3"
77 ];
78
79 meta = with lib; {
80 description = "Web3 library for interactions";
81 homepage = "https://github.com/ethereum/web3";
82 license = licenses.mit;
83 maintainers = with maintainers; [ raitobezarius ];
84 };
85}