From a90d93b02f7b0cfa38d04bed3011c1ec169dd7e7 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 29 Sep 2024 11:25:46 +0900 Subject: [PATCH 1/7] chore(ci): use install-qt subcommand Signed-off-by: Hiroshi Miura --- .github/workflows/test-install-qt.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-install-qt.yml b/.github/workflows/test-install-qt.yml index a2a1b7ee..788b97b9 100644 --- a/.github/workflows/test-install-qt.yml +++ b/.github/workflows/test-install-qt.yml @@ -32,7 +32,7 @@ jobs: py: "3.10" qtver: 6.1.0 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 20 fetch-tags: true @@ -88,24 +88,24 @@ jobs: bin_path = str(github_workspace / "dist" / "aqt.exe") else: bin_path = (github_workspace / "dist" / "aqt").as_posix() - prefix = [bin_path, "install"] + prefix = [bin_path, "install-qt"] else: - prefix = ["python", "-m", "aqt", "install"] + prefix = ["python", "-m", "aqt", "install-qt"] command_line = [] command_line.extend(prefix) if platform == "windows-latest": if qtver.startswith('5.15'): - args = [qtver, "windows", "desktop", "win64_msvc2019_64"] + args = ["windows", "desktop", qtver, "win64_msvc2019_64"] elif qtver.startswith('5.14'): - args = [qtver, "windows", "desktop", "win64_msvc2017_64"] + args = ["windows", "desktop", qtver, "win64_msvc2017_64"] elif qtver.startswith('6'): - args = [qtver, "windows", "desktop", "win64_mingw81"] + args = ["windows", "desktop", qtver, "win64_mingw81"] else: - args = [qtver, "windows", "desktop", "win64_msvc2015_64"] + args = ["windows", "desktop", qtver, "win64_msvc2015_64"] elif platform == "macOS-latest": - args = [qtver, "mac", "desktop", "clang_64"] + args = ["mac", "desktop", qtver, "clang_64"] else: - args = [qtver, "linux", "desktop", "gcc_64"] + args = ["linux", "desktop", qtver, "gcc_64"] command_line.extend(args) command_line.extend(["--archives", "qtbase", "icu", "qt"]) env["AQT_CONFIG"] = (github_workspace / "ci" / "settings.ini").as_posix() @@ -120,13 +120,13 @@ jobs: command_line6 = [] command_line6.extend(prefix) if platform.startswith("ubuntu"): - command_line6.extend([qtver, "linux", "android", "android_armv7"]) + command_line6.extend(["linux", "android", qtver, "android_armv7"]) timeout = 360 elif platform.startswith("macOS"): - command_line6.extend([qtver, "mac", "ios", "ios"]) + command_line6.extend(["mac", "ios", qtver, "ios"]) timeout = 360 else: - command_line6.extend([qtver, "windows", "android", "android_armv7"]) + command_line6.extend(["windows", "android", qtver, "android_armv7"]) timeout = 360 print("Execute: {}".format(command_line6)) try: @@ -186,7 +186,7 @@ jobs: print('PREFIX {}'.format(result)) shell: python working-directory: ${{ github.workspace }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: matrix.artifact == 'binary' with: name: aqt-${{ matrix.os }}-standalone From 8566a89f94f2fdee8f5c04159407f1ff4da679e5 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 29 Sep 2024 11:26:27 +0900 Subject: [PATCH 2/7] chore(ci): drop python2 check Signed-off-by: Hiroshi Miura --- .github/workflows/check.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c991ddca..b59bea1e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,10 +28,6 @@ jobs: run: | pip install -U pip pip install tox tox-gh-actions coveralls coverage[toml] - - name: Check invocation with Python2 - run: | - ! python2 -m aqt help - [[ $(python2 -m aqt help) == "aqtinstall requires python 3!" ]] - name: Check run: tox env: From 2615219b706fd9acc1c0523f099a006867a4a59e Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 29 Sep 2024 11:29:55 +0900 Subject: [PATCH 3/7] docs: remove explanation of a legacy command syntax Signed-off-by: Hiroshi Miura --- docs/cli.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 635590b3..a7bf3bc1 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -778,16 +778,6 @@ You should use the :ref:`List-Tool command` to display what tools and tool varia See `common options`_. - -Legacy subcommands ------------------- - -The subcommands ``install``, ``tool``, ``src``, ``doc``, and ``examples`` have -been deprecated in favor of the newer ``install-*`` commands, but they remain -in aqt in case you still need to use them. Documentation for these older -commands is still available at https://aqtinstall.readthedocs.io/en/v1.2.4/ - - Command examples ================ From 2a8eb72c0b81f45f73f7ae117f25b5bb3fb657b3 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 29 Sep 2024 11:30:17 +0900 Subject: [PATCH 4/7] refactor: test: update cases and expectations Signed-off-by: Hiroshi Miura --- aqt/installer.py | 3 +- tests/test_cli.py | 81 ++----------------------------------------- tests/test_install.py | 59 ------------------------------- 3 files changed, 4 insertions(+), 139 deletions(-) diff --git a/aqt/installer.py b/aqt/installer.py index cd22c518..9fd7bdda 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -167,8 +167,7 @@ def __init__(self): title="subcommands", description="aqt accepts several subcommands:\n" "install-* subcommands are commands that install components\n" - "list-* subcommands are commands that show available components\n\n" - "commands {install|tool|src|examples|doc} are deprecated and marked for removal\n", + "list-* subcommands are commands that show available components\n", help="Please refer to each help message by using '--help' with each subcommand", ) self._make_all_parsers(subparsers) diff --git a/tests/test_cli.py b/tests/test_cli.py index 6f520184..2d30407d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -16,8 +16,7 @@ def expected_help(actual, prefix=None): expected = ( "usage: aqt [-h] [-c CONFIG]\n" " {install-qt,install-tool,install-doc,install-example,install-src," - "list-qt,list-tool,list-doc,list-example,list-src," - "install,tool,doc,examples,src,help,version}\n" + "list-qt,list-tool,list-doc,list-example,list-src,help,version}\n" " ...\n" "\n" "Another unofficial Qt Installer.\n" @@ -32,13 +31,9 @@ def expected_help(actual, prefix=None): " aqt accepts several subcommands:\n" " install-* subcommands are commands that install components\n" " list-* subcommands are commands that show available components\n" - " \n" - " commands {install|tool|src|examples|doc} are deprecated and marked for " - "removal\n" "\n" " {install-qt,install-tool,install-doc,install-example,install-src,list-qt," - "list-tool,list-doc,list-example,list-src," - "install,tool,doc,examples,src,help,version}\n" + "list-tool,list-doc,list-example,list-src,help,version}\n" " Please refer to each help message by using '--help' " "with each subcommand\n", ) @@ -110,14 +105,12 @@ def test_cli_invalid_version(capsys, invalid_version): cli._setup_settings() matcher = re.compile( - r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" + # r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" r"(.*\n)*" r"ERROR :.*Invalid version: '" + invalid_version + r"'! Please use the form '5\.X\.Y'\.\n.*" ) for cmd in ( - ("install", invalid_version, "mac", "desktop"), - ("doc", invalid_version, "mac", "desktop"), ("list-qt", "mac", "desktop", "--arch", invalid_version), ): cli = Cli() @@ -234,52 +227,6 @@ def test_cli_input_errors(capsys, cmd, expect_msg, should_show_help): assert err.rstrip().endswith(expect_msg) -# These commands use the new syntax with the legacy commands -@pytest.mark.parametrize( - "cmd", - ( - "install linux desktop 5.10.0", - "install linux desktop 5.10.0 gcc_64", - "src linux desktop 5.10.0", - "doc linux desktop 5.10.0", - "example linux desktop 5.10.0", - "tool windows desktop tools_ifw", - ), -) -def test_cli_legacy_commands_with_wrong_syntax(cmd): - cli = Cli() - cli._setup_settings() - with pytest.raises(SystemExit) as e: - cli.run(cmd.split()) - assert e.type == SystemExit - - -@pytest.mark.parametrize( - "cmd", - ( - "tool windows desktop tools_ifw qt.tools.ifw.31", # New syntax - "tool windows desktop tools_ifw 1.2.3", - ), -) -def test_cli_legacy_tool_new_syntax(monkeypatch, capsys, cmd): - # These incorrect commands cannot be filtered out directly by argparse because - # they have the correct number of arguments. - command = cmd.split() - - expected = ( - "WARNING : The command 'tool' is deprecated and marked for removal in a future version of aqt.\n" - "In the future, please use the command 'install-tool' instead.\n" - "ERROR : Invalid version: 'tools_ifw'! Please use the form '5.X.Y'.\n" - ) - - cli = Cli() - cli._setup_settings() - assert 1 == cli.run(command) - out, err = capsys.readouterr() - actual = err[err.index("\n") + 1 :] - assert actual == expected - - @pytest.mark.parametrize( "cmd, expect_err", ( @@ -308,28 +255,6 @@ def test_cli_list_qt_deprecated_flags(capsys, cmd: str, expect_err: str): assert err == expect_err -# These commands come directly from examples in the legacy documentation -@pytest.mark.parametrize( - "cmd", - ( - "install 5.10.0 linux desktop", # default arch - "install 5.10.2 linux android android_armv7", - "src 5.15.2 windows desktop --archives qtbase --kde", - "doc 5.15.2 windows desktop -m qtcharts qtnetworkauth", - "examples 5.15.2 windows desktop -m qtcharts qtnetworkauth", - "tool linux tools_ifw 4.0 qt.tools.ifw.40", - ), -) -def test_cli_legacy_commands_with_correct_syntax(monkeypatch, cmd): - # Pretend to install correctly when any command is run - for func in ("run_install_qt", "run_install_src", "run_install_doc", "run_install_example", "run_install_tool"): - monkeypatch.setattr(Cli, func, lambda *args, **kwargs: 0) - - cli = Cli() - cli._setup_settings() - assert 0 == cli.run(cmd.split()) - - def test_cli_unexpected_error(monkeypatch, capsys): def _mocked_run(*args): raise RuntimeError("Some unexpected error") diff --git a/tests/test_install.py b/tests/test_install.py index 536986d9..e3dae8fb 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -354,45 +354,6 @@ def tool_archive(host: str, tool_name: str, variant: str, date: datetime = datet r"INFO : Time elapsed: .* second" ), ), - ( - "tool linux tools_qtcreator 1.2.3-0-197001020304 qt.tools.qtcreator".split(), - "linux", - "desktop", - "1.2.3", - {"std": ""}, - {"std": ""}, - {"std": "linux_x64/desktop/tools_qtcreator/Updates.xml"}, - {"std": [tool_archive("linux", "tools_qtcreator", "qt.tools.qtcreator", datetime(1970, 1, 2, 3, 4, 5, 6))]}, - re.compile( - r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" - r"WARNING : The command 'tool' is deprecated and marked for removal in a future version of aqt.\n" - r"In the future, please use the command 'install-tool' instead.\n" - r"INFO : Downloading qt.tools.qtcreator...\n" - r"Finished installation of tools_qtcreator-linux-qt.tools.qtcreator.7z in .*\n" - r"INFO : Finished installation\n" - r"INFO : Time elapsed: .* second" - ), - ), - ( - "install 5.14.0 windows desktop win32_mingw73".split(), - "windows", - "desktop", - "5.14.0", - {"std": "win32_mingw73"}, - {"std": "mingw73_32"}, - {"std": "windows_x86/desktop/qt5_5140/Updates.xml"}, - {"std": [plain_qtbase_archive("qt.qt5.5140.win32_mingw73", "win32_mingw73")]}, - re.compile( - r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" - r"WARNING : The command 'install' is deprecated" - r" and marked for removal in a future version of aqt.\n" - r"In the future, please use the command 'install-qt' instead.\n" - r"INFO : Downloading qtbase...\n" - r"Finished installation of qtbase-windows-win32_mingw73.7z in .*\n" - r"INFO : Finished installation\n" - r"INFO : Time elapsed: .* second" - ), - ), ( # Mixing --modules with --archives "install-qt windows desktop 5.14.0 win32_mingw73 -m qtcharts --archives qtbase".split(), "windows", @@ -531,26 +492,6 @@ def tool_archive(host: str, tool_name: str, variant: str, date: datetime = datet r"INFO : Time elapsed: .* second" ), ), - ( - "install 5.9.0 windows desktop win32_mingw53".split(), - "windows", - "desktop", - "5.9.0", - {"std": "win32_mingw53"}, - {"std": "mingw53_32"}, - {"std": "windows_x86/desktop/qt5_59/Updates.xml"}, - {"std": [plain_qtbase_archive("qt.59.win32_mingw53", "win32_mingw53")]}, - re.compile( - r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" - r"WARNING : The command 'install' is deprecated" - r" and marked for removal in a future version of aqt.\n" - r"In the future, please use the command 'install-qt' instead.\n" - r"INFO : Downloading qtbase...\n" - r"Finished installation of qtbase-windows-win32_mingw53.7z in .*\n" - r"INFO : Finished installation\n" - r"INFO : Time elapsed: .* second" - ), - ), ( "install-qt windows desktop 5.9.0 win32_mingw53".split(), "windows", From 81c983990a79bc63064c6b408e460b23383c268a Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 29 Sep 2024 11:42:29 +0900 Subject: [PATCH 5/7] refactor: remove legacy commands Signed-off-by: Hiroshi Miura --- aqt/installer.py | 94 ++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 60 deletions(-) diff --git a/aqt/installer.py b/aqt/installer.py index 9fd7bdda..74c3a2b3 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # Copyright (C) 2018 Linus Jahn -# Copyright (C) 2019-2021 Hiroshi Miura +# Copyright (C) 2019-2021,2024 Hiroshi Miura # Copyright (C) 2020, Aurélien Gâteau # # Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -109,7 +109,6 @@ class ListToolArgumentParser(ListArgumentParser): class CommonInstallArgParser(BaseArgumentParser): """Install-*/install common arguments""" - is_legacy: bool target: str host: str @@ -316,8 +315,6 @@ def run_install_qt(self, args: InstallArgParser): """Run install subcommand""" start_time = time.perf_counter() self.show_aqt_version() - if args.is_legacy: - self._warn_on_deprecated_command("install", "install-qt") target: str = args.target os_name: str = args.host qt_version_or_spec: str = getattr(args, "qt_version", getattr(args, "qt_version_spec", "")) @@ -411,12 +408,7 @@ def to_archives(baseurl: str) -> QtArchives: def _run_src_doc_examples(self, flavor, args, cmd_name: Optional[str] = None): self.show_aqt_version() - if args.is_legacy: - if cmd_name is None: - self._warn_on_deprecated_command(old_name=flavor, new_name=f"install-{flavor}") - else: - self._warn_on_deprecated_command(old_name=cmd_name, new_name=f"install-{cmd_name}") - elif getattr(args, "target", None) is not None: + if getattr(args, "target", None) is not None: self._warn_on_deprecated_parameter("target", args.target) target = "desktop" # The only valid target for src/doc/examples is "desktop" os_name = args.host @@ -503,11 +495,9 @@ def run_install_tool(self, args: InstallToolArgParser): """Run tool subcommand""" start_time = time.perf_counter() self.show_aqt_version() - if args.is_legacy: - self._warn_on_deprecated_command("tool", "install-tool") tool_name = args.tool_name # such as tools_openssl_x64 os_name = args.host # windows, linux and mac - target = "desktop" if args.is_legacy else args.target # desktop, android and ios + target = args.target # desktop, android and ios output_dir = args.outputdir if output_dir is None: base_dir = os.getcwd() @@ -655,9 +645,9 @@ def show_aqt_version(self, args=None): """Display version information""" self.logger.info(self._format_aqt_version()) - def _set_install_qt_parser(self, install_qt_parser, *, is_legacy: bool): - install_qt_parser.set_defaults(func=self.run_install_qt, is_legacy=is_legacy) - self._set_common_arguments(install_qt_parser, is_legacy=is_legacy) + def _set_install_qt_parser(self, install_qt_parser): + install_qt_parser.set_defaults(func=self.run_install_qt) + self._set_common_arguments(install_qt_parser) self._set_common_options(install_qt_parser) install_qt_parser.add_argument( "arch", @@ -695,23 +685,20 @@ def _set_install_qt_parser(self, install_qt_parser, *, is_legacy: bool): "It has no effect when the desktop installation is not required.", ) - def _set_install_tool_parser(self, install_tool_parser, *, is_legacy: bool): - install_tool_parser.set_defaults(func=self.run_install_tool, is_legacy=is_legacy) + def _set_install_tool_parser(self, install_tool_parser): + install_tool_parser.set_defaults(func=self.run_install_tool) install_tool_parser.add_argument( "host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64"], help="host os name" ) - if not is_legacy: - install_tool_parser.add_argument( - "target", - default=None, - choices=["desktop", "winrt", "android", "ios"], - help="Target SDK.", - ) + install_tool_parser.add_argument( + "target", + default=None, + choices=["desktop", "winrt", "android", "ios"], + help="Target SDK.", + ) install_tool_parser.add_argument("tool_name", help="Name of tool such as tools_ifw, tools_mingw") - if is_legacy: - install_tool_parser.add_argument("version", help="Version of tool variant") - tool_variant_opts = {} if is_legacy else {"nargs": "?", "default": None} + tool_variant_opts = {"nargs": "?", "default": None} install_tool_parser.add_argument( "tool_variant", **tool_variant_opts, @@ -736,17 +723,15 @@ def _warn_on_deprecated_parameter(self, parameter_name: str, value: str): def _make_all_parsers(self, subparsers: argparse._SubParsersAction) -> None: deprecated_msg = "This command is deprecated and marked for removal in a future version of aqt." - def make_parser_it(cmd: str, desc: str, is_legacy: bool, set_parser_cmd, formatter_class): - description = f"{desc} {deprecated_msg}" if is_legacy else desc + def make_parser_it(cmd: str, desc: str, set_parser_cmd, formatter_class): kwargs = {"formatter_class": formatter_class} if formatter_class else {} - p = subparsers.add_parser(cmd, description=description, **kwargs) - set_parser_cmd(p, is_legacy=is_legacy) - - def make_parser_sde(cmd: str, desc: str, is_legacy: bool, action, is_add_kde: bool, is_add_modules: bool = True): - description = f"{desc} {deprecated_msg}" if is_legacy else desc - parser = subparsers.add_parser(cmd, description=description) - parser.set_defaults(func=action, is_legacy=is_legacy) - self._set_common_arguments(parser, is_legacy=is_legacy, is_target_deprecated=True) + p = subparsers.add_parser(cmd, description=desc, **kwargs) + set_parser_cmd(p) + + def make_parser_sde(cmd: str, desc: str, action, is_add_kde: bool, is_add_modules: bool = True): + parser = subparsers.add_parser(cmd, description=desc) + parser.set_defaults(func=action) + self._set_common_arguments(parser, is_target_deprecated=True) self._set_common_options(parser) if is_add_modules: self._set_module_options(parser) @@ -769,11 +754,11 @@ def make_parser_list_sde(cmd: str, desc: str, cmd_type: str): if cmd_type != "src": parser.add_argument("-m", "--modules", action="store_true", help="Print list of available modules") - make_parser_it("install-qt", "Install Qt.", False, self._set_install_qt_parser, argparse.RawTextHelpFormatter) - make_parser_it("install-tool", "Install tools.", False, self._set_install_tool_parser, None) - make_parser_sde("install-doc", "Install documentation.", False, self.run_install_doc, False) - make_parser_sde("install-example", "Install examples.", False, self.run_install_example, False) - make_parser_sde("install-src", "Install source.", False, self.run_install_src, True, is_add_modules=False) + make_parser_it("install-qt", "Install Qt.", self._set_install_qt_parser, argparse.RawTextHelpFormatter) + make_parser_it("install-tool", "Install tools.", self._set_install_tool_parser, None) + make_parser_sde("install-doc", "Install documentation.", self.run_install_doc, False) + make_parser_sde("install-example", "Install examples.", self.run_install_example, False) + make_parser_sde("install-src", "Install source.", self.run_install_src, True, is_add_modules=False) self._make_list_qt_parser(subparsers) self._make_list_tool_parser(subparsers) @@ -781,12 +766,6 @@ def make_parser_list_sde(cmd: str, desc: str, cmd_type: str): make_parser_list_sde("list-example", "List example archives available (use with install-example)", "examples") make_parser_list_sde("list-src", "List source archives available (use with install-src)", "src") - make_parser_it("install", "Install Qt.", True, self._set_install_qt_parser, argparse.RawTextHelpFormatter) - make_parser_it("tool", "Install tools.", True, self._set_install_tool_parser, None) - make_parser_sde("doc", "Install documentation.", True, self.run_install_doc, False) - make_parser_sde("examples", "Install examples.", True, self.run_install_example, False) - make_parser_sde("src", "Install source.", True, self.run_install_src, True) - self._make_common_parsers(subparsers) def _make_list_qt_parser(self, subparsers: argparse._SubParsersAction): @@ -973,14 +952,10 @@ def _set_archive_options(self, subparser): "(Default: all archives).", ) - def _set_common_arguments(self, subparser, *, is_legacy: bool, is_target_deprecated: bool = False): + def _set_common_arguments(self, subparser, *, is_target_deprecated: bool = False): """ - Legacy commands require that the version comes before host and target. - Non-legacy commands require that the host and target are before the version. install-src/doc/example commands do not require a "target" argument anymore, as of 11/22/2021 """ - if is_legacy: - subparser.add_argument("qt_version", help='Qt version in the format of "5.X.Y"') subparser.add_argument( "host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64"], help="host os name" ) @@ -994,12 +969,11 @@ def _set_common_arguments(self, subparser, *, is_legacy: bool, is_target_depreca ) else: subparser.add_argument("target", choices=["desktop", "winrt", "android", "ios"], help="target sdk") - if not is_legacy: - subparser.add_argument( - "qt_version_spec", - metavar="(VERSION | SPECIFICATION)", - help='Qt version in the format of "5.X.Y" or SimpleSpec like "5.X" or "<6.X"', - ) + subparser.add_argument( + "qt_version_spec", + metavar="(VERSION | SPECIFICATION)", + help='Qt version in the format of "5.X.Y" or SimpleSpec like "5.X" or "<6.X"', + ) def _setup_settings(self, args=None): # setup logging From fddd634b6d893e37019b4a332cd062f35864403d Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 29 Sep 2024 12:29:52 +0900 Subject: [PATCH 6/7] style: remove unused field and apply black Signed-off-by: Hiroshi Miura --- aqt/installer.py | 1 - tests/test_cli.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/aqt/installer.py b/aqt/installer.py index 74c3a2b3..efa257ee 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -721,7 +721,6 @@ def _warn_on_deprecated_parameter(self, parameter_name: str, value: str): ) def _make_all_parsers(self, subparsers: argparse._SubParsersAction) -> None: - deprecated_msg = "This command is deprecated and marked for removal in a future version of aqt." def make_parser_it(cmd: str, desc: str, set_parser_cmd, formatter_class): kwargs = {"formatter_class": formatter_class} if formatter_class else {} diff --git a/tests/test_cli.py b/tests/test_cli.py index 2d30407d..573aebf8 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -105,14 +105,12 @@ def test_cli_invalid_version(capsys, invalid_version): cli._setup_settings() matcher = re.compile( - # r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" + # r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n" r"(.*\n)*" r"ERROR :.*Invalid version: '" + invalid_version + r"'! Please use the form '5\.X\.Y'\.\n.*" ) - for cmd in ( - ("list-qt", "mac", "desktop", "--arch", invalid_version), - ): + for cmd in (("list-qt", "mac", "desktop", "--arch", invalid_version),): cli = Cli() assert cli.run(cmd) == 1 out, err = capsys.readouterr() From 5a2074b4f2a821d65e85ec26628a46519c21d3f6 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Tue, 8 Oct 2024 10:45:50 +0900 Subject: [PATCH 7/7] Update copyright year of aqt/installer.py --- aqt/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aqt/installer.py b/aqt/installer.py index efa257ee..c78bbe58 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # Copyright (C) 2018 Linus Jahn -# Copyright (C) 2019-2021,2024 Hiroshi Miura +# Copyright (C) 2019-2024 Hiroshi Miura # Copyright (C) 2020, Aurélien Gâteau # # Permission is hereby granted, free of charge, to any person obtaining a copy of