Commit Graph

173 Commits

Author SHA1 Message Date
Hiroshi Miura
eb164e552b Improve type definitions and styles (#869)
- exclude .reviewdog.yml from source distribution
- Add more type hints
- protective check for self.config in SettingsClass

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-12-24 14:45:04 +09:00
tsteven4
f914397685 fix source/doc/examples with qstkdrepo changes. (#857)
Some checks failed
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) 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, ubuntu-latest, 3.12, 6.8.1) (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
* fix source/doc/examples with qstkdrepo changes.

This handles all_os/qt/qt6_xyz_src_doc_examples changing
to all_os/qt/qt6/xyz/[unix|windows]_line_endings_src
for both list and install commands.

* configure pylint max-line-length to match others.

* Revert "configure pylint max-line-length to match others."

This reverts commit 8ebba90c36.
2024-12-21 10:03:13 +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
Hiroshi Miura
5ee98eff82 Merge pull request #854 from tsteven4/androidinstall
Some checks are pending
Check tox tests, lint and types / 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, 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
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 computation of archive location for android install.
2024-12-16 23:11:53 +09:00
tsteven4
9ae5295ae4 fix computation of archive location for android install. 2024-12-15 14:32:36 -07:00
tsteven4
c8793b3f06 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.
2024-12-14 09:16:52 -07:00
tsteven4
8a117b7081 Merge branch 'master' into qtextensions 2024-12-02 07:04:43 -07:00
tsteven4
1b2a9b2715 try to fix type test again, add 6.8.1 test 2024-11-30 16:33:46 -07:00
tsteven4
a4cf04e972 handle Updates.xml Operation extract elements. 2024-11-30 16:11:22 -07:00
tsteven4
a1ffb938a8 fix regression "check packaging" 2024-11-28 11:43:16 -07:00
tsteven4
ee40b25e84 fix regression failures. 2024-11-28 11:28:56 -07:00
tsteven4
5a13230a3b fix pre 6.8.0 installs 2024-11-28 10:17:27 -07:00
tsteven4
aa222a59db search a list of possible extensions.
currently qtwebengine, qtpdf.
2024-11-27 15:12:29 -07:00
tsteven4
1d528c205f look for modules in extensions directory. 2024-11-27 12:00:03 -07:00
Hiroshi Miura
65e760383f fix: remove logic to check combination
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-08-05 08:00:32 +09:00
Hiroshi Miura
56c2a38756 fix: doc/src/example URL in Qt 6.8.0
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-07-30 12:58:08 +09:00
Hiroshi Miura
649c55ed46 fix: installation of android for Qt 6.8.0 (#801)
* fix: installation of android for Qt 6.8.0

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

* style: wrap a long line

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

* style: apply black

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

---------

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-07-02 12:20:58 +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
Hiroshi Miura
196cf2b495 feat: support windows/6.8.0 install
test command line
aqt install-qt windows desktop 6.8.0 win64_msvc2022_64
and
aqt install-qt windows desktop 6.8.0 win64_mingw

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-06-20 19:42:50 +09:00
AdrianEddy
47cd6d35ab Fix installing Qt for Android 6.7.0 2024-05-23 01:55:23 +02: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
e30d3198a4 Fix errors in install-* caused by duplicate 'modules'
Fixes #632
2023-01-07 06:57:28 -08: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
David Dalcino
acc0f53eb1 improve check for empty subarchives
Co-authored-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
Dave Dalcino
8faa44c9ba Fix downstream type errors 2022-09-21 16:26:26 -07:00
Dave Dalcino
2d1d71df8d Allow for empty DownloadArchive tags
This also updates the type hints for the PackageUpdate class, to make
it easier to understand the datatypes. It also adds some assertions
to prove what types they are.
2022-09-21 16:25:09 -07:00
Hiroshi Miura
2a89308818 Add Updates, PackageUpdate data class
- Drop update_xml and its content from field of QtArchives class
- Add test for Updates class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-06-12 00:13:00 +09:00
Hiroshi Miura
638f94a690 archives: do not keep update.xml text in field
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-06-11 12:19:42 +09:00
David Dalcino
dc45839df4 Fix implementation of helper.get_hash
Causes `get_hash` to verify the hash length, and check that the hash can
be unhexlified properly.

Fixes the interface for `get_hash` so that the caller does not have to
run `binascii.unhexlify` or verify its output.
2022-03-20 14:16:24 -07:00
David Dalcino
5ad7c1a058 Use defusedxml to parse Updates.xml files
I don't think we can really call the `Updates.xml` files that we are
parsing 'untrusted xml', because we are checking that they match the
sha256 checksum. However, I don't think there's any good reason not to
use a more secure parsing algorithm.
2022-03-10 17:23:58 -08:00
David Dalcino
f979d80899 WIP use checksums for updates.xml files 2022-03-06 17:56:25 -08:00
David Dalcino
96af3eb393 Refactor: split QtArchive.archive_url into parts
This splits QtArchive.archive_url into two new datamembers: archive_path
and base_url. Ultimately, base_url should be removed from QtPackage
entirely.
2022-03-06 17:36:32 -08:00
David Dalcino
7ebd6aa34e Use sha256 hashes only from trusted mirrors
To keep this commit small, `hashurl` was removed from QtPackage, and
`get_hash` constructs the hash url based on the url of the 7z archive
to download. I think that in the future, QtArchive and QtPackage could
be refactored to construct this url more appropriately. However, this
would be a complicated change that doesn't belong in this commit.
2022-03-06 17:36:32 -08:00
Hiroshi Miura
eaf5a46e48 Merge pull request #459 from ddalcino/fix-archives-flag
Restrict effect of `--archives` flag to base and debug_info modules
2022-01-26 14:21:47 +09:00
Hiroshi Miura
9b66f03718 Accept Update.xml that use comma without space as delimiter
resolve #475

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-01-12 22:24:16 +09:00
David Dalcino
9c706a270c Fix implementation of --archives flag 2021-12-05 11:53:38 -08:00
David Dalcino
078154c0db refactor QtArchives base pkg name accessors
This adds an accessor function, `QtArchives._base_package_names`,
that returns a list of all possible PackageUpdate.Name properties
for the base package

This also renames `QtArchives._base_target_package_name` to
`_base_module_name`, so that its meaning is more clear in context
and not so easy to confuse with the new function.
2021-12-05 11:53:35 -08:00
David Dalcino
022373683b Allow SrcDocExamplesArchives to omit base
This change allows for the future implementation of a `--noarchives`
flag for the `install-src/doc/example` commands.
I don't know if end users will need this or not, but I need this to
determine whether or not archive filtration works properly.
This property is tested in `tests/test_archive.py` at
`test_archives_weird_module_7z_name()`.
2021-12-05 11:53:31 -08:00
David Dalcino
cfc241002d Fix suggestions for src/doc/ex missing modules 2021-11-23 12:17:03 -08:00
David Dalcino
621cd7a6c0 Fix implementation of aqt tool
This modifies `aqt tool` to allow `-` characters in tool versions, so
that `aqt tool` can pass the same unit tests that `install-tool` can.
This makes it less like the `aqt tool` from v1.2.5, but it should work
better with more tools with different version formats.
2021-10-30 19:23:35 -07:00
David Dalcino
38a125ee6b Clarify meaning and scope of all_archives
This is a code-readability improvement. Every time I read this code,
I get tripped up by the `if not all_archives:` line, and I have to hunt
for all uses of `all_archives` to see what it means and what it does.

This change moves the assignment next to its usage, so its meaning and
scope are immediately clear, and no hunting is necessary. This also
gives it a less ambiguous name.

This change will likely make the reader wonder if this variable is
needed at all; the conditional `if subarchives is not None:` would
probably work just as well. I would tend to agree.
However, I am leaving this variable in because the variable name
documents what the code is doing and why.

I recognize that the value of this change is very subjective, and I am
happy to revert this if necessary.
2021-10-20 19:53:09 -07:00
David Dalcino
46fc2aaf9f Cause --noarchives to omit the base Qt module 2021-10-20 19:32:36 -07:00
David Dalcino
c5b89f6170 fail on mismatched tool versions
This recreates the legacy behavior, where `aqt tool` would fail to
install a tool variant when the version in the xml file does not match
the version requested in cli arguments.

This also recreates a bug where `aqt tool` cannot install tools that
do not have a valid semantic version.
2021-09-30 19:15:32 -07:00
David Dalcino
8c7d50d9f0 Simplify help message 2021-09-20 13:01:50 -07:00
David Dalcino
a5bb2553ce Add improved error messages for missing archives 2021-09-20 12:46:47 -07:00
David Dalcino
1a918c35c5 Merge remote-tracking branch 'upstream/master' into specify-version-by-simplespec 2021-09-09 08:26:10 -07:00