Skip to content

Commit fa0aec3

Browse files
committed
Update provider explicit exports for __all__:
- Adds AsyncEthereumTesterProvider to web3/__init__.py. - Adds EthereumTesterProvider and AsyncEthereumTesterProvider to web3/providers/__init__.py. - Update __all__ in web3/__init__.py to include all provider classes, including base classes. - Add __all__ for web3/providers/__init__.py including all explicit exports.
1 parent a05d3d2 commit fa0aec3

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed

newsfragments/3409.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Provide explicit ``__all__`` exports for providers in `web3/providers/__init__.py`; update `web3/__init__.py` to include all provider classes including base classes.

web3/__init__.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from eth_account import Account # noqa: E402
2-
import sys
32

43
from importlib.metadata import version
54

@@ -10,12 +9,20 @@
109
AsyncWeb3,
1110
Web3,
1211
)
12+
from web3.providers import (
13+
AsyncBaseProvider,
14+
AutoProvider,
15+
BaseProvider,
16+
JSONBaseProvider,
17+
PersistentConnection,
18+
)
1319
from web3.providers.persistent import ( # noqa: E402
1420
AsyncIPCProvider,
1521
PersistentConnectionProvider,
1622
WebSocketProvider,
1723
)
1824
from web3.providers.eth_tester import ( # noqa: E402
25+
AsyncEthereumTesterProvider,
1926
EthereumTesterProvider,
2027
)
2128
from web3.providers.ipc import ( # noqa: E402
@@ -32,14 +39,23 @@
3239

3340
__all__ = [
3441
"__version__",
42+
"Account",
43+
# web3:
3544
"AsyncWeb3",
3645
"Web3",
46+
# providers:
47+
"AsyncBaseProvider",
48+
"AsyncEthereumTesterProvider",
49+
"AsyncHTTPProvider",
50+
"AsyncIPCProvider",
51+
"AutoProvider",
52+
"BaseProvider",
53+
"EthereumTesterProvider",
3754
"HTTPProvider",
3855
"IPCProvider",
56+
"JSONBaseProvider",
3957
"LegacyWebSocketProvider",
58+
"PersistentConnection",
59+
"PersistentConnectionProvider",
4060
"WebSocketProvider",
41-
"EthereumTesterProvider",
42-
"Account",
43-
"AsyncHTTPProvider",
44-
"AsyncIPCProvider",
4561
]

web3/providers/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
BaseProvider,
99
JSONBaseProvider,
1010
)
11+
from .eth_tester import (
12+
AsyncEthereumTesterProvider,
13+
EthereumTesterProvider,
14+
)
1115
from .ipc import (
1216
IPCProvider,
1317
)
@@ -29,15 +33,17 @@
2933

3034
__all__ = [
3135
"AsyncBaseProvider",
36+
"AsyncEthereumTesterProvider",
3237
"AsyncHTTPProvider",
38+
"AsyncIPCProvider",
39+
"AutoProvider",
3340
"BaseProvider",
34-
"JSONBaseProvider",
35-
"IPCProvider",
41+
"EthereumTesterProvider",
3642
"HTTPProvider",
43+
"IPCProvider",
44+
"JSONBaseProvider",
3745
"LegacyWebSocketProvider",
38-
"AsyncIPCProvider",
3946
"PersistentConnection",
4047
"PersistentConnectionProvider",
4148
"WebSocketProvider",
42-
"AutoProvider",
4349
]

0 commit comments

Comments
 (0)