Commit Graph

85 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
tsteven4
06b821965d fix list-src,doc,examples for >= 6.8.0 (#880)
Some checks are pending
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.6.3) (push) Waiting to run
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.0) (push) Waiting to run
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.8.1) (push) Waiting to run
Check tox tests / Check packaging 📦 (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Publish Python 🐍 distributions 📦 to PyPI / Build and publish Python 🐍 distributions 📦 to PyPI (push) Waiting to run
Test on GH actions environment / test (binary, windows-latest, 3.12, 6.6.3) (push) Waiting to run
Test on GH actions environment / test (standard, ubuntu-latest, 3.12, 6.5.3) (push) Waiting to run
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.5.3) (push) Waiting to run
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.6.3) (push) Waiting to run
Test on GH actions environment / test (standard, windows-latest, 3.12, 6.7.3) (push) Waiting to run
* fix list-src,doc,examples for >= 6.8.0

* generalize test_list_src_doc_examples_cli for version

* tweak expected url patterns.
2025-01-28 20:55:01 +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
Andrew Wason
1615782c25 Fixes and tests. Untested Azure pipeline support. 2024-03-05 18:37:15 -05:00
Dave Dalcino
7c0de86f78 Add tests for sdktool: install-tool and list-tool 2023-05-24 15:38:13 -07:00
Dave Dalcino
b8222a4a4f Test resilience to missing wasm Updates.xml files
Makes sure that MetadataFactory can still produce a list of
architectures when the standard Updates.xml file is present, but the
expected wasm Updates.xml file is not. This should prevent failures
in the future if the Qt devs decide to change the way WASM works, as
they did with Qt 6.5.0.
2023-02-11 13:31:32 -08:00
Dave Dalcino
e3c7d14c3f Add tests for qt 6.5.0 wasm 2023-02-11 10:35:48 -08:00
Dave Dalcino
24f6d9ddca Add cli tests for long_modules and modules with archives
This should cover the new lines of uncovered code in this PR.
2022-11-21 07:34:46 +09:00
Hiroshi Miura
1dbd73450a Adjust code scanner warnings
- Replace map+filter and list+filter with list comprehension expression
- Use try/except for next(Iterator)
- Add test case for altlink that cause exception on next() in get_altlink
- Avoid exit but use sys.exit

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-11-21 07:34:45 +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
Dave Dalcino
81eebde168 Adjust against mypy type errors 2022-11-20 15:20:27 +09:00
Dave Dalcino
3dab855941 reduce uncovered lines 2022-11-16 16:14:55 -08: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
Dave Dalcino
703f2d2fe3 rework logic for readability 2022-08-20 09:09:23 -07:00
Dave Dalcino
78fe5f30eb Improve unit test coverage 2022-08-20 09:04:40 -07:00
Dave Dalcino
f0a48068ba Add function to select default installed mingw architecture 2022-08-20 07:52:56 -07:00
Dave Dalcino
910159f618 Add function to choose default desktop architecture 2022-08-20 07:52:39 -07:00
Hiroshi Miura
4ea02ebe07 Merge pull request #550 from ddalcino/fix-suggested-action-exception
Fix kwargs passed up AqtException inheritance tree
2022-08-12 23:06:49 +09:00
Hiroshi Miura
d30618791c Merge pull request #547 from ddalcino/list-qt-desc-modules
Add `aqt list-qt --long-modules`
2022-08-12 22:57:04 +09:00
Dave Dalcino
d867f417a3 rename new test 2022-08-11 21:52:57 -07:00
Dave Dalcino
0650ac9283 Improve testing of connection/download/checksum exceptions
This adds a new test that recreates #546
2022-08-11 21:40:39 -07:00
Dave Dalcino
a94717aa32 Tests for aqt list-qt --long-modules 2022-08-08 17:48:44 -07:00
Dave Dalcino
9bc8b553ee Refactor ToolData into reusable TableMetadata class 2022-08-08 17:41:11 -07:00
Dave Dalcino
9422b9fc67 Make MetadataFactory respect baseurl set in arguments 2022-08-07 11:27:31 -07:00
mite-user
53395ec326 Remove "test_list_bad_html()"
"test_list_bad_html()" expects error on unexpected html structure.
This error no longer occurs because html is handled differently
after the last 2 commits.
2022-07-21 18:37:10 +03:00
mite-user
640f81714b Add tests for the previous commit
Each ".html" isn't handled properly by the code before the previous commit.

"mirror-pre-a.html"
https://qtproject.mirror.liquidtelecom.com/online/qtsdkrepository/windows_x86/android/
No "<table>".

"mirror-table-before-pre-a.html"
https://ftp1.nluug.nl/languages/qt/online/qtsdkrepository/windows_x86/android/
"<table>" which doesn't contain folder names.

"mirror-first-td.html"
https://mirrors.dotsrc.org/qtproject/online/qtsdkrepository/windows_x86/android/
"<a>" is in the first "<td>", not second.

"mirror-tag-in-a.html"
https://mirrors.sjtug.sjtu.edu.cn/qt/online/qtsdkrepository/windows_x86/android/
There are other elements besides folder name inside the contents of "<a>".
2022-07-21 18:37:10 +03:00
Mozi
60889b7296 Log: left align the level name with padding (#539)
* Change log format for brief

- prepend %(levelname)s:

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

* Update test expectations for error/warning messages

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

* log: left align the level name with padding

Why 8: sizeof("CRITICAL") == 8

Ref:
  printf-style String Formatting § Built-in Types — Python 3 documentation
  https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

* log: remove the duplicate "warning" words

Co-authored-by: Hiroshi Miura <miurahr@linux.com>
2022-07-18 22:29:16 +09:00
Dave Dalcino
e8672f3fbe Allow MetadataFactory to recover from bad HTML files
This change allows MetadataFactory.iterate_folders to recognize when
MetadataFactory has retrieved a malformed HTML file, or an HTML file
that does not contain the table and rows that it expects to see.

If the URL is correct, it should retrieve the right page, but this is
not guaranteed, and MetadataFactory should be able to recover and
generate an appropriate error message.

One possible situation where this kind of error might occur could be
when the user is connected to a public WIFI network, but not logged in.
The router would redirect aqt to the network login page, and aqt would
have no way of knowing that it did not receive the correct page.
Aqt should be resilient to this kind of error.
2022-04-19 18:26:21 -07:00
David Dalcino
b62db9ee2a Allow MetadataFactory.fetch_http to skip sha256
`MetadataFactory.fetch_http` must often download HTML pages, not
Updates.xml files. download.qt.io does not store checksums for these
files, so this particular function must be allowed to download these
pages without using a checksum.
2022-03-06 18:16:37 -08:00
David Dalcino
be23b62549 Update tests to require proper checksums 2022-03-06 17:56:25 -08:00
David Dalcino
092d4e8c02 Add tests for list-src, list-doc, list-example 2021-11-23 11:08:07 -08:00
David Dalcino
7104dbcdf7 Merge remote-tracking branch 'upstream/master' into add-list-qt-archives 2021-09-20 18:49:46 -07:00
David Dalcino
f78013d361 Improve suggested follow-up for --modules flag 2021-09-17 16:14:49 -07:00
David Dalcino
b67749e4fc Add tests 2021-09-17 14:48:57 -07:00
David Dalcino
f037a96457 Raise ArchiveListError where appropriate 2021-09-17 09:53:35 -07:00
David Dalcino
49cde4ee30 fix test error 2021-09-17 08:32:49 -07:00
David Dalcino
2c7e0a157d Add failing tests to list archives 2021-09-17 08:31:14 -07:00
David Dalcino
1a918c35c5 Merge remote-tracking branch 'upstream/master' into specify-version-by-simplespec 2021-09-09 08:26:10 -07:00
Hiroshi Miura
320a20abb2 Merge pull request #385 from ddalcino/improve-error-handling
Improve error handling
2021-09-08 15:46:17 +09:00
David Dalcino
5a1aedb480 Add functions to determine extensions
This moves the logic for determining extensions out of the QtArchive
class so that it is available elsewhere and does not need to be
duplicated.
2021-09-07 14:27:51 -07:00
David Dalcino
a380f5c1ea Allow list-qt to describe Qt 6.2 wasm target
On August 19, the Qt repo added a new wasm release for Qt 6.2.0.
`list-qt` currently prints that the `wasm` extension is available for
that version of Qt, but it will not let the user use it to query
modules and architectures, because of a hardcoded version check.
This change rewrites the version check so that a user may make queries.
2021-09-01 13:38:09 -07:00
David Dalcino
f63fcc5c79 Add AqtException base exception class
This also moves the `format_suggested_follow_up` function into the new
AqtException class, refactors `show_list` to use the new exceptions,
and tests the new code appropriately.
2021-09-01 11:42:45 -07:00
David Dalcino
8bc7cc3bf3 Add addons. test for metadata module 2021-08-17 15:39:34 -07:00
Hiroshi Miura
6ce29982b3 Merge pull request #359 from ddalcino/add-test-install
Add 'tests/test_install.py'
2021-08-06 08:08:40 +09:00
David Dalcino
c95516ed8e Remove re.Pattern type hint
In Python 3.6, `re.Pattern` does not exist, and using it as a type hint
causes the tests to fail. This change enables the tests to run on
Python 3.6.
2021-08-04 15:43:56 -07:00
Hiroshi Miura
a767956a5b Coding style update by Black/isort
Change to max line length to 125

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-02 13:41:41 +09:00
David Dalcino
f590ff78ef black 2021-07-22 11:41:32 -07:00
David Dalcino
08a0ad0182 Add test, impl for optional 'tools_' prefix 2021-07-22 11:36:06 -07:00