Skip to content

Conversation

Kidev
Copy link
Contributor

@Kidev Kidev commented Mar 18, 2025

This PR:

  • Adds the --use-official-installer option to install-qt, enabling a straight forward way to use the official installer while still using the standard install command.
  • Adds tests for the --use-official-installer option
  • Updates authors.rst and official.rst to fix mistakes in the documentation (warnings reported by Codacy)
  • Fixes [Bug]: aqt 3.2.1 fails under python 3.9 #905
  • Fixes the official installer download failure caused by the recent name change of the Qt installer binaries

use-official-installer option

--use-official-installer [email pw]

If used, this will ignore your host parameter, and use the current OS (Qt restriction). You can use it without any parameter if you already signed in (so if you have a qtaccount.ini valid for the current user). Otherwise, you need to provide an email and a password:

kidev:~$ python -m aqt install-qt linux desktop 6.8.2 linux_gcc_64 -m qtpdf --outputdir ./Qt --use-official-installer 'email@gmail.com' 'password'
kidev:~$ python -m aqt install-qt linux desktop 6.8.2 linux_gcc_64 -m qtpdf --outputdir ./Qt --use-official-installer
INFO    : aqtinstall(aqt) v0.1.dev1898 on Python 3.12.8 [CPython GCC 14.2.1 20240910]
INFO    : Using official Qt installer
INFO    : Using credentials provided with --use-official-installer
INFO    : Downloading Qt installer to /home/kidev/.local/share/aqt/tmp/qt-online-installer-linux-x64-online.run
INFO    : Redirected: mirrors.20i.com
INFO    : Running: ['/home/kidev/.local/share/aqt/tmp/qt-online-installer-linux-x64-online.run', '--accept-licenses', '--accept-obligations', '--confirm-command', '--email', '***', '--pw', '***', '--root', '/home/kidev/Work/perso/github/aqtinstall/Qt', '--auto-answer', 'OperationDoesNotExistError=Ignore,OverwriteTargetDirectory=No,stopProcessesForUpdates=Ignore,installationErrorWithCancel=Ignore,installationErrorWithIgnore=Ignore,AssociateCommonFiletypes=Yes,telemetry-question=No', 'install', 'qt.qt6.682.linux_gcc_64']
[0] Arguments: /home/kidev/.local/share/aqt/tmp/qt-online-installer-linux-x64-online.run, --accept-licenses, --accept-obligations, --confirm-command, --email, ******, --pw, ******, --root, /home/kidev/Work/perso/github/aqtinstall/Qt, --auto-answer, OperationDoesNotExistError=Ignore,OverwriteTargetDirectory=No,stopProcessesForUpdates=Ignore,installationErrorWithCancel=Ignore,installationErrorWithIgnore=Ignore,AssociateCommonFiletypes=Yes,telemetry-question=No, install, qt.qt6.682.linux_gcc_64
[1] Operations sanity check succeeded.
[2] Using metadata cache from "/home/kidev/.cache/qt-unified-linux-online"
[2] Found 487 cached items.
[2] QtAccount information:
...
[48546] Done
[48547] Got a replacement installer base binary: "/home/kidev/Work/perso/github/aqtinstall/Qt/installerbase"
[48547] Writing maintenance tool: "/home/kidev/Work/perso/github/aqtinstall/Qt/MaintenanceTool.new"
[48547] Writing maintenance tool.
[48636] Wrote permissions for maintenance tool.
[48640] Wrote the binary with the new replacement.
[48645] Removed installer base binary "/home/kidev/Work/perso/github/aqtinstall/Qt/installerbase" after updating the maintenance tool.
[48661] Maintenance tool hard restart: false.
[48661] Installation finished!
[48662] Components installed successfully
INFO    : Qt installation completed successfully
INFO    : Done

@Kidev
Copy link
Contributor Author

Kidev commented Mar 21, 2025

The installer names seems to have been changed on the Qt repo. I wrote a better way to parse them, and added support for arm64 for windows and linux.
qt-unified-linux-x64-online.run -> qt-online-installer-linux-x64-online.run
https://download.qt.io/official_releases/online_installers/

@Kidev Kidev changed the title Add --use-official-installer to install-qt Add --use-official-installer, fix official installer download after update 4.8 Mar 21, 2025
@Kidev Kidev changed the title Add --use-official-installer, fix official installer download after update 4.8 Add --use-official-installer, fix official installer download after update 4.9 Mar 21, 2025
@miurahr miurahr self-requested a review March 23, 2025 22:35


def extract_auth(args: List[str]) -> Tuple[str | None, str | None, List[str] | None]:
def extract_auth(args: List[str]) -> Tuple[Union[str, None], Union[str, None], Union[List[str], None]]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the #905 fix

return actual.startswith(prefix + expected[0]) and actual.endswith(expected[1])
return actual.startswith(expected[0]) and actual.endswith(expected[1])
return actual.startswith(prefix + expected)
return actual.startswith(expected)
Copy link
Contributor Author

@Kidev Kidev Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bit extreme, but, considering all of this is generated, and that it always creates errors in the test suite that I'm unable to fix on both my PC and the CI (???), I figured maybe just checking for the start to be the help string may be enough

It is the cause of the failure of the current CI run by the way. This fixes it

Version: 6.8.1
Components: qt.tools.qtcreator_gui,qt.tools.cmake,qt.tools.ninja
Required aliases: qt6.8.1-full-dev,qt6.8.1-full-dbg
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was not displayed in the docs, as dropdown is not a thing in .rst. Moreover there is a link to the Qt website with this data somewhere else in the page

if not temp_path.exists():
temp_path.mkdir(parents=True, exist_ok=True)
else:
Settings.qt_installer_cleanup()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar pattern appears 3 or 4 times in the code. I replaced the erasing of the aqt/tmp directory by the removal of its content instead. This make testing for the existence of files in the test suite much easier, as well as making the check for permissions easy by providing an existing folder in the file system of the user

@miurahr miurahr merged commit b789314 into miurahr:master Mar 27, 2025
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aqt 3.2.1 fails under python 3.9
3 participants