Skip to content

Commit feaa77c

Browse files
committed
fix: resolve python 3.14 syntax warnings and update deps
- Move return statements out of finally blocks in axon.py and dendrite.py (SyntaxWarning: 'return' in a 'finally' block is deprecated in 3.14, will be an error in 3.16) - Relax aiohttp constraint from ~=3.9 to >=3.9,<4.0
1 parent 1e48604 commit feaa77c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

bittensor/core/axon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,8 @@ async def dispatch(
12071207
f"axon | --> | {response.headers.get('content-length', -1)} B | {synapse.name} | None | None | 200 | Success "
12081208
)
12091209

1210-
# Return the response to the requester.
1211-
return response
1210+
# Return the response to the requester.
1211+
return response
12121212

12131213
async def preprocess(self, request: "Request") -> "Synapse":
12141214
"""

bittensor/core/dendrite.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ def query(
389389
use_new_loop = True
390390
finally:
391391
self.close_session(using_new_loop=use_new_loop)
392-
return result # type: ignore
392+
393+
return result # type: ignore
393394

394395
async def forward(
395396
self,
@@ -597,8 +598,8 @@ async def call(
597598
# Log synapse event history
598599
self.synapse_history.append(Synapse.from_headers(synapse.to_headers()))
599600

600-
# Return the updated synapse object after deserializing if requested
601-
return synapse.deserialize() if deserialize else synapse
601+
# Return the updated synapse object after deserializing if requested
602+
return synapse.deserialize() if deserialize else synapse
602603

603604
async def call_stream(
604605
self,

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ requires-python = ">=3.10,<3.15"
1515
dependencies = [
1616
"wheel",
1717
"setuptools~=70.0",
18-
"aiohttp~=3.9",
18+
"aiohttp>=3.9,<4.0",
1919
"asyncstdlib~=3.13.0",
2020
"colorama~=0.4.6",
2121
"fastapi>=0.110.1",
@@ -29,7 +29,7 @@ dependencies = [
2929
"pyyaml>=6.0",
3030
"retry==0.9.2",
3131
"requests>=2.0.0,<3.0",
32-
"pydantic>=2.3, <3",
32+
"pydantic>=2.3,<3",
3333
"scalecodec==1.2.12",
3434
"uvicorn",
3535
"bittensor-drand>=1.0.0,<2.0.0",

0 commit comments

Comments
 (0)