Commit Graph

20 Commits

Author SHA1 Message Date
Alexandre Poumaroux
5d699b9ebf Commercial fixes, CI tests, more tests, coverage (#883)
* Add authentication flags for list-qt-commercial, add tests for coverage

* Add dry run

* Make tests really use auth since secrets have been added, fix some indents

* Fix auth issue, rename user 'email, and password 'pw'

* Fix modules param type

* Update commands names
2025-02-22 09:56:56 +09:00
Alexandre Poumaroux
cbe159f38a Add support for commercial versions of Qt (#878)
* Add install-qt-commercial feature and tests

* Make the auto-answers parameters, fix linter issues

* Fork and execv instead of using subprocess

* Return to simpler process execution method version

* Fix test

* Move commercial installer into its own file

* Fix shadowing of symbol platform causing errors

* Adapt test_cli for argparse format changes on py 3.13+

* Fix some errors, monkeypatch install test

* Add --override super command

* Properly handle --override and grab all the remaining commands when no quotes are given

* Fix tests

* Add base for modules, some niche features are not yet entirely implemented, and there are no updates to the testsuite

* Fix some mistakes

* Fix errors made with the monkeypatch, update Settings to make sure its init

* Tests commercial (#20)

* Full support of installation of all modules and addons
* Add auto setup of cache folder for each OS, add unattended parameter
* Fix settings folders
* Add graceful error message for overwrite case

* Fix windows issue

* Hidden summon works

* Remove both subprocess direct calls

* Dipose of temp folder

* Fix path issue

* Add list-qt-commercial command

* Fix help info

* Make no params valid for list-qt-commercial

* Fix lint errors, and param overflow when no args are passed to list

* Fix search

* Add tests for coverage, fix lint

* Test for overwriting, and for cache usage coverage

* Return to clean exec, ignoring CI fail to preserve code clarity

* Fix parsing of subprocess.run output for some python versions

* Make output more readable in console for list-qt-commercial

* Forward email and password to list request for users without a qtaccount.ini

* Change default settings

* Fix lint errors

* Fix check error
2025-01-28 20:51:53 +09:00
lebarsfa
612dc7ba91 Add ignore_hash option in settings.ini (#684)
* Settings: add an option to skip checksum verification on Updates.xml

This allows aqt to work even when the server download.qt.io is
unreachable.

Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>

* Update settings.ini

* Correct option to skip checksum verification

* Rename ignore_hash option to INSECURE_NOT_FOR_PRODUCTION_ignore_hash

* Update doc about INSECURE_NOT_FOR_PRODUCTION_ignore_hash

* Add hash_algorithm option

* Unofficial mirrors might not provide any hash for Updates.xml

* docs: update configuration.rst

express default value of hash_algorithm

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* fix: hashlib constructor with usedforsecurity=False

- Python 3.9 and later introduce a keyword argument ``usedforsecurity``
- Set to False because we use hash to check file integrity not for password hash.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Attempt to fix parameter type inconsistency in downloadBinaryFile

---------

Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Co-authored-by: Alberto Mardegan <mardy@users.sourceforge.net>
Co-authored-by: Hiroshi Miura <miurahr@linux.com>
2023-11-06 07:29:03 +09:00
Hiroshi Miura
f53616523c fix: remove a mirror that can be error
- remove https://mirrors.sjtug.sjtu.edu.cn/qt/ from fallbacks
- Adjust from report #687

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2023-06-02 22:33:56 +09:00
David Dalcino
b92ee9935d Add setting for trusted_mirrors 2022-03-06 17:36:32 -08:00
Christian Hoffmann
10e5bdf898 Update fallback mirror list
Some of the currently listed mirrors are no longer part of the official
mirror list by qt.io, some return 404, some don't fully mirror the
tree.

The list has been generated via the following one-liner:
blacklist=$(sed -rne '/blacklist:/,/fallbacks:/p ' aqt/settings.ini); for mirror in $(curl -s https://download.qt.io/static/mirrorlist/ | grep -oP 'href="\K(http.*)(?=">HTTP</a>)' | sed -re 's|^http:|https:|; s|([^/])$|\1/|'); do grep -qF "$(sed -re 's|^https?://([^/]+).*$|\1|' <<<"${mirror}")" <<<"$blacklist" && continue; code=$(curl -I "${mirror}online/qtsdkrepository/windows_x86/desktop/qt6_623/qt.qt6.623.win64_msvc2019_64/6.2.3-0-202201260729qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z" --write-out '%{response_code}' --silent -o /dev/null); [[ $code == 200 ]] && echo "    ${mirror}"; done
2022-02-06 23:54:40 +01:00
David Dalcino
d6a6f79740 Prevent listing modules <= 40 bytes uncompressed
This prevents `list-*` from printing any module whose uncompressed size
is 40 bytes or less.

I have found a couple of modules that are exactly 40 bytes, and they
include no files, only empty directories. If any user tries to install
these modules, they will think that aqt failed to install the module
without printing any error message. I prefer to avoid this issue
by preventing `aqt list-*` from printing them.

`aqt install-*` is unaffected by this change, and it can still install
modules that contain no files. It is likely that we will need to print
a warning when this occurs.

If any user disagrees with the threshold value of 40 bytes, they are
free to adjust that value to their liking in `settings.ini`.
2021-11-26 14:04:10 -08:00
David Dalcino
7d5ee32ac3 Add settings entries for --keep & --archive-dest
This allows a user to turn on `--keep` every time they run the program,
and to set the default archive destination when `--keep` is turned on.
Using `--archive-dest` overrides the archive destination in setting.ini.
2021-11-24 14:01:26 -08:00
Chocobo1
f450682808 Add more fallback URL to settings.ini
The list is taken from https://download.qt.io/static/mirrorlist/
and verified manually whether https is available.
2021-10-28 12:02:13 +08:00
David Dalcino
620639f53c [SECURITY] Use HTTPS for mirror site
I noticed a non-TLS mirror in our list of fallback mirrors. I checked the site, and an HTTPS version exists: https://ftp1.nluug.nl/languages/qt/

Since this is a security issue, I think we should backport this change to aqt v1.2 as well.
2021-10-24 13:29:53 -07:00
David Dalcino
be72b00bfc Add max_retries_on_connection_error
This change deprecates the `max_retries` option in settings.ini,
replacing it with `max_retries_on_connection_error`, in order to
differentiate it from `max_retries_on_checksum_error`.
2021-10-04 08:04:57 -07:00
David Dalcino
4b99ee5755 Allow retry of download on checksum error 2021-10-03 16:13:35 -07:00
David Dalcino
01f078161e Add setting to turn on stack trace in output 2021-09-01 11:45:18 -07:00
Hiroshi Miura
a14f6a6d8b helper: make max_retries configurable (#296)
* helper: make max_retries configurable

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-06 08:44:00 +09:00
Hiroshi Miura
f35edf398a Fix logging in installer sub-process when multiprocessing context with spawn method (#273)
* Simplify logging

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Update logging

- keep logging file path in Settings
- introduce installer logger

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8/Black

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Logging: add queue handler

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Logging: introduce logutils module

- Add QueueListenerHandler
- Add queue listener handler config
- qualname to aqt.installer

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Logging: introduce aqt.updater logger

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Logging: introduce aqt.main and aqt.archives logger

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8/Black

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Logging: simplify config file

- use propergate for last output handler
- change formatter
  * console: brief
  * file: verbose
- Use multiprocessing.Queue() instead of queue.Queue()
- Remember logging config file customization in Settings
- QueueListener use handler as of getLogger("aqt").handlers

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* change log level of redirection

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Logging: Single global LoggingQueueListener

- Global instance of LoggingQueueListener
- Drop queue_listener from logging.ini
- Generate QueueHandler from LoggingQueueLisnter.get_queue_handler
- Explicitly close QueueListenerHandler and Queue object.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* CI: use verbose console logging for ci

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* CLI: drop options to specify logger and logger configuration file

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Make Instance of LoggingQueueListener in Cli class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Handle QueueListener in Cli.call_installer

- Use mp.Manager().Queue()
- start(), stop() in caller
- Gracefully close QueueHandler in installer

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Drop berkeley.edu from fallbacks of mirror site

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Fix log format of time digits

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Update settings load

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* CI: catch custom settings from change in master branch

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Show log when loading custom settings

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Improve subprocess logging that use root logger

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* fix logging.ini settings

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Fix against tests

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Introduce MyQueueListener

- Inherit System QueueListner to override logger name

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8/Black

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-06-21 15:25:00 +09:00
Hiroshi Miura
99b9c216a5 Inroduce --kde option for src subcommand
It apply KDE patch collection to Qt 5.15.2 source
`aqt src 5.15.2 linux desktop --kde`

Patch collection is based on Qt 5.15.2, so only the version can be patched.

Ref #231

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-06-19 15:02:08 +09:00
Hiroshi Miura
089cc3427c settings.ini: use multiline configuration for URL list
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-23 14:05:17 +09:00
Hiroshi Miura
824dd799d4 settings.ini: don't use quote for value
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-23 13:06:14 +09:00
Hiroshi Miura
4c0638250c Move constants into settings.ini configuration
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-23 13:00:31 +09:00
Hiroshi Miura
3e65a0c695 Introduce Settings class
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-24 12:31:58 +09:00