Skip to content

fix list-qt-official wrt types, search term.#990

Open
tsteven4 wants to merge 1 commit intomiurahr:masterfrom
tsteven4:commsearch
Open

fix list-qt-official wrt types, search term.#990
tsteven4 wants to merge 1 commit intomiurahr:masterfrom
tsteven4:commsearch

Conversation

@tsteven4
Copy link
Contributor

Previously we accepted zero, one or more search terms for list-qt-official. However, the official installer ignores all terms after the first. This PR changes argument parsing for list-qt-official so only zero or one search terms are accepted.

This PR also fixes the mypy errors in installer.py:

aqt/installer.py:700:51: error: Incompatible types in assignment (expression
has type "list[str]", variable has type "str | None")  [assignment]
                commercial_search_args.search_terms = [rf"^.*{re.escape(version_str)}\.{re.escape(target_str)}.*$"]
                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aqt/installer.py:752:9: error: Incompatible types in assignment (expression has
type "str | None", variable has type "str")  [assignment]
            for version_str in (modules_ver, args.arch, args.archives[0] i...
            ^

The second was fixed by eliminating variable reuse of version_str by renaming, allowing different type signatures to be inferred by mypy for the different usages.

This resolves #965.

only one search term is used by the official installer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: commercial search terms types and functionality

1 participant