When the destination drive is not writable or has insufficient space,
these exceptions are raised during `run_installer`. Unless they are
caught and dealt with, `aqtinstall` requests that the user file a bug
report. This change catches these errors and prints a nice error message
instead of requesting a bug report.
This improves the warnings about unknown versions, modules, and
architectures of Qt, so that it is more explicit what the message
actually means.
This changes the purpose of `Cli._check_modules_arg` from checking if
modules exist in combinations.json, to returning a list of modules
that do not exist in that file. The function has been renamed as well.
This change was necessary to make the warning message more informative.
This removes the inappropriate ENV variables set in steps.yml.
It's not wrong to set those variables, but the official Qt installer
patches the defaults properly, so you don't have to do it manually.
It's wrong to expect our users to set these.
This also patches target_qt.conf to add HostLibraryExecutables.
Since Qt 6.4.1, the Qt devs stopped building android binaries for
all platforms: see https://bugreports.qt.io/browse/QTBUG-108707
> we are building android packages only in one host & use those in other ones:
> android armv7 is build only in windows
> android arm64 is build only in mac
> android x86 and android x86_64 are build only in linux
This adds tests for Qt 6.4.1 on platforms that are not the platforms that
Qt was built for, so that:
* the binaries built on Mac are tested on Linux
* the binaries built on Linux are tested on Windows
* the binaries built on Windows are tested on Mac
There should be 3 more permutations of this pattern, but I prefer to
ignore them to save on CI build times.
This will allow testing multiple qt installations, as required by the
feature that installs the default desktop qt where required
Add autodesktop test for ios
* Add tests for proper patching of Qt6.2.2-ios
* Add a build target for ios installations
* Add test coverage for mobile patching on linux
This change folds in some refactoring as well, in an attempt to reduce
repetitive logic, and make sure that this logic is used everywhere appropriate.
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 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 updates CI and unit tests to monitor behavior of
`install-src/doc/example`, now that the `target` parameter has been
deprecated. This makes sure that the `target` parameter is optional,
and that the CLI warns the user that `target` is deprecated when a user
uses it.
[CI tests]:
This adds a test to `install-src/doc/example` Azure Pipeline jobs to
ensure that the desired files are installed, using `ls`.
This also changes some of the archives installed to `qtlottie`, which
is a particularly small file.
This also adds a build job for `install-example`.
[Unit tests]:
This adds tests for `install-src`, with and without the `target`
parameter.
It also fixes existing tests for `install-doc`, to account for
changes to the `target` parameter.
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 change adds unit tests for the `aqt install` and `aqt install-qt`
commands, and establishes a pattern that can be extended for more
tests. This is intended to make it easier to increase test coverage of
parts of the codebase that are not yet covered by tests.
This uses the `pytest-socket` library to ensure that the tests do not
use any network IO. It also mocks `multiprocessing.get_context` to
prevent multiprocessing. This is necessary because multiprocessing
spawns child processes that have not been monkey-patched, which would
break the test.
These tests use py7zr to create mock 7z archives, which are installed
and patched in a temporary directory. The tests check the content
of the patched files and any output to stderr.