Packages anki and aqt do not pin their requirements,
which breaks anki <= 2.1.49 because of protobuf major version bump.
While it's possible to use requirements.txt as constraints,
it might not be the best idea:
* requirements.txt can’t be used as constraints
without some careful sed’ding to remove hashes and extras;
* its location changes between versions;
* you can’t get this file for a pre-release version of Anki
since these don't get git tags;
* it’s rarely updated anyway and hence won’t reliably
produce the environment that actual Anki uses.
So use a pypi-timemachine, which prevents pip from using packages
that were uploaded after a specified date.
While the code is a tad complex, it feels slightly less hacky,
and is likely to be producing more accurate environments.
Environmental variables set in `setenv` also affect pip invocations.
`HOME` determines where pip is placing its cache.
Setting HOME to anything virtual env-specific means that
every virtual environment is created with its own cache.
This wastes time, data and disk space.
* Import things from `aqt.qt` not `PyQt5`/`PyQt6`
* When testing with Qt6, disable Anki's Qt5 compatibility mode
* Depend on `pytest-anki` that is also Qt version agnostic
The tests can be run now using `tox` against multiple Anki versions;
see instructions in `tox.ini`.
The tests depend on `pytest-anki` that had to be slightly modified
to remove the upper constraint on Anki version, as well as
to remove a few dependencies that are not essential to using it.