From b31aa2b803baea0457999adfb8fac4460add80a6 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Mon, 30 Sep 2024 18:16:54 +0200 Subject: [PATCH 1/7] Added the `--help` message automatically when no command is specified, both for `btcli` itself, and all major commands (not subcommands). --- bittensor_cli/cli.py | 51 +++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index fed4e3073..bd7981a35 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -422,7 +422,10 @@ def __init__(self): self.config_path = os.path.expanduser(defaults.config.path) self.app = typer.Typer( - rich_markup_mode="rich", callback=self.main_callback, epilog=_epilog + rich_markup_mode="rich", + callback=self.main_callback, + epilog=_epilog, + no_args_is_help=True, ) self.config_app = typer.Typer(epilog=_epilog) self.wallet_app = typer.Typer(epilog=_epilog) @@ -437,51 +440,65 @@ def __init__(self): self.config_app, name="config", short_help="Config commands, aliases: `c`, `conf`", + no_args_is_help=True, ) - self.app.add_typer(self.config_app, name="conf", hidden=True) - self.app.add_typer(self.config_app, name="c", hidden=True) + self.app.add_typer( + self.config_app, name="conf", hidden=True, no_args_is_help=True + ) + self.app.add_typer(self.config_app, name="c", hidden=True, no_args_is_help=True) # wallet aliases self.app.add_typer( self.wallet_app, name="wallet", short_help="Wallet commands, aliases: `wallets`, `w`", + no_args_is_help=True, + ) + self.app.add_typer(self.wallet_app, name="w", hidden=True, no_args_is_help=True) + self.app.add_typer( + self.wallet_app, name="wallets", hidden=True, no_args_is_help=True ) - self.app.add_typer(self.wallet_app, name="w", hidden=True) - self.app.add_typer(self.wallet_app, name="wallets", hidden=True) # root aliases self.app.add_typer( self.root_app, name="root", short_help="Root commands, alias: `r`", + no_args_is_help=True, ) - self.app.add_typer(self.root_app, name="r", hidden=True) + self.app.add_typer(self.root_app, name="r", hidden=True, no_args_is_help=True) # stake aliases self.app.add_typer( self.stake_app, name="stake", short_help="Stake commands, alias: `st`", + no_args_is_help=True, ) - self.app.add_typer(self.stake_app, name="st", hidden=True) + self.app.add_typer(self.stake_app, name="st", hidden=True, no_args_is_help=True) # sudo aliases self.app.add_typer( self.sudo_app, name="sudo", short_help="Sudo commands, alias: `su`", + no_args_is_help=True, ) - self.app.add_typer(self.sudo_app, name="su", hidden=True) + self.app.add_typer(self.sudo_app, name="su", hidden=True, no_args_is_help=True) # subnets aliases self.app.add_typer( self.subnets_app, name="subnets", short_help="Subnets commands, alias: `s`, `subnet`", + no_args_is_help=True, + ) + self.app.add_typer( + self.subnets_app, name="s", hidden=True, no_args_is_help=True + ) + self.app.add_typer( + self.subnets_app, name="subnet", hidden=True, no_args_is_help=True ) - self.app.add_typer(self.subnets_app, name="s", hidden=True) - self.app.add_typer(self.subnets_app, name="subnet", hidden=True) # weights aliases self.app.add_typer( @@ -489,9 +506,14 @@ def __init__(self): name="weights", short_help="Weights commands, aliases: `wt`, `weight`", hidden=True, + no_args_is_help=True, + ) + self.app.add_typer( + self.weights_app, name="wt", hidden=True, no_args_is_help=True + ) + self.app.add_typer( + self.weights_app, name="weight", hidden=True, no_args_is_help=True ) - self.app.add_typer(self.weights_app, name="wt", hidden=True) - self.app.add_typer(self.weights_app, name="weight", hidden=True) # config commands self.config_app.command("set")(self.set_config) @@ -613,8 +635,11 @@ def __init__(self): name="child", short_help="Child Hotkey commands, alias: `children`", rich_help_panel=HELP_PANELS["STAKE"]["CHILD"], + no_args_is_help=True, + ) + self.stake_app.add_typer( + children_app, name="children", hidden=True, no_args_is_help=True ) - self.stake_app.add_typer(children_app, name="children", hidden=True) children_app.command("get")(self.stake_get_children) children_app.command("set")(self.stake_set_children) children_app.command("revoke")(self.stake_revoke_children) From dc5cc1c15742064e8972cf550dd65fcec7e1294c Mon Sep 17 00:00:00 2001 From: Watchmaker Date: Mon, 30 Sep 2024 13:30:41 -0700 Subject: [PATCH 2/7] Adding PyPI badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94eb7f382..bd71dfe50 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Bittensor CLI [![Discord Chat](https://img.shields.io/discord/308323056592486420.svg)](https://discord.gg/bittensor) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) - +[![PyPI version](https://badge.fury.io/py/bittensor_cli.svg)](https://badge.fury.io/py/bittensor_cli) --- @@ -140,4 +140,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 87bbf02a9dc3e7fb4236f9206579fa1dac03b262 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Tue, 1 Oct 2024 16:56:41 -0700 Subject: [PATCH 3/7] Bumps version --- bittensor_cli/__init__.py | 2 +- bittensor_cli/cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bittensor_cli/__init__.py b/bittensor_cli/__init__.py index 746e05b1a..84e1ab21b 100644 --- a/bittensor_cli/__init__.py +++ b/bittensor_cli/__init__.py @@ -18,6 +18,6 @@ from .cli import CLIManager -__version__ = "8.0.0" +__version__ = "8.1.0" __all__ = ["CLIManager", "__version__"] diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index af9dfdcbf..79691758f 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -46,7 +46,7 @@ from websockets import ConnectionClosed from yaml import safe_dump, safe_load -__version__ = "8.0.0" +__version__ = "8.1.0" _core_version = re.match(r"^\d+\.\d+\.\d+", __version__).group(0) _version_split = _core_version.split(".") From 53da63d9ea25e7e9a22a6cd0881483d443df9e05 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Wed, 2 Oct 2024 12:02:18 -0700 Subject: [PATCH 4/7] Updates changelog --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f11abda..e234c0dda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 8.1.0 /2024-10-02 + +## What's Changed +* Allow for delegate take between 0 and 18% by @garrett-opentensor in https://github.com/opentensor/btcli/pull/123 +* Fixed: wallet balance check when undelegating the stake by @the-mx in https://github.com/opentensor/btcli/pull/124 +* `root my-delegates` ask for path instead of name when using `--all` by @thewhaleking in https://github.com/opentensor/btcli/pull/126 +* Fix/delegate all by @the-mx in https://github.com/opentensor/btcli/pull/125 +* Handle SSL errors and avoid unnecessary chain head calls by @thewhaleking in https://github.com/opentensor/btcli/pull/127 +* Deprecate: Remove chain config by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/128 +* Update staging by @thewhaleking in https://github.com/opentensor/btcli/pull/130 +* set archive node properly by @thewhaleking in https://github.com/opentensor/btcli/pull/143 +* Randomise rpc request ID by @thewhaleking in https://github.com/opentensor/btcli/pull/131 +* update help text in the BTCLI by @dougsillars in https://github.com/opentensor/btcli/pull/139 +* Backmerge/main to staging - 1st oct by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/145 +* Backmerge main to staging by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/147 +* Updates "btcli w set-identity" by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/146 + +## New Contributors +* @the-mx made their first contribution in https://github.com/opentensor/btcli/pull/124 +* @dougsillars made their first contribution in https://github.com/opentensor/btcli/pull/139 + +**Full Changelog**: https://github.com/opentensor/btcli/compare/v8.0.0...v8.1.0 + ## 8.0.0 /2024-09-25 ## What's Changed From a798d3bd54b691484172b5db266d159d557c9b83 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Wed, 2 Oct 2024 13:24:46 -0700 Subject: [PATCH 5/7] Changelog updated --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e234c0dda..7a267c493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ * Backmerge/main to staging - 1st oct by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/145 * Backmerge main to staging by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/147 * Updates "btcli w set-identity" by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/146 +* Give recent commit in version by @thewhaleking in https://github.com/opentensor/btcli/pull/156 +* Rename `not_subtensor` to `subtensor` by @thewhaleking in https://github.com/opentensor/btcli/pull/157 ## New Contributors * @the-mx made their first contribution in https://github.com/opentensor/btcli/pull/124 From 4756c337683fb4b638610376cc6c53cd7b6007e8 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 3 Oct 2024 18:34:01 -0700 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a267c493..9bbdb81bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Updates "btcli w set-identity" by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/146 * Give recent commit in version by @thewhaleking in https://github.com/opentensor/btcli/pull/156 * Rename `not_subtensor` to `subtensor` by @thewhaleking in https://github.com/opentensor/btcli/pull/157 +* Integrate Rust Wallet — tests by @thewhaleking @opendansor @roman-opentensor @ibraheem-opentensor @camfairchild in https://github.com/opentensor/btcli/pull/158 ## New Contributors * @the-mx made their first contribution in https://github.com/opentensor/btcli/pull/124 From c23d0fa346f4acee9291dc2d3e2abe877c202323 Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 3 Oct 2024 18:56:06 -0700 Subject: [PATCH 7/7] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bbdb81bf..83184dd52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 8.1.0 /2024-10-02 +## 8.1.0 /2024-10-03 ## What's Changed * Allow for delegate take between 0 and 18% by @garrett-opentensor in https://github.com/opentensor/btcli/pull/123