Skip to content

Commit b4646d8

Browse files
authored
Merge pull request #465 from opentensor/release/9.4.3
Release/9.4.3
2 parents 9a38db2 + b816b78 commit b4646d8

File tree

6 files changed

+55
-35
lines changed

6 files changed

+55
-35
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 9.4.3 /2025-04-29
4+
5+
## What's Changed
6+
* Avoid scientific notation output by @thewhaleking in https://github.com/opentensor/btcli/pull/459
7+
* Use generic types by @thewhaleking in https://github.com/opentensor/btcli/pull/458
8+
* Suppress async substrate warning by @thewhaleking in https://github.com/opentensor/btcli/pull/463
9+
* Remove unused dependency by @thewhaleking in https://github.com/opentensor/btcli/pull/460
10+
* fix: fix typo "accross" by @gap-editor in https://github.com/opentensor/btcli/pull/461
11+
12+
## New Contributors
13+
* @gap-editor made their first contribution in https://github.com/opentensor/btcli/pull/461
14+
15+
**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.4.2...v9.4.3
16+
317
## 9.4.2 /2025-04-22
418

519
## What's Changed

bittensor_cli/cli.py

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import ssl
99
import sys
1010
import traceback
11+
import warnings
1112
from pathlib import Path
1213
from typing import Coroutine, Optional
1314
from dataclasses import fields
@@ -1000,31 +1001,37 @@ def initialize_chain(
10001001
:param network: Network name (e.g. finney, test, etc.) or
10011002
chain endpoint (e.g. ws://127.0.0.1:9945, wss://entrypoint-finney.opentensor.ai:443)
10021003
"""
1003-
if not self.subtensor:
1004-
if network:
1005-
network_ = None
1006-
for item in network:
1007-
if item.startswith("ws"):
1008-
network_ = item
1009-
break
1010-
else:
1011-
network_ = item
1004+
with warnings.catch_warnings():
1005+
warnings.filterwarnings(
1006+
"ignore",
1007+
"You are instantiating the AsyncSubstrateInterface Websocket outside of an event loop. "
1008+
"Verify this is intended.",
1009+
)
1010+
if not self.subtensor:
1011+
if network:
1012+
network_ = None
1013+
for item in network:
1014+
if item.startswith("ws"):
1015+
network_ = item
1016+
break
1017+
else:
1018+
network_ = item
1019+
1020+
not_selected_networks = [net for net in network if net != network_]
1021+
if not_selected_networks:
1022+
console.print(
1023+
f"Networks not selected: [dark_orange]{', '.join(not_selected_networks)}[/dark_orange]"
1024+
)
10121025

1013-
not_selected_networks = [net for net in network if net != network_]
1014-
if not_selected_networks:
1026+
self.subtensor = SubtensorInterface(network_)
1027+
elif self.config["network"]:
1028+
self.subtensor = SubtensorInterface(self.config["network"])
10151029
console.print(
1016-
f"Networks not selected: [dark_orange]{', '.join(not_selected_networks)}[/dark_orange]"
1030+
f"Using the specified network [{COLORS.G.LINKS}]{self.config['network']}"
1031+
f"[/{COLORS.G.LINKS}] from config"
10171032
)
1018-
1019-
self.subtensor = SubtensorInterface(network_)
1020-
elif self.config["network"]:
1021-
self.subtensor = SubtensorInterface(self.config["network"])
1022-
console.print(
1023-
f"Using the specified network [{COLORS.G.LINKS}]{self.config['network']}"
1024-
f"[/{COLORS.G.LINKS}] from config"
1025-
)
1026-
else:
1027-
self.subtensor = SubtensorInterface(defaults.subtensor.network)
1033+
else:
1034+
self.subtensor = SubtensorInterface(defaults.subtensor.network)
10281035
return self.subtensor
10291036

10301037
def _run_command(self, cmd: Coroutine, exit_early: bool = True):

bittensor_cli/src/commands/subnets/subnets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ async def show_root():
10281028
The table displays the root subnet participants and their metrics.
10291029
The columns are as follows:
10301030
- Position: The sorted position of the hotkey by total TAO.
1031-
- TAO: The sum of all TAO balances for this hotkey accross all subnets.
1031+
- TAO: The sum of all TAO balances for this hotkey across all subnets.
10321032
- Stake: The stake balance of this hotkey on root (measured in TAO).
10331033
- Emission: The emission accrued to this hotkey across all subnets every block measured in TAO.
10341034
- Hotkey: The hotkey ss58 address.
@@ -1374,7 +1374,7 @@ async def show_subnet(netuid_: int):
13741374
# The table displays the subnet participants and their metrics.
13751375
# The columns are as follows:
13761376
# - UID: The hotkey index in the subnet.
1377-
# - TAO: The sum of all TAO balances for this hotkey accross all subnets.
1377+
# - TAO: The sum of all TAO balances for this hotkey across all subnets.
13781378
# - Stake: The stake balance of this hotkey on this subnet.
13791379
# - Weight: The stake-weight of this hotkey on this subnet. Computed as an average of the normalized TAO and Stake columns of this subnet.
13801380
# - Dividends: Validating dividends earned by the hotkey.

bittensor_cli/src/commands/view.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import webbrowser
66
import netaddr
77
from dataclasses import asdict, is_dataclass
8-
from typing import Any, Dict, List
8+
from typing import Any
99
from pywry import PyWry
1010

1111
from bittensor_cli.src.bittensor.balances import Balance
@@ -149,7 +149,7 @@ def get_identity(
149149

150150
async def fetch_subnet_data(
151151
wallet: Wallet, subtensor: "SubtensorInterface"
152-
) -> Dict[str, Any]:
152+
) -> dict[str, Any]:
153153
"""
154154
Fetch subnet data from the network.
155155
"""
@@ -187,7 +187,7 @@ async def fetch_subnet_data(
187187
}
188188

189189

190-
def process_subnet_data(raw_data: Dict[str, Any]) -> Dict[str, Any]:
190+
def process_subnet_data(raw_data: dict[str, Any]) -> dict[str, Any]:
191191
"""
192192
Process and prepare subnet data.
193193
"""
@@ -206,7 +206,7 @@ def process_subnet_data(raw_data: Dict[str, Any]) -> Dict[str, Any]:
206206
total_slippage_value = Balance.from_tao(0)
207207

208208
# Process stake
209-
stake_dict: Dict[int, List[Dict[str, Any]]] = {}
209+
stake_dict: dict[int, list[dict[str, Any]]] = {}
210210
for stake in stake_info:
211211
if stake.stake.tao > 0:
212212
slippage_value, _, slippage_percentage = pool_info[
@@ -367,7 +367,7 @@ def _has_exited(handler) -> bool:
367367
)
368368

369369

370-
def generate_full_page(data: Dict[str, Any]) -> str:
370+
def generate_full_page(data: dict[str, Any]) -> str:
371371
"""
372372
Generate full HTML content for the interface.
373373
"""
@@ -673,7 +673,7 @@ def generate_neuron_details() -> str:
673673
"""
674674

675675

676-
def generate_main_header(wallet_info: Dict[str, Any], block_number: int) -> str:
676+
def generate_main_header(wallet_info: dict[str, Any], block_number: int) -> str:
677677
truncated_coldkey = f"{wallet_info['coldkey'][:6]}...{wallet_info['coldkey'][-6:]}"
678678

679679
# Calculate slippage percentage
@@ -746,7 +746,7 @@ def generate_main_filters() -> str:
746746
"""
747747

748748

749-
def generate_subnets_table(subnets: List[Dict[str, Any]]) -> str:
749+
def generate_subnets_table(subnets: list[dict[str, Any]]) -> str:
750750
rows = []
751751
for subnet in subnets:
752752
total_your_stake = sum(stake["amount"] for stake in subnet["your_stakes"])

bittensor_cli/src/commands/wallets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,8 +1259,8 @@ def overview_sort_function(row_):
12591259

12601260
grid.add_row(table)
12611261

1262-
caption = "\n[italic][dim][bright_cyan]Wallet balance: [dark_orange]\u03c4" + str(
1263-
total_balance.tao
1262+
caption = (
1263+
f"\n[italic][dim][bright_cyan]Wallet free balance: [dark_orange]{total_balance}"
12641264
)
12651265
data_dict["total_balance"] = total_balance.tao
12661266
grid.add_row(Align(caption, vertical="middle", align="center"))

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "bittensor-cli"
7-
version = "9.4.2"
7+
version = "9.4.3"
88
description = "Bittensor CLI"
99
readme = "README.md"
1010
authors = [
@@ -15,7 +15,6 @@ scripts = { btcli = "bittensor_cli.cli:main" }
1515
requires-python = ">=3.9,<3.14"
1616
dependencies = [
1717
"wheel",
18-
"async-property==0.2.2",
1918
"async-substrate-interface>=1.1.0",
2019
"aiohttp~=3.10.2",
2120
"backoff~=2.2.1",

0 commit comments

Comments
 (0)