From bede269edda646c6c81c6e914fc94ca1ca7fb00f Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Mon, 16 Sep 2024 16:47:34 +0300 Subject: [PATCH 1/4] mark mxpy-up.py as deprecated --- mxpy-up.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mxpy-up.py b/mxpy-up.py index 8cfacc3e..8c9a5c7b 100644 --- a/mxpy-up.py +++ b/mxpy-up.py @@ -21,9 +21,15 @@ def main(): parser.add_argument("--from-branch", help="use a branch of multiversx/mx-sdk-py-cli") parser.add_argument("--not-interactive", action="store_true", default=False) parser.add_argument("--verbose", action="store_true", default=False) + parser.add_argument("--ignore-deprecation", action="store_false", default=True, help="'mxpy-up.py' is obsolete, install using 'pipx': https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx") parser.set_defaults(modify_path=True) args = parser.parse_args() + if args.ignore_deprecation: + logger.warning("'mxpy-up.py' is deprecated. Check out the documentation on how to install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx.") + logger.warning("To install using 'mxpy-up.py' set the `--ignore-deprecation` flag.") + return + exact_version = args.exact_version from_branch = args.from_branch interactive = not args.not_interactive @@ -56,6 +62,8 @@ def main(): if interactive: guide_system_path_integration() + logger.warning("Installing `mxpy` using `mxpy-up.py` is deprecated. Check out the documentation on how to install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx") + def guard_non_root_user(): logger.debug("Checking user (should not be root).") @@ -260,7 +268,7 @@ def guide_system_path_integration(): return old_export_directive = f'export PATH="{Path("~/elrondsdk").expanduser()}:$PATH"\t# elrond-sdk' - new_export_directive = f'export PATH="${{HOME}}/multiversx-sdk:$PATH"\t# multiversx-sdk' + new_export_directive = 'export PATH="${{HOME}}/multiversx-sdk:$PATH"\t# multiversx-sdk' profile_files = get_profile_files() @@ -292,7 +300,7 @@ def guide_system_path_integration(): Your shell profile files: {profile_files_formatted} -The entry (entries) to remove: +The entry (entries) to remove: {old_export_directive} ############################################################################### Make sure you UNDERSTAND the above before proceeding further. @@ -306,12 +314,12 @@ def guide_system_path_integration(): ############################################################################### It seems that the path "~/multiversx-sdk" is already configured in shell profile. -To confirm this, CHECK the shell profile (now or after the installer script ends). +To confirm this, CHECK the shell profile (now or after the installer script ends). Your shell profile files: {profile_files_formatted} -The entry to check (it should be present): +The entry to check (it should be present): {new_export_directive}. ############################################################################### Make sure you UNDERSTAND the above before proceeding further. From acad3fc90a41c0d14e5c60cef916e18104be8ebc Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 17 Sep 2024 10:46:37 +0300 Subject: [PATCH 2/4] fixes after review --- mxpy-up.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mxpy-up.py b/mxpy-up.py index 8c9a5c7b..20a3f33d 100644 --- a/mxpy-up.py +++ b/mxpy-up.py @@ -25,10 +25,10 @@ def main(): parser.set_defaults(modify_path=True) args = parser.parse_args() + logger.warning("'mxpy-up.py' is deprecated. Check out the documentation on how to install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx.") + if args.ignore_deprecation: - logger.warning("'mxpy-up.py' is deprecated. Check out the documentation on how to install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx.") - logger.warning("To install using 'mxpy-up.py' set the `--ignore-deprecation` flag.") - return + raise Exception("'mxpy-up.py' is deprecated, please install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx. If installing using 'mxpy-up` is mandatory, provide the `--ignore-deprecation` flag.") exact_version = args.exact_version from_branch = args.from_branch From e0aaf75565460e60300bec6de1e281743eda43bb Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 17 Sep 2024 10:49:41 +0300 Subject: [PATCH 3/4] fixes after review --- mxpy-up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mxpy-up.py b/mxpy-up.py index 20a3f33d..fd818b53 100644 --- a/mxpy-up.py +++ b/mxpy-up.py @@ -21,13 +21,13 @@ def main(): parser.add_argument("--from-branch", help="use a branch of multiversx/mx-sdk-py-cli") parser.add_argument("--not-interactive", action="store_true", default=False) parser.add_argument("--verbose", action="store_true", default=False) - parser.add_argument("--ignore-deprecation", action="store_false", default=True, help="'mxpy-up.py' is obsolete, install using 'pipx': https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx") + parser.add_argument("--ignore-deprecation", action="store_true", default=False, help="'mxpy-up.py' is obsolete, install using 'pipx': https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx") parser.set_defaults(modify_path=True) args = parser.parse_args() logger.warning("'mxpy-up.py' is deprecated. Check out the documentation on how to install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx.") - if args.ignore_deprecation: + if not args.ignore_deprecation: raise Exception("'mxpy-up.py' is deprecated, please install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx. If installing using 'mxpy-up` is mandatory, provide the `--ignore-deprecation` flag.") exact_version = args.exact_version From 47111f826c49e317640e8e496f54f474a67a61db Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 17 Sep 2024 12:54:05 +0300 Subject: [PATCH 4/4] small fix --- mxpy-up.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mxpy-up.py b/mxpy-up.py index fd818b53..24177d3a 100644 --- a/mxpy-up.py +++ b/mxpy-up.py @@ -28,7 +28,7 @@ def main(): logger.warning("'mxpy-up.py' is deprecated. Check out the documentation on how to install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx.") if not args.ignore_deprecation: - raise Exception("'mxpy-up.py' is deprecated, please install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx. If installing using 'mxpy-up` is mandatory, provide the `--ignore-deprecation` flag.") + raise Exception("'mxpy-up.py' is deprecated, please install using `pipx`: https://docs.multiversx.com/sdk-and-tools/sdk-py/installing-mxpy/#install-using-pipx. If installing using 'mxpy-up` is necessary, provide the `--ignore-deprecation` flag.") exact_version = args.exact_version from_branch = args.from_branch