From 905ef7d607df3092f66001c0c57a35117bfbe6e4 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 31 Jan 2024 11:44:06 +0200 Subject: [PATCH] try performace improvements for shell completions --- multiversx_sdk_cli/cli.py | 10 +++++++--- multiversx_sdk_cli/config.py | 13 ------------- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/multiversx_sdk_cli/cli.py b/multiversx_sdk_cli/cli.py index 8ddd0c02..66066c5d 100644 --- a/multiversx_sdk_cli/cli.py +++ b/multiversx_sdk_cli/cli.py @@ -41,10 +41,14 @@ def main(cli_args: List[str] = sys.argv[1:]): def _do_main(cli_args: List[str]): utils.ensure_folder(config.SDK_PATH) - argv_with_config_args = config.add_config_args(cli_args) - parser = setup_parser(argv_with_config_args) + # argv_with_config_args = config.add_config_args(cli_args) + # parser = setup_parser(argv_with_config_args) + # argcomplete.autocomplete(parser) + # args = parser.parse_args(argv_with_config_args) + + parser = setup_parser(cli_args) argcomplete.autocomplete(parser) - args = parser.parse_args(argv_with_config_args) + args = parser.parse_args(cli_args) if args.verbose: logging.basicConfig(level="DEBUG", force=True, format='%(name)s: %(message)s', handlers=[RichHandler(show_time=False, rich_tracebacks=True)]) diff --git a/multiversx_sdk_cli/config.py b/multiversx_sdk_cli/config.py index 8db0a4ca..01aee78e 100644 --- a/multiversx_sdk_cli/config.py +++ b/multiversx_sdk_cli/config.py @@ -202,24 +202,11 @@ def add_config_args(argv: List[str]) -> List[str]: except KeyError: return argv - check_for_deprecated_args(config_args) - final_args = determine_final_args(argv, config_args) print(f"Found extra arguments in mxpy.json. Final arguments: {final_args}") return final_args -def check_for_deprecated_args(args: List[str]) -> None: - if "proxy" in args: - show_warning("Providing `proxy` in the configuration file is deprecated. It will not be used. Please remove it!") - - if "chainID" in args: - show_warning("Providing `chainID` in the configuration file is deprecated. It will not be used. Please remove it!") - - if "txVersion" in args: - show_warning("Providing `txVersion` in the configuration file is deprecated. It will not be used. Please remove it!") - - def determine_final_args(argv: List[str], config_args: Dict[str, Any]) -> List[str]: extra_args: List[str] = [] for key, value in config_args.items(): diff --git a/pyproject.toml b/pyproject.toml index 120450f3..acefc85d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "multiversx-sdk-network-providers>=0.12.0,<0.13.0", "multiversx-sdk-wallet>=0.8.0,<0.9.0,", "multiversx-sdk-core>=0.7.0,<0.8.0", - "argcomplete" + "argcomplete==3.2.2" ] [project.scripts]