Commit Graph

25258 Commits

Author SHA1 Message Date
Aryan Dev Shourie 590a602e57 capitalized github text to maintain consistency 2024-11-22 17:01:59 +00:00
Florian Bruhin 07bd9a691a tests: Ignore irrelevant Chromium warning 2024-11-11 12:53:29 +01:00
qutebrowser bot c03d3dd6ac Update dependencies 2024-11-11 10:23:04 +00:00
Florian Bruhin af884a02c8 ci: Upgrade codecov action 2024-11-10 20:01:44 +01:00
Florian Bruhin a04126b22b hypothesis: Inherit our CI settings from hypothesis CI profile
See 13c3785854

deadline=None and suppressing the too_slow health check is already part of that.
Also fixes a hypotheses -> hypothesis typo.
2024-11-10 19:40:54 +01:00
Florian Bruhin f382a1a18f Remove pytest-benchmark filterwarning 2024-11-10 19:36:51 +01:00
Florian Bruhin c075f6650e Merge remote-tracking branch 'origin/update-dependencies' 2024-11-10 19:36:21 +01:00
Florian Bruhin 49e67c4dc9 Fix up changelog
See #7625
2024-11-07 14:58:47 +01:00
qutebrowser bot b495e78b8a Update dependencies 2024-11-04 04:20:40 +00:00
toofar 1127c0de19
Merge pull request #8359 from qutebrowser/update-dependencies
Update dependencies
2024-10-29 11:17:56 +13:00
qutebrowser bot 643bdf7305 Update dependencies 2024-10-28 04:21:24 +00:00
Florian Bruhin a138ab8978 Fix some broken links 2024-10-22 18:17:08 +02:00
Florian Bruhin d49675eeed Remove outdated version check 2024-10-22 18:10:19 +02:00
qutebrowser bot ad29c973f8 Update dependencies 2024-10-21 12:32:07 +02:00
Florian Bruhin dc5662b141 Update chromium release dates 2024-10-21 10:28:32 +02:00
Florian Bruhin af835c26ad Update changelog 2024-10-15 12:00:25 +02: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 ff5d4d3564 Avoid passing a parent to QProcess
With the upgrade to MarkupSafe 3.0, something funny happened when trying to pass
the GUIProcess object to jinja after launching a userscript:

    [...]
    File "[...]/qutebrowser/browser/qutescheme.py", line 291, in qute_process
        src = jinja.render('process.html', title=f'Process {pid}', proc=proc)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "[...]/qutebrowser/utils/jinja.py", line 123, in render
        return environment.get_template(template).render(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [...]
    File "html/process.html", line 11, in block 'content'
    File "[...]/lib/python3.11/site-packages/markupsafe/__init__.py", line 42, in escape
        if hasattr(s, "__html__"):
           ^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: wrapped C/C++ object of type GUIProcess has been deleted

This can be reproduced with:

    qutebrowser --temp-basedir ':cmd-later 0 spawn -u -o /bin/echo test'

We pass the `GUIProcess` to the Jinja template as `proc`, which then formats it as
`{{ proc }}`` (to stringify it). For some reason, with the newest MarkupSafe/Jinja
versions, this now triggers the `if hasattr(s, "__html__")` check in MarkupSafe
(which has been around for a while). That then presumably causes PyQt to try and
access the underlying C++ object for `GUIProcess``, but that has already been
deleted.

But why is it deleted in the first place, if we keep track of even completed
processes data ever since we added `:process` in a3adba81c? It looks like the Qt
parent-child relationship is the culprit here: When we pass a parent to the
`GUIProcess`` from the userscript runner, it will get deleted as soon as said
runner is cleaned up (which happens after the userscript has finished).

We probably never noticed this before because we only accessed data from the
Python wrapper and not from the C++ side, but it still seems like a good idea
to avoid passing a parent for a long-lived object (with time-based cleanup) in
the first place.
2024-10-15 11:55:04 +02:00
Florian Bruhin f175f611f8 pylint: Disable too-many-positional-arguments
Added in 3.3.0:
https://pylint.pycqa.org/en/latest/whatsnew/3/3.3/index.html

Some of those arguments could probably indeed be keyword-only,
but for some of the functions shown by pylint, those are qutebrowser command
handlers where a positional argument has different semantics.
2024-10-15 11:55:04 +02:00
Florian Bruhin ab7d04a951 Fix wrong type annotation
This was wrong ever since 0a835ecd92,
but due to the version conditional usage, mypy did not check it.
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 7083fee655 Recompile requirements 2024-10-15 11:55:04 +02:00
Florian Bruhin cc18a624b5 Remove importlib_resources from requirements 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 088b5973eb Update mimetype overrides
See https://github.com/python/cpython/commits/main/Lib/mimetypes.py
2024-10-15 11:55:04 +02:00
Florian Bruhin eb8121ffd5 Use Callable from collections.abc as well
Did run with ruff pretending to use Python 3.10,
because otherwise it won't reformat those:

    ruff check --select 'UP035' --fix --config 'target-version = "py310"' --unsafe-fixes

This is because collections.abc.Callable inside Optional[...] and Union[...] is
broken with Python 3.9.0 and 3.9.1:

https://github.com/asottile/pyupgrade/issues/677
https://github.com/astral-sh/ruff/issues/2690
https://github.com/python/cpython/issues/87131

However, pylint can detect problematic usages (of which we only have one),
so we might as well use the new thing everywhere possible for consistency.

Also see #7098
2024-10-15 11:54:53 +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 8cf9cc9f1b nsis: Check for newer Windows build
Follow-up to #8321, so we only claim to support what Qt actually officially does.
2024-10-15 11:52:34 +02:00
Florian Bruhin 26b4ec6cef Bleeding requirements: Use pytest-bdd release
See https://github.com/qutebrowser/qutebrowser/issues/8342
2024-10-15 11:42:07 +02:00
Florian Bruhin 463bde5c8e Update changelog 2024-10-15 10:33:53 +02:00
Willow Barraco 61746e0f58 desktop: qutebrowser as webp mime type viewer
This is decent webp viewer, like other web browser.
2024-10-15 10:33:12 +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
toofar f895c022cb
Merge pull request #8337 from qutebrowser/update-dependencies
Update dependencies
2024-10-14 19:21:03 +13:00
qutebrowser bot 80ed616230 Update dependencies 2024-10-14 04:18:59 +00:00
Florian Bruhin 6bf159581e
Merge pull request #8301 from qutebrowser/dependabot/github_actions/peter-evans/create-pull-request-7
Bump peter-evans/create-pull-request from 6 to 7
2024-10-13 21:51:28 +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
Florian Bruhin fe868901ab Remove all importlib_resources backport usage 2024-10-13 18:24:44 +02:00
Florian Bruhin 2ad1a579b1 Remove :debug-cache-stats conditionals 2024-10-13 18:24:44 +02:00
Florian Bruhin 71039e0d53 Minor Python 3.8 dropping adjustments 2024-10-13 18:24:44 +02:00
Florian Bruhin bcff1e90ea Update checkpyver for 3.8 drop 2024-10-13 18:24:44 +02:00
Florian Bruhin eb67b20417 Update docs for Python 3.8 drop 2024-10-13 18:24:44 +02:00
Florian Bruhin 5337882657 Adjust linters for dropping Python 3.8 2024-10-13 18:24:44 +02:00
Florian Bruhin 3288ec8598 Adjust Python versions in setup.py 2024-10-13 18:24:44 +02:00
Florian Bruhin bd3774dfc8 Drop Python 3.8 from tox/CI 2024-10-13 18:24:44 +02:00
Florian Bruhin 02cee732fc
Merge pull request #8334 from qutebrowser/update-dependencies
Update dependencies
2024-10-13 17:20:31 +02:00
qutebrowser bot 6093306ff5 Update dependencies 2024-10-13 14:54:29 +00:00