Commit Graph

1352 Commits

Author SHA1 Message Date
Florian Bruhin 858606c18d ci: Remove QtWebKit testing
It's broken in weird ways since recently (`:version` not loading,
segfault in test_version.py). Since nobody should be using it anyways,
there is no point in spending time on debugging a tricky issue.

Next step is probably ripping it out completely, but that's a separate
can of worms.

See #4039
2025-05-13 09:29:04 +02:00
Florian Bruhin 81f65dbb46 docker: Install libxml2-legacy from official repos
Reverts:
- a3bdcca37b
- 1b7557b73b
- 06e7950588
- 9aef02e96c
- c5fe31e828
2025-05-08 09:21:35 +02:00
Florian Bruhin 6cbf2847c8 docker: Try working around QtWebKit issues 2025-05-07 17:59:15 +02:00
Florian Bruhin 102f43cbde scripts: Ignore another stderr output on macOS 2025-05-06 14:08:00 +02:00
Florian Bruhin c5fe31e828 docker: Add link 2025-05-06 14:06:10 +02:00
Florian Bruhin 9aef02e96c docker: Don't install libxml2.13 for webkit 2025-05-06 10:28:17 +02:00
Florian Bruhin 06e7950588 docker: Always install base-devel 2025-05-06 09:18:07 +02:00
Florian Bruhin 1b7557b73b docker: Don't run makepkg as root 2025-05-06 09:15:27 +02:00
Florian Bruhin 5e6a878f64 docker: Also downgrade libarchive for QtWebEngine 2025-05-06 09:12:23 +02:00
Florian Bruhin a3bdcca37b docker: Install libxml2.13 2025-05-06 09:11:20 +02:00
toofar e67aea60e8 Update changelog link for mypy extensions 2025-04-25 16:50:07 +12:00
Florian Bruhin ef397e9417 Update changelog URLs 2025-03-31 08:40:01 +02:00
Florian Bruhin 2f20e3b60b Update iniconfig changelog url 2025-03-24 11:29:35 +01:00
Florian Bruhin 237e90985d docker: Downgrade libxslt
ImportError: /usr/lib/libxslt.so.1: undefined symbol: xmlCtxtParseDocument
2025-03-15 12:25:43 +01:00
toofar 4f985feede update changelog URL 2025-03-10 23:05:00 +13:00
toofar 42c9973c01 update isort changelog link 2025-03-03 19:45:58 +13:00
Florian Bruhin eb2e39de1e scripts: Add new bump-my-version deps 2025-02-17 10:55:22 +01:00
Florian Bruhin 60f526d81f Add new changelog URLs from bump-my-version 2025-02-03 18:40:35 +01:00
Jun Chen 6b25fdf648 chore: replace bump2version with bump-my-version 2025-01-30 19:14:38 -07:00
Florian Bruhin 322977dc0d Update changelog URLs for twine upgrade 2025-01-27 16:15:28 +01:00
Florian Bruhin b3090870d3 scripts: Rename test_requirements function
Falsely flagged by https://github.com/m-burst/flake8-pytest-style/blob/master/docs/rules/PT028.md
2025-01-19 11:56:42 +01:00
Florian Bruhin 7eb9bc45de Adjust Pillow changelog URL 2025-01-06 15:05:02 +01:00
Florian Bruhin 9e70ffeaad Switch to legacy PDF.js build
The normal PDF.js build only officially supports the latest Chromium, so things
might break every once in a while with QtWebEngine (e.g. #8199, #7335).

Let's instead bundle and recommend the legacy build.

Closes #8332
Closes #7721 (reworded)
Also see #7135
2024-12-10 11:47:39 +01:00
Florian Bruhin e7b346ecf2 scripts: Try harder to 'hdiutil create' the .dmg
See https://github.com/actions/runner-images/issues/7522#issuecomment-2527820259
2024-12-10 10:31:47 +01:00
Florian Bruhin 557cd19a1d ci: Try harder to detach dmg image
See https://github.com/actions/runner-images/issues/7522
2024-12-06 21:45:27 +01:00
Florian Bruhin 5cb14d4d4b Run shellcheck over all scripts/*.sh files
See #8409
2024-12-06 20:39:34 +01:00
Florian Bruhin aed06c5f48 Add gherkin-official changelog URL 2024-12-05 19:26:58 +01:00
Florian Bruhin ffe7d00a62 Merge branch 'drop-py38' 2024-10-15 11:58:54 +02:00
toofar cc3c1e2050 Enable pylint Too many positional arguments warning
This re-enables the pylint too-many-positional-arguments for the main
application code. It's still disabled for tests because that's how you pull in
pytlint fixtures, and I don't think we want to push people into being creative
with fixtures just to get around that.

When functions are called with many positional arguments the reader has to do
a bit of heavy lifting to figure out in what position a value is being passed,
and it's easier to make mistakes. So I would like to encourage using keyword
arguments for long argument lists.

I've set the `max-positional-arguments` to a completely arbitrary 7, from a
completely arbitrary 5, because there were many more violations under 7. If
like 99% of our functions fit under 7 it's probably fine.

Regarding the exceptions:
* objreg.register: I grepped it and it looks like everything is only passing
  the first two args as positional already, lucky!
*  `_get_color_percentage`: only one usage of it, but I was in "add directive
  comment" mode
* update_3rdparty.py: only one usage, already using kwargs
* pyqtProperty: idk
* commands.py: "its complicated". Many methods in this file map to commands
  used in qutebrowser's command mode. In that case it's usual for them to be
  called as flags, rather than positional. But it could be complicated to wade
  into that, and having one file excluded isn't so bad.
2024-10-15 11:55:04 +02:00
Florian Bruhin 2ab963cef8 Remove pytz changelog URL 2024-10-15 11:55:04 +02:00
Florian Bruhin 0fd6fc19f2 recompile_requirements: Fix with diff.mnemonicPrefix set 2024-10-15 11:55:04 +02:00
Florian Bruhin 97104b2000 Use builtin list/dict/set/... types for annotations
See https://peps.python.org/pep-0585/
and https://docs.python.org/3/whatsnew/3.9.html#type-hinting-generics-in-standard-collections

Done via:

    ruff check --select 'UP006' --fix --config 'target-version = "py39"' --unsafe-fixes

followed by removing unused imports:

    ruff check --select 'F401' --fix --config 'target-version = "py39"'

and a semi-manual review to find imports that are still needed (but ruff doesn't know about yet):

    git diff | grep '^-' | grep import | grep -v "from typing"

Also see #7098.
2024-10-15 11:54:49 +02:00
Florian Bruhin c32b8090ca Import typing classes from collections.abc
See https://peps.python.org/pep-0585/
and https://docs.python.org/3/whatsnew/3.9.html#type-hinting-generics-in-standard-collections

Not changing List/Dict/Set/etc. in this commit, as that's a way bigger change.

Done via:

    ruff check --select 'UP035' --fix --config 'target-version = "py39"'

Also see #7098.
2024-10-15 11:54:35 +02:00
Florian Bruhin c598cbbc71 Revert "ci: Avoid Archlinux' pyqt6 6.1.7-3 which lacks QSignalSpy"
This reverts commit 27e446d26d.
Archlinux now uses a PyQt 6.8 development snapshot.
2024-10-15 00:47:31 +02:00
Florian Bruhin b976a31ffa
Merge pull request #8321 from qutebrowser/feat/8260_drop_qt5_builds
Remove support for making Qt5 builds
2024-10-13 21:45:05 +02:00
Florian Bruhin 27e446d26d ci: Avoid Archlinux' pyqt6 6.1.7-3 which lacks QSignalSpy
See https://github.com/qutebrowser/qutebrowser/issues/8242#issuecomment-2409077518
2024-10-13 20:28:43 +02:00
Florian Bruhin 4d069b8fc3 Use str.removeprefix() and str.removesuffix()
https://docs.python.org/3/whatsnew/3.9.html#new-string-methods-to-remove-prefixes-and-suffixes
2024-10-13 18:24:44 +02:00
toofar d24a4c5ab0 Remove Qt5 switches from release building scripts etc
I just searched for qt5 and deleted stuff. EZ.
Will leave on a branch for a bit and see if I feel like testing this at
all, otherwise maybe leave this stuff in here and make it not called.

Not 100% sure that we need to remove all this stuff when we just want
the CI to go green. But tbh if we don't need to make Qt5 releases then
we don't need it. Better to be bold and pull it out than have to work
around it in the future. And we can always revert the commit.
2024-10-05 13:55:15 +13:00
toofar 3bc30e748d Merge pull request #8243 from feat/e2e_screenshots 2024-10-05 11:30:57 +13:00
toofar a409f9acf7 add changelog for jaraco.collections 2024-09-18 11:35:30 +12:00
toofar d49dd3d48f fix changelog urls 2024-09-06 17:43:12 +12:00
toofar a3238eb494 upload e2e failure screenshots as artifacts
This commit takes a screenshot of the active browser window when an
end2end test fails. When running on CI a zip file of screenshots will be
attached to the run summary as an artifact. When run locally screenshots
will be left in /$TMPDIR/pytest-screenshots/.

The screenshot is of the Xvfb screen that the tests are running under.
If there are multiple windows open it will likely only show the active
window because a) we aren't running with a window manager b) the Xvfb
display is, by default, the same size as the browser window.

I'm not sure if xvfb is used on the Window runs in CI. We could fall
back to trying to take screenshots if not running under xvfb but I'm a
bit wary of an automatic feature that takes screenshots of people's
desktops when running locally. Even if they just to to /tmp/ it might be
surprising. We can change it later if it turns out we need to try to
take screenshots in more cases.

I'm using pillow ImageGrab, the same as pyvirtualdisplay.smartdisplay. I'm
getting the display number from the pytest-xvfb plugin and formatting it
appropriately (pyvirtualdisplay has an already formatted one which is used by
the smartdisplay, but that's not accessible).

Pillow is now a requirement for running the tests. I thought about making
it gracefully not required but I'm not sure how to inform the user with
a warning from pytest, or if they would even want one. Maybe we could
add a config thing to allow not taking screenshots?

I had to bump the colordepth config for pytest-xvfb otherwise pillow
complained that the default 16bit color depth wasn't supported as it
only supports 24bit, see https://github.com/python-pillow/Pillow/blob/1138ea5370cbda5eb328ec949
8c314d376c81265/src/display.c#L898

I'm saving screenshots to a temp dir because I don't want to put them in
my workdir when running locally. I want to clear the directory for each
run so that you don't get confused by looking at old images. I'm not
100% sure about the lifecycle of the process classes though. Eg if we
have two processes they might both try to create the output directory.
I'm using pytest.session.stash to save the directory so perhaps the
lifecycle of the stash will handle that? Not sure.

Ideally the images would be uploaded somewhere where we could click
through and open them in the browser without having to download a zip
file, but I'm not sure how to achieve that.

It would be nice to print in the test logs that a screenshot was saved
and where to. Just so you could copy paste the filename instead of
having to match the sanitized filename against failing test names. But I
don't know how to log stuff from this stage in the pytest lifecycle.

TODO:
* I'm not sure that the screenshot captures the whole browser window?
  Maybe the browser windows is bigger than the X11 display?

Closes: #7625
2024-08-18 12:42:29 +12:00
toofar 452408870b adjust babel changelog (case change) 2024-08-12 19:29:07 +12:00
toofar 096a4edec2 Add changelog URLs
Few new vendored packages showing up from setuptools for environments
where pkg_resources is being imported for some reasons.

I don't think these requirements should be in our requirements files,
they aren't direct dependancies and they aren't declared as dependancies
of setuptools (and we are currently excluding setuptools from our
requirements files anyway, although apparently that is not the right
thing to do these days). These are actually not installed as normal
packages by are vendored packages shipped with setuptools.

Options I see to deal with them:

1. suck it up and add them to the compiled requirements files
  * not ideal, but should be harmless. They are real packages that the
    setuptools authors have chose to use
2. exclude these new packages using the markers in comments
  * maybe, seems like it could lead to issues in the future if any of
    these packages start getting declared as proper dependancies
3. find out where pkg_resources is being imported and stop it
  * I don't seem to be able to reproduce this behaviour locally, even
    when using a py3.8 docker container. And we are literally only
    running `pip freeze` via subprocess, what could the difference be?
  * I don't particularly want to delve into the arcane python packaging
    stuff, it seems to be layers and layers of very specific issues and
    old vendored packages
4. stop using pip freeze to compile requirements files and just compute
   them based off of the raw files themselves
   * Don't give us the chance to use stuff that we don't depend on but
     happens to be installed. We get other nice things with this too

This commit does (1). I'll open a follow up PR to do (4).
2024-08-12 19:29:07 +12:00
Florian Bruhin 086c1b4c08 scripts: Adjust PyQt[56]-sip package names 2024-07-15 08:09:13 +02:00
Florian Bruhin 4d2361288d ci: Fix pip/python usage for QtWebKit
I'm sure I tested this locally before pushing
b241b0360b but now it's broken?

This seems to fix things now. See #8247.
2024-06-29 21:59:43 +02:00
Florian Bruhin b241b0360b ci: Install a newer Python 3.10 for QtWebKit image
Starting with the upgrade to Hypothesis 6.103.4 we got hangs when pytest exits.
This is caused by:

https://github.com/HypothesisWorks/hypothesis/pull/4013

combined with:

https://github.com/python/cpython/issues/102126

which was fixed in Python 3.10.11, but the latest 3.10 packaged by Archlinux was
3.10.10.

Thus, we instead build a newer 3.10 from the AUR.
This bumps the build time up to about 20 minutes on my machine, which is
probably acceptable since those are nightly builds only anyways. We could
probably half that by disabling --enable-optimization, but that would be at the
cost of making the actual test runs (which run more often) slower.

Closes #8247
2024-06-29 20:47:59 +02:00
Florian Bruhin c836004dc0 Update mypy changelog URL
Seems to contain patch versions too
2024-06-25 09:41:57 +02:00
Florian Bruhin 4f66661ff8 Update sip changelog URL 2024-06-25 08:57:36 +02:00
Florian Bruhin dfae071aed ci: Try installing OpenSSL 1.1 for Qt 5 docker
Only OpenSSL 3 is installed currently, and for some reason, Qt 5 started failing in CI complaining that it only found OpenSSL 3 and not 1.1...
2024-06-20 17:52:10 +02:00