It seems to me that installers are more likely to have pip installed
than build, so if we can get by using pip as the frontend in the
makefile, then we should.
pip does not have a way to build an sdist (tarball), so we'll have to
see if any of the packaging workflows depend on that. It does seem to
dump the source tree in dist/lib, but I'm not sure if that is part of
the API or not.
Previously I've added comparison methods for testing alternate direct
implementations of setup.py. Now I'm working through the actual
packaging workflows that I can find.
The source I am following is here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=qutebrowser-git
For the replacement I've substituted:
* setup.py build -> python3 -m build
* I think these are a little different because `setup.py build` puts
all the source file on disk, but build outputs a wheel and
tarball.
* setup.py install -> pip install
* It's a bit awkward using a different frontend than the other
makefile target (build vs pip) but with build we would have to
call pip to install the wheel anyway. On the other hand, pip
doesn't seem to have an option to just create a wheel
* The only difference in outputs is that previously it was passing
`--optimize=1` to setup.py, pip install doesn't seem to have an
option to pass a specific optimization level
The diff is included in the source code currently, I'll move it to a GH
comment when I've gone through a few more workflows.
Hmm, seems the description can't be read from an attribute, why? Anyway,
it's not like it changes often. Lets copy it, and add a note to change
the python code to read from importlib.metadata, if we even want to?
TODO:
* compare the output file-by-file of pip install -e before and after
* compare the output file-by-file of setup.py install/build/wheel or
whatever and the corresponding build commands (and update makefile)
* think about removing stuff that isn't used from `__init__.py`, or
making it read from importlib.metadata
* see how it looks with hatch (dynamic bits and build hooks)
Skip this hypothesis version pending https://github.com/HypothesisWorks/hypothesis/issues/4375
Our test suite is currently failing due to running python with `-b` and
being configured to fail on warnings.
We'll pick it up on the next update run or so.
The previous fix in 3dc212a815 was insufficient,
as the inner `getattr(extract_result, "registered_domain")` was always evaluated
first (thus triggering the deprecation warning again).
We also cannot do:
getattr(extract_result, "top_domain_under_public_suffix", None) or extract_result.registered_domain
as `""` is a valid value for it.
Speculative fix for test_early_timeout_handler in
tests/unit/utils/usertypes/test_timer.py failing:
> assert len(caplog.messages) == 1
E AssertionError: assert 5 == 1
due to:
------------------------------ Captured log call -------------------------------
WARNING misc:usertypes.py:467 Timer download-update (id 620757000) triggered too early: interval 500 but only -609.805s passed
WARNING misc:usertypes.py:467 Timer download-update (id 922746881) triggered too early: interval 500 but only -609.429s passed
WARNING misc:usertypes.py:467 Timer download-update (id 1056964613) triggered too early: interval 500 but only -609.537s passed
WARNING misc:usertypes.py:467 Timer download-update (id 1912602631) triggered too early: interval 500 but only -609.671s passed
WARNING misc:usertypes.py:467 Timer t (id -1) triggered too early: interval 3 but only 0.001s passed
We sometimes tried to use hints before the page was fully rendered (?), thus
causing no elements to be found.
It also doesn't make much sense to test leaving insert mode if we aren't in
insert mode yet, so make sure we entered it first.
See #5390
My reproducer is this:
* open the browser with the auto insert mode JS primed, and two tabs:
`python3 -m qutebrowser -T -s input.insert_mode.auto_load true about:blank?1 about:blank?2`
* close the second tab: `d`
* re-open the closed tab then close it again real quick: `u` then `d`
If you have trouble reproducing, try increasing the 65ms delay in
`handle_auto_insert_mode` to be bigger (like 500ms).
Closes: #3895