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 allows a user to turn on `--keep` every time they run the program,
and to set the default archive destination when `--keep` is turned on.
Using `--archive-dest` overrides the archive destination in setting.ini.
This adds the parameter `archive_dest` to `run_installer`, which will
control where `helper.downloadBinaryFile` will download files, and sets
it to "." by default.
For convenience/readability, this will also turn any reference to the
downloaded file into a `pathlib.Path` object. This makes it easier to
ensure that the file ends up in the right location.
This changes the CLI so that the `target` parameter for `install-src`,
`install-doc`, and `install-example` is now ignored, and "desktop" is
substituted for anything the user inputs. The only valid option here
is "desktop" anyway, so the user should be forgiven for trying to input
anything else.
It may be better to remove `target` from the parameter list, but that's
a big change to the interface that could break a lot of dependent code.
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.
In an earlier PR, I added calls to `disable_socket()` from
`pytest_socket` where I thought they were needed to prevent some tests
from accessing the network, in case they weren't monkeypatched properly.
Today, I discovered that `disable_socket()` disables sockets globally
for all tests, which means that the tests that use remote data cannot
run if they are executed after another test calls `disable_socket()`.
This change calls `disable_socket()` once from `conftest.py`, so that
no tests are allowed to use network data unless they are marked as ok
to use the network, with `@pytest.mark.enable_socket`. See example of
usage in `tests/test_connection.py`.
Changed return code for unexpected exceptions:
This allows us to write tests that can discover whether an unexpected
exception occurred just by checking the return code, rather than reading
stderr. This will allow us to write less friable tests that don't break
every time some insignificant output details change.
This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.
This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.
This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
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.
This reduces code duplication, with the intent of initializing the
parsers more consistently.
Why:
In #413, it was discovered that the interface of `aqt tool` did not
match the stated interface in the v1.2.5 documentation. After that,
I found that the interface for `aqt examples` and `aqt src` did not
fit that documentation either. This refactor places all of the
interface definitions in one location, with common code paths to
create each parser. This removes most of the code duplication involved
here, so that each parser is built more consistently. It also makes
it easier to visually inspect the differences between the parsers.
This catch-all exception handler will catch anything derived from
Exception, but not BaseException. It will catch every exception that we
have not explicitly wrapped in an AqtException, which means it will
catch every error we did not anticipate. It prints a stacktrace and asks
the user to submit a bug report.