- 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>
* 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.
* 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.
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>
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`
* 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>
- 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>
- 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
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.
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.
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.
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.
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.
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()`.
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.
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.
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.