Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore flake8 F401 qa in all __init__.py files #3097

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/3097.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore flake8 rule F401 (unused import) in all ``__init__.py`` files
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ envlist=
benchmark

[flake8]
max-line-length=88
exclude= venv*,.tox,docs,build
extend-ignore=E203,W503
max-line-length=88
per-file-ignores=__init__.py:F401

[testenv]
allowlist_externals=/usr/bin/make
Expand Down
2 changes: 1 addition & 1 deletion web3/_utils/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Once web3 supports >= the noted python version, the type may be directly
# imported from `typing`

from typing_extensions import ( # noqa: F401
from typing_extensions import (
Literal, # py38
NotRequired, # py311
Protocol, # py38
Expand Down
12 changes: 6 additions & 6 deletions web3/_utils/module_testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from .eth_module import ( # noqa: F401
from .eth_module import (
AsyncEthModuleTest,
EthModuleTest,
)
from .go_ethereum_admin_module import ( # noqa: F401
from .go_ethereum_admin_module import (
GoEthereumAdminModuleTest,
)
from .go_ethereum_personal_module import ( # noqa: F401
from .go_ethereum_personal_module import (
GoEthereumPersonalModuleTest,
)
from .go_ethereum_txpool_module import ( # noqa: F401
from .go_ethereum_txpool_module import (
GoEthereumAsyncTxPoolModuleTest,
GoEthereumTxPoolModuleTest,
)
from .net_module import ( # noqa: F401
from .net_module import (
AsyncNetModuleTest,
NetModuleTest,
)
from .web3_module import ( # noqa: F401
from .web3_module import (
Web3ModuleTest,
)
4 changes: 2 additions & 2 deletions web3/beacon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .async_beacon import AsyncBeacon # noqa: F401
from .main import Beacon # noqa: F401
from .async_beacon import AsyncBeacon
from .main import Beacon
4 changes: 2 additions & 2 deletions web3/contract/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from web3.contract.async_contract import ( # noqa: F401
from web3.contract.async_contract import (
AsyncContract,
AsyncContractCaller,
)
from web3.contract.contract import ( # noqa: F401
from web3.contract.contract import (
Contract,
ContractCaller,
ContractConstructor,
Expand Down
6 changes: 3 additions & 3 deletions web3/eth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from .async_eth import ( # noqa: F401
from .async_eth import (
AsyncEth,
)
from .base_eth import ( # noqa: F401
from .base_eth import (
BaseEth,
)
from .eth import ( # noqa: F401
from .eth import (
Contract,
Eth,
)
38 changes: 19 additions & 19 deletions web3/middleware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,82 +14,82 @@
RPCResponse,
)

from .abi import ( # noqa: F401
from .abi import (
abi_middleware,
)
from .async_cache import ( # noqa: F401
from .async_cache import (
_async_simple_cache_middleware as async_simple_cache_middleware,
async_construct_simple_cache_middleware,
)
from .attrdict import ( # noqa: F401
from .attrdict import (
async_attrdict_middleware,
attrdict_middleware,
)
from .buffered_gas_estimate import ( # noqa: F401
from .buffered_gas_estimate import (
async_buffered_gas_estimate_middleware,
buffered_gas_estimate_middleware,
)
from .cache import ( # noqa: F401
from .cache import (
_latest_block_based_cache_middleware as latest_block_based_cache_middleware,
_simple_cache_middleware as simple_cache_middleware,
_time_based_cache_middleware as time_based_cache_middleware,
construct_latest_block_based_cache_middleware,
construct_simple_cache_middleware,
construct_time_based_cache_middleware,
)
from .exception_handling import ( # noqa: F401
from .exception_handling import (
construct_exception_handler_middleware,
)
from .exception_retry_request import ( # noqa: F401
from .exception_retry_request import (
async_http_retry_request_middleware,
http_retry_request_middleware,
)
from .filter import ( # noqa: F401
from .filter import (
async_local_filter_middleware,
local_filter_middleware,
)
from .fixture import ( # noqa: F401
from .fixture import (
async_construct_error_generator_middleware,
async_construct_result_generator_middleware,
construct_error_generator_middleware,
construct_fixture_middleware,
construct_result_generator_middleware,
)
from .formatting import ( # noqa: F401
from .formatting import (
construct_formatting_middleware,
)
from .gas_price_strategy import ( # noqa: F401
from .gas_price_strategy import (
async_gas_price_strategy_middleware,
gas_price_strategy_middleware,
)
from .geth_poa import ( # noqa: F401
from .geth_poa import (
async_geth_poa_middleware,
geth_poa_middleware,
)
from .names import ( # noqa: F401
from .names import (
async_name_to_address_middleware,
name_to_address_middleware,
)
from .normalize_request_parameters import ( # noqa: F401
from .normalize_request_parameters import (
request_parameter_normalizer,
)
from .pythonic import ( # noqa: F401
from .pythonic import (
pythonic_middleware,
)
from .signing import ( # noqa: F401
from .signing import (
construct_sign_and_send_raw_middleware,
)
from .stalecheck import ( # noqa: F401
from .stalecheck import (
async_make_stalecheck_middleware,
make_stalecheck_middleware,
)
from .validation import ( # noqa: F401
from .validation import (
async_validation_middleware,
validation_middleware,
)

if TYPE_CHECKING:
from web3 import AsyncWeb3, Web3 # noqa: F401
from web3 import AsyncWeb3, Web3


def combine_middlewares(
Expand Down
16 changes: 8 additions & 8 deletions web3/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
from .async_base import ( # noqa: F401
from .async_base import (
AsyncBaseProvider,
)
from .async_rpc import ( # noqa: F401
from .async_rpc import (
AsyncHTTPProvider,
)
from .base import ( # noqa: F401
from .base import (
BaseProvider,
JSONBaseProvider,
)
from .ipc import ( # noqa: F401
from .ipc import (
IPCProvider,
)
from .persistent import ( # noqa: F401
from .persistent import (
PersistentConnectionProvider,
)
from .rpc import ( # noqa: F401
from .rpc import (
HTTPProvider,
)
from .websocket import ( # noqa: F401
from .websocket import (
WebsocketProvider,
WebsocketProviderV2,
)
from .auto import ( # noqa: F401
from .auto import (
AutoProvider,
)
2 changes: 1 addition & 1 deletion web3/providers/eth_tester/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .main import ( # noqa: F401
from .main import (
AsyncEthereumTesterProvider,
EthereumTesterProvider,
)
4 changes: 2 additions & 2 deletions web3/providers/websocket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .websocket import ( # noqa: F401
from .websocket import (
DEFAULT_WEBSOCKET_TIMEOUT,
RESTRICTED_WEBSOCKET_KWARGS,
WebsocketProvider,
)
from .websocket_v2 import ( # noqa: F401
from .websocket_v2 import (
WebsocketProviderV2,
)
2 changes: 1 addition & 1 deletion web3/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .pytest_ethereum import ( # noqa: F401
from .pytest_ethereum import (
deployer,
linker,
)