Skip to content

Commit

Permalink
Use __all__ in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRomanovizc authored and fselmo committed May 30, 2024
1 parent a39aa9b commit a05d3d2
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 7 deletions.
15 changes: 13 additions & 2 deletions ens/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# flake8: noqa

from .async_ens import (
AsyncENS,
)
Expand All @@ -18,3 +16,16 @@
UnderfundedBid,
UnownedName,
)

__all__ = [
"AsyncENS",
"BaseENS",
"ENS",
"AddressMismatch",
"BidTooLow",
"InvalidLabel",
"InvalidName",
"UnauthorizedError",
"UnderfundedBid",
"UnownedName",
]
5 changes: 5 additions & 0 deletions web3/beacon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
from .async_beacon import AsyncBeacon
from .beacon import Beacon

__all__ = [
"AsyncBeacon",
"Beacon",
]
7 changes: 7 additions & 0 deletions web3/contract/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@
ContractCaller,
ContractConstructor,
)

__all__ = [
"AsyncContract",
"AsyncContractCaller",
"Contract",
"ContractConstructor",
]
7 changes: 7 additions & 0 deletions web3/eth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@
Contract,
Eth,
)

__all__ = [
"AsyncEth",
"BaseEth",
"Contract",
"Eth",
]
22 changes: 22 additions & 0 deletions web3/middleware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,25 @@ async def async_combine_middleware(
initialized = mw(async_w3)
accumulator_fn = await initialized.async_wrap_make_request(accumulator_fn)
return accumulator_fn


__all__ = [
"AttributeDictMiddleware",
"Middleware",
"Web3Middleware",
"BufferedGasEstimateMiddleware",
"LocalFilterMiddleware",
"FormattingMiddlewareBuilder",
"GasPriceStrategyMiddleware",
"ENSNameToAddressMiddleware",
"ExtraDataToPOAMiddleware",
"PythonicMiddleware",
"SignAndSendRawMiddlewareBuilder",
"StalecheckMiddlewareBuilder",
"ValidationMiddleware",
"AsyncWeb3",
"Web3",
"RPCResponse",
"combine_middleware",
"async_combine_middleware",
]
15 changes: 15 additions & 0 deletions web3/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@
from .auto import (
AutoProvider,
)

__all__ = [
"AsyncBaseProvider",
"AsyncHTTPProvider",
"BaseProvider",
"JSONBaseProvider",
"IPCProvider",
"HTTPProvider",
"LegacyWebSocketProvider",
"AsyncIPCProvider",
"PersistentConnection",
"PersistentConnectionProvider",
"WebSocketProvider",
"AutoProvider",
]
5 changes: 5 additions & 0 deletions web3/providers/eth_tester/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
AsyncEthereumTesterProvider,
EthereumTesterProvider,
)

__all__ = [
"AsyncEthereumTesterProvider",
"EthereumTesterProvider",
]
8 changes: 8 additions & 0 deletions web3/providers/persistent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@
from .websocket import (
WebSocketProvider,
)

__all__ = [
"PersistentConnectionProvider",
"PersistentConnection",
"RequestProcessor",
"AsyncIPCProvider",
"WebSocketProvider",
]
5 changes: 5 additions & 0 deletions web3/providers/rpc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
from .rpc import (
HTTPProvider,
)

__all__ = [
"AsyncHTTPProvider",
"HTTPProvider",
]
19 changes: 14 additions & 5 deletions web3/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
classify as breaking changes.
"""

from .abi import ( # NOQA
from .abi import (
get_abi_input_names,
get_abi_output_names,
)
from .address import get_create_address # NOQA
from .async_exception_handling import ( # NOQA
from .address import get_create_address
from .async_exception_handling import (
async_handle_offchain_lookup,
)
from .caching import ( # NOQA
from .caching import (
SimpleCache,
)
from .exception_handling import ( # NOQA
from .exception_handling import (
handle_offchain_lookup,
)

__all__ = [
"get_abi_input_names",
"get_abi_output_names",
"get_create_address",
"async_handle_offchain_lookup",
"SimpleCache",
"handle_offchain_lookup",
]

0 comments on commit a05d3d2

Please sign in to comment.