Commit Graph

271 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
Alexandre Poumaroux
a09b5cee28 Fix WASM (#846)
* Rewrite WASM support

* Add WASM tests to CI, update CI to test more the latest versions, add auto EMSDK version detection function

* Fix some mistakes, typos, moved emsdk version function into BuildJob

* Fix issue related to extensions interfering with wasm on 6.8+

* Fix tests

* Remove dep on Version in CI

* Remove safety before patch

* handle cases where extensions don't exist.

for example with windows desktop 6.8.1 win64_msvc2022_arm64_cross_compiled
both qtwebengine and qtpdf don't exist.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* for --long-modules assume extension doesn't exist on download error.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* for --modules assume extension doesn't exist for download failures.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* reformat with black

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* fix flake8 regression that doesn't occur locally.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Fix autodesktop by also updating the OS when searching for a valid desktop version to download

* Fix extension issue, reduce the possible retry for getting extensions to prevent server spam

* Fix CI asking for msvc2019 on 6.8+ but its no longer supported

* Make CI use C++20 and MSVC2022

* Fix linux build

* Update runners to windows-2022

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Fix patching

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Add back the semantic version changes to prevent crashes, add tests for it

* Update checks

* Cast 'https://mirrors.ustc.edu.cn' to the shadow realm

* Again

* Update settings.ini

* Update settings.ini

* Update settings.ini

* Remove one_rep on silent

* Update settings.ini

* Restore master settings, remove hash check

* ci: Use specific mirror

Attempt to work around download errors in Azure due to Qt's official download site often redirecting to mirrors to which the network connection is unstable

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Re enable hash checking

* Treat read timeout error during download as connection error

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Add test for modules in WASM with autodesktop

* Fix format

* Fix test

* Make '--autodesktop' trigger its own install process, and test it

* Fix older autodesktop tests

* Add mock update files for 680 wasm, add test for wasm 680 autodesktop

* Passes the additional tests

* Fix format

* Improve coverage, fix format

* Fix tests and improve logging or install

* Fix format

* Fix regression in other tests

* Use flavor

* Fix line len

* Fix codeql

* Fix list-qt for WASM arch on 6.5.x and 6.6.x, restore to original download URL

* Fix test error

* Revert ci settings URL as it is never used by clients, only in CI

* Add comment for clarity in ci/settings.ini

---------

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>
Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Co-authored-by: J.D. Purcell <jdpurcell@gmail.com>
2025-01-06 15:35:40 +09:00
tsteven4
3f2f59d488 appease mypy Version no-untyped-call (#864)
* appease mypy Version no-untyped-call

Without the type hint we get:
error: Call to untyped function "Version" in typed
context  [no-untyped-call]

Note that our Version is derived from semantic_version, which
doesn't have type hints.

* mark class definition __init__ functions -> None.

This prevents reviewdog from generating an no-untyped-call warning
when a new instance of the class is created.  This behavior is
a time bomb.  reviewdog flags the warning at the line the new instance
was added, which is within the scope of the diffs, but the problem lies
elsewhere, in the class definition.

* fix mypy import-untyped error.
2024-12-21 10:02:21 +09:00
tsteven4
a4cf04e972 handle Updates.xml Operation extract elements. 2024-11-30 16:11:22 -07:00
Hiroshi Miura
46d334a123 Merge pull request #823 from miurahr/topic/miurahr/drop-old-syntax
Some checks failed
Check tox tests, lint and types / Check packaging 📦 (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Publish Python 🐍 distributions 📦 to PyPI / Build and publish Python 🐍 distributions 📦 to PyPI (push) Has been cancelled
Test on GH actions environment / test (binary, windows-latest, 3.12, 6.6.3) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.5.3) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.6.3) (push) Has been cancelled
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.0) (push) Has been cancelled
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.5.3) (push) Has been cancelled
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.6.3) (push) Has been cancelled
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.7.3) (push) Has been cancelled
refactor: remove legacy subcommand syntax
2024-10-11 09:38:44 +09:00
J.D. Purcell
44ee2e8a8c fix: installation of 6.8 win64_msvc2022_arm64_cross_compiled 2024-10-10 08:49:25 -04:00
Hiroshi Miura
5a2074b4f2 Update copyright year of aqt/installer.py 2024-10-08 10:45:50 +09:00
Hiroshi Miura
fddd634b6d style: remove unused field and apply black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-09-29 12:30:16 +09:00
Hiroshi Miura
81c983990a refactor: remove legacy commands
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-09-29 12:17:54 +09:00
Hiroshi Miura
2a8eb72c0b refactor: test: update cases and expectations
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-09-29 12:17:44 +09:00
Mozi
7a0120ff45 fix: remove logic to check or warn about unknown combinations 2024-08-16 03:01:24 +00:00
Hiroshi Miura
307d856f0c fix: remove logic to check combination
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-08-05 07:42:02 +09:00
Hiroshi Miura
d0260e035a fix: delete combination check
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-08-04 16:12:19 +09:00
Hiroshi Miura
7ad738b3a0 style: apply black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-06-21 03:16:59 +09:00
Hiroshi Miura
b8f7ed69c1 feat: support list Qt 6.8.0 windows_arm64
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-06-20 21:15:13 +09:00
Andrew Wason
f049a82d9d Override host/target for src/docs if Qt >= 6.7.0 (#776)
* Override host/target for src/docs if Qt >= 6.7.0

Fixes https://github.com/miurahr/aqtinstall/issues/775
2024-05-05 09:28:02 +09:00
Andrew Wason
d0603a2555 Handle linux desktop arm64 arch with Qt 6.7.0 via new linux_arm64 host.
Top level directories are `qtsdkrepository/linux_x64` or `qtsdkrepository/linux_arm64`
qtsdkrepository files are suffixed with `.linux_gcc_64` or `.linux_gcc_arm64`
Installation directory is `gcc_64` or `gcc_arm64`
2024-03-05 09:55:10 -05: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
Dave Dalcino
dcc6924222 update documentation for --autodesktop flag 2023-09-12 16:21:48 -07:00
Hiroshi Miura
c059593817 Merge pull request #705 from ddalcino/topic/ddalcino/cli/warn-ext7zr
Log a warning when aqtinstall falls back to an external 7z extraction tool
2023-09-12 07:35:30 +09:00
Dave Dalcino
5c2c18d96b Fix installation of win64_msvc2019_arm64 arch
This fixes the behavior of the `--autodesktop` flag and the updater,
when installing win64_msvc2019_arm64 for desktop targets.
2023-09-06 18:09:02 -07:00
Dave Dalcino
2bc3766da7 fix format string without placeholders 2023-08-28 05:28:46 -07:00
Dave Dalcino
70dbe2a997 mypy 2023-08-28 05:28:46 -07:00
Dave Dalcino
85037194fe Remove fallback parameter 2023-08-28 05:28:45 -07:00
Dave Dalcino
1eeebfb44d Add passing impl for refactored _set_sevenzip 2023-08-28 05:28:45 -07:00
Dave Dalcino
c3195c9d64 Use 'tar' filter when extracting tarfiles
This is to address a SNYK warning. The new code will only run on Python
3.11.4 and above
2023-08-27 18:45:46 -07:00
David Dalcino
a6fe17edb7 Fix help text for list-tool
Flags must either precede or follow the entire list of positional arguments.
2023-05-24 14:00:07 -07:00
Dave Dalcino
ded8aa481c Fix failure to install-{src,doc} on windows
This adds the ability to unzip zip files, as well as tar.xz
2023-03-30 05:46:14 -07:00
Dave Dalcino
a92291eb21 Implement extraction of .tar.gz source files 2023-03-25 11:30:27 -07:00
Dave Dalcino
8dd56ff461 Catch OSError(errno.ENOSPC) and PermissionError
When the destination drive is not writable or has insufficient space,
these exceptions are raised during `run_installer`. Unless they are
caught and dealt with, `aqtinstall` requests that the user file a bug
report. This change catches these errors and prints a nice error message
instead of requesting a bug report.
2023-03-13 17:48:09 -07:00
Dave Dalcino
265c95d116 Simplify Cli._select_unexpected_modules logic
This function simply returns a set difference, so there's no need for it
to be any more complicated than that.
2023-02-16 14:55:16 -08:00
Dave Dalcino
a6db5da83d Refactor warning messages into reusable functions
This will reduce code duplication and make the warning messages easier
to improve in the future, since they will only need to be changed in one
location.
2023-02-16 14:24:47 -08:00
Dave Dalcino
6a0c174e01 Improve warning messages re: unknown aqt arguments
This improves the warnings about unknown versions, modules, and
architectures of Qt, so that it is more explicit what the message
actually means.

This changes the purpose of `Cli._check_modules_arg` from checking if
modules exist in combinations.json, to returning a list of modules
that do not exist in that file. The function has been renamed as well.
This change was necessary to make the warning message more informative.
2023-02-16 14:01:39 -08:00
Dave Dalcino
5a60b6d6e1 Update logic for --autodesktop flag
The `--autodesktop` flag is only useful when installing Qt6 for mobile
or wasm. The previous implementation would unnecessarily cause it to
install a desktop Qt for Qt5 mobile installations. This change ensures
that `--autodesktop` will not install an extra desktop Qt for any Qt5
installation.
2023-02-13 13:13:04 -08:00
Dave Dalcino
6e97b9fca9 Update documentation for --autodesktop flag
The `--autodesktop` flag is only useful when installing Qt6 for mobile
or wasm. There is no need to have an additional desktop Qt installation
for any Qt5 mobile or wasm installs. This updates the docs to reflect
that.
2023-02-13 13:13:03 -08:00
Hiroshi Miura
0f1010baee Load settings.ini in child process
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-12-05 19:50:51 +09:00
Dave Dalcino
452f8d74b2 Fix mypy type errors
- Introduce classes inherit argparse.ArgumentParser to suppress mypy
  errors in Cli class.
- `requests.session.Session.get()` expects that `timeout` is `float | tuple[float, float] | tuple[float, None] | None`
  so use `Tuple[float, float]` for timeout
- Use named tuple for modules_query
- Update test_list.py
2022-11-21 07:34:45 +09:00
Hiroshi Miura
7362621618 installer.py#installer: base_dir is always not None
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-11-20 15:20:27 +09:00
Hiroshi Miura
d95b5d7f05 mypy: improve SrcDocExample func
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-11-20 15:20:27 +09:00
Hiroshi Miura
c1627a9686 mypy: update untyped defs
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-11-20 15:20:27 +09:00
Dave Dalcino
81eebde168 Adjust against mypy type errors 2022-11-20 15:20:27 +09:00
Hiroshi Miura
893439fbbc PEP8
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-11-17 10:46:07 +09:00
Dave Dalcino
c90b262984 remove extensions from ArchiveId 2022-11-16 16:14:55 -08:00
Dave Dalcino
caee04bcb3 Remove extensions 2022-11-16 16:14:54 -08:00
EtlamGit
924e4b087b improve link to report issue
When we print the link with trailing dot, some automatic log-formaters will add that dot to the link itself.
E.g. when you use Github Actions this link will show up with extra dot and therefore does not work.
By removing the dot, the link is functional also in these cases.
2022-11-05 11:24:18 +01:00
Dave Dalcino
b52fa0f3e5 Fix log message for Qt that requires desktop version 2022-10-12 18:11:29 -07:00
Dave Dalcino
42481c42e1 Allow --autodesktop to autoinstall desktop qt for qt6/wasm.
Apparently, Qt6 for wasm does not ship with qmake, so CI must install it.
This change leverages `--autodesktop` for that purpose.
2022-10-10 22:57:21 -07:00
Dave Dalcino
703f2d2fe3 rework logic for readability 2022-08-20 09:09:23 -07:00
Dave Dalcino
0a8dd41dfa Fix formatting of version in paths 2022-08-20 09:04:52 -07:00