Skip to content

Commit d12b130

Browse files
committed
Remove unnecessary changes
1 parent 37c26d5 commit d12b130

File tree

7 files changed

+25
-23
lines changed

7 files changed

+25
-23
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
exclude: '.project-template|docs/conf.py'
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
4+
rev: v6.0.0
55
hooks:
66
- id: check-yaml
77
- id: check-toml
88
- id: end-of-file-fixer
99
- id: trailing-whitespace
1010
- repo: https://github.com/asottile/pyupgrade
11-
rev: v3.15.0
11+
rev: v3.21.0
1212
hooks:
1313
- id: pyupgrade
1414
args: [--py38-plus]
1515
- repo: https://github.com/psf/black
16-
rev: 23.9.1
16+
rev: 25.9.0
1717
hooks:
1818
- id: black
1919
- repo: https://github.com/PyCQA/flake8
20-
rev: 6.1.0
20+
rev: 7.3.0
2121
hooks:
2222
- id: flake8
2323
additional_dependencies:
2424
- flake8-bugbear==23.9.16
2525
exclude: setup.py
2626
- repo: https://github.com/PyCQA/autoflake
27-
rev: v2.2.1
27+
rev: v2.3.1
2828
hooks:
2929
- id: autoflake
3030
- repo: https://github.com/pycqa/isort
31-
rev: 5.12.0
31+
rev: 7.0.0
3232
hooks:
3333
- id: isort
3434
- repo: https://github.com/pycqa/pydocstyle
@@ -38,7 +38,7 @@ repos:
3838
additional_dependencies:
3939
- tomli # required until >= python311
4040
- repo: https://github.com/executablebooks/mdformat
41-
rev: 0.7.17
41+
rev: 1.0.0
4242
hooks:
4343
- id: mdformat
4444
additional_dependencies:

ens/async_ens.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
AsyncContract,
7373
AsyncContractFunction,
7474
)
75-
from web3.main import AsyncWeb3 # noqa: F401
75+
from web3.main import ( # noqa: F401
76+
AsyncWeb3,
77+
)
7678
from web3.middleware.base import ( # noqa: F401
7779
Middleware,
7880
)
@@ -100,8 +102,8 @@ class AsyncENS(BaseENS):
100102

101103
def __init__(
102104
self,
103-
provider: "AsyncBaseProvider" = None,
104-
addr: ChecksumAddress = None,
105+
provider: Optional["AsyncBaseProvider"] = None,
106+
addr: Optional[ChecksumAddress] = None,
105107
middleware: Optional[Sequence[Tuple["Middleware", str]]] = None,
106108
) -> None:
107109
"""

web3/_utils/abi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@
101101
)
102102

103103
if TYPE_CHECKING:
104-
from web3.main import AsyncWeb3 # noqa: F401
104+
from web3.main import ( # noqa: F401
105+
AsyncWeb3,
106+
)
105107

106108

107109
def fallback_func_abi_exists(contract_abi: ABI) -> Sequence[ABIFallback]:

web3/_utils/batching.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def __exit__(
167167
async def async_execute(self) -> List["RPCResponse"]:
168168
self._validate_is_batching()
169169
if self._provider.has_persistent_connection:
170-
responses = await cast(
171-
"AsyncWeb3[Any]", self.web3
172-
).manager._async_make_socket_batch_request(self._async_requests_info)
170+
responses = await self.web3.manager._async_make_socket_batch_request(
171+
self._async_requests_info
172+
)
173173
else:
174174
responses = await self.web3.manager._async_make_batch_request(
175175
self._async_requests_info

web3/_utils/module_testing/web3_module.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -717,9 +717,7 @@ async def test_batch_requests_clear(self, async_w3: AsyncWeb3[Any]) -> None:
717717
assert cast(BlockData, r3)["number"] == 6
718718

719719
@pytest.mark.asyncio
720-
async def test_batch_requests_cancel(
721-
self, async_w3: AsyncWeb3[Any]
722-
) -> None: # noqa: E501
720+
async def test_batch_requests_cancel(self, async_w3: AsyncWeb3[Any]) -> None:
723721
# as context manager
724722
async with async_w3.batch_requests() as batch:
725723
batch.add(async_w3.eth.get_block(1))
@@ -759,10 +757,10 @@ async def test_batch_requests_cancel(
759757
assert isinstance(block_num, int)
760758

761759
@pytest.mark.asyncio
762-
async def test_batch_requests_raises_for_common_unsupported_methods( # noqa: E501
760+
async def test_batch_requests_raises_for_common_unsupported_methods(
763761
self,
764762
async_w3: AsyncWeb3[Any],
765-
async_math_contract: "AsyncContract", # noqa: E501
763+
async_math_contract: "AsyncContract",
766764
) -> None:
767765
async with async_w3.batch_requests() as batch:
768766
with pytest.raises(MethodNotSupported, match="eth_sendTransaction"):
@@ -785,7 +783,7 @@ async def test_batch_requests_raises_for_common_unsupported_methods( # noqa: E5
785783
await batch.async_execute()
786784

787785
@pytest.mark.asyncio
788-
async def test_batch_requests_concurrently_with_regular_requests( # noqa: E501
786+
async def test_batch_requests_concurrently_with_regular_requests(
789787
self, async_w3: AsyncWeb3[Any]
790788
) -> None:
791789
responses = []

web3/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def batch_requests(
369369

370370

371371
def _validate_provider(
372-
w3: Union["Web3", "AsyncWeb3[Any]"],
372+
w3: Union["Web3", "AsyncWeb3[AsyncProviderT]"],
373373
provider: Optional[Union[BaseProvider, AsyncBaseProvider]],
374374
) -> None:
375375
if provider is not None:

web3/providers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ def batch_request_func(
192192
# type ignore bc in order to wrap the method, we have to call
193193
# `wrap_make_batch_request` with the accumulator_fn as the argument
194194
# which breaks the type hinting for this particular case.
195-
accumulator_fn = initialized.wrap_make_batch_request(
195+
accumulator_fn = initialized.wrap_make_batch_request( # type: ignore
196196
accumulator_fn
197-
) # type: ignore
197+
)
198198
self._batch_request_func_cache = (middleware, accumulator_fn)
199199

200200
return self._batch_request_func_cache[-1]

0 commit comments

Comments
 (0)