Commit Graph

24773 Commits

Author SHA1 Message Date
Florian Bruhin 9e148db5a6 Save screenshots when using click-element 2023-11-21 16:26:29 +01:00
Florian Bruhin 14c00fcdf0 tox: Still accept posargs 2023-11-21 16:26:05 +01:00
toofar 5e03e9bf3a try see if jseval still works on after flaky tests 2023-11-19 13:43:22 +13:00
toofar e338beeb9b Run just some flaky tests, to allow for iterating faster
This is not all of the tests that are being flaky. Just the few I looked
at the other day. Hopefully some of them keep failing in this much
smaller set than our usual test suite, otherwise I'll go add some more.

Not sure what I'm going to add in next, probably some code to probe the
state of the page. Run a simple event handler we know works in
isolation or something. Make sure things are still registered. Turn on
chrome debug logs?
2023-11-19 13:43:22 +13:00
toofar a1b7f873ba Add some debug log messages to JS test snippets
Some of these tests are flaky. I want to confirm wither the JS in the
tests is running at all.

ref: https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-1812008035
2023-11-19 13:43:22 +13:00
toofar 27c5cc8cae Update pytest summary problem matcher for colored output
We think that at some point pytest added color codes to the summary
output which broke these matcher regex. It looks like there is an issue
about stripping color codes here: https://github.com/actions/runner/issues/2341

I've added wildcard (or no-space) elements instead of trying to match
the color codes exactly (eg `\033\[31m` etc) because 1) that's not very
readable 2) I was having trouble getting that to work with egrep.

The goal is to match the target strings but not to match then later in
the line as part of a test log or whatever. For the '= short test
summary =' that should be pretty unique. For the ERROR|FAILED I reckon
that could be a bit more common. I'm just matching with any mount of
non-space characters because I reckon a space will crop up pretty early
in any line where ERROR isn't the first work.

I think this new matching will only apply to new or rebased PRs after it
is landed.

ref: https://github.com/qutebrowser/qutebrowser/issues/5390#issuecomment-1817503702
2023-11-19 13:42:12 +13:00
toofar c13089b64b
Merge pull request #7990 from qutebrowser/update-dependencies
Update dependencies
2023-11-15 20:34:00 +13:00
Florian Bruhin d46c876332 Update Surfingkeys link 2023-11-14 10:41:46 +01:00
toofar 119a3633b8
Merge pull request #8000 from qutebrowser/dependabot/github_actions/actions/github-script-7
build(deps): bump actions/github-script from 6 to 7
2023-11-14 17:26:26 +13:00
dependabot[bot] a55f5332f9
build(deps): bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 18:07:46 +00:00
toofar 5cc948aeb5 Downgrade mypy for now
I believe we are being afflicted by this issue: https://github.com/python/mypy/issues/16451
Although I'm not 100% sure because there is a lot going on in this
function and I haven't managed to grok it.

The mypy 1.7 release [notes][1.7] say you can disable the new type
inference by running `tox -e mypy-pyqt6 -- --old-type-inference` and
indeed mypy passes with that. So either our type hints are incorrect or
we are hitting a bug. Considering the inferred type hint has a `Never`
in it I'm leading toward it being a bug. So I'll bump the mypy version
down and hopefully next week the issue will be resolved.

The mypy output before this commit was:

    mypy-pyqt6: commands[0]> .tox/mypy-pyqt6/bin/python -m mypy --always-true=USE_PYQT6 --always-false=USE_PYQT5 --always-false=USE_PYSIDE6 --always-false=IS_QT5 --always-true=IS_QT6 --always-true=IS_PYQT --always-false=IS_PYSIDE qutebrowser
    qutebrowser/utils/qtutils.py:239: error: Argument 1 to "contextmanager" has incompatible type
    "Callable[[str, bool, str], Iterator[IO[AnyStr]]]"; expected "Callable[[str, bool, str], Iterator[IO[Never]]]"  [arg-type]
        @contextlib.contextmanager
         ^
    qutebrowser/misc/lineparser.py: note: In member "save" of class "LineParser":
    qutebrowser/misc/lineparser.py:168: error: Need type annotation for "f"  [var-annotated]
                    with qtutils.savefile_open(self._configfile, self._binary) as f:
                         ^
    qutebrowser/misc/lineparser.py: note: In member "save" of class "LimitLineParser":
    qutebrowser/misc/lineparser.py:226: error: Need type annotation for "f"  [var-annotated]
                with qtutils.savefile_open(self._configfile, self._binary) as f:
                     ^
    qutebrowser/config/configfiles.py: note: In member "_save" of class "YamlConfig":
    qutebrowser/config/configfiles.py:292: error: Need type annotation for "f"  [var-annotated]
                with qtutils.savefile_open(self._filename) as f:
                     ^
    qutebrowser/misc/sessions.py: note: In member "save" of class "SessionManager":
    qutebrowser/misc/sessions.py:343: error: Need type annotation for "f"  [var-annotated]
                    with qtutils.savefile_open(path) as f:

[1.7]: https://mypy-lang.blogspot.com/2023/11/mypy-17-released.html
2023-11-13 20:23:06 +13:00
toofar d55e831f39 Merge second dependancy update.
Didn't manage to merge the first one in time.

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:46:09 +13:00
toofar bb9788f80f add pyqt6.6 requirements file
What is that big chain of !pyqt- etc mean? idk

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
toofar f83cf4f504 Handle PyQt WebEngine version strings being Optional
With PyQt6-WebEngine 6.6.0 some pointer return types are now wrapped in
Optionals[]. In practice they should never be None, we've been relying on them
being set for long enough.

`qWebEngineVersion()` and `qWebEngineChromiumVersion()` now are typed as
returning `Optional[str]`. In `from_api()` we can handle the
`chromium_version` being null, so pass that through, but we are depending on
the `qtwe_version` being set, so add an assert there.

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
toofar 399c72a9fb Handle profile.settings() return type being optional
With PyQt6-WebEngine 6.6.0 some pointer return types are now wrapped in
Optionals[]. In practice they should never be none though so I'm adding
some low effort null checking in here.

For the changes in `_SettingsWrapper` I'm not actually sure this is the
best way to be resolving this. mypy was complaining that `settings()` might be
None. How does asserting on the profile help? idk but that seems to make it
happy. Even more weirdly, none of these getters I changed seemed to be used
anywhere apart from tests. Except for getAttribute, that's used in webkit code.
Also the whole thing is checking the global default profile, generally
settings should be checked on the profile on the tab. So I think this might
just be some old code? idk, I just want to make mypy happy.

For the `init_user_agent()` change that was complaining about the profile
maybe being None.

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
toofar 54e3993a59 Adapt chooseFiles() for PyQt6 type hints
The type of the two list arguments of chooseFiles() have changed from
`Iterable[str]` to `Iterable[Optional[str]]`.

I'm not sure it makes much sense to have individual list elements as
None. That seems like a pretty unlikely case. So we could just put an
ignore comment somewhere. I've added another copy of the lists, with
longer names, to strip any hypothetical Nones out. This allows us to be
backwards compatible with the old type hints (and the current Qt5 ones),
since that doesn't have the Optional part in the signature.

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
toofar 88f165fd77 Handle Optional page getters in webengineinspector
With PyQt6-WebEngine 6.6.0 some pointer return types are now wrapped in
Optionals[]. In practice they should never be none though so I'm sprinkling
some low effort null checking in here.

Another alternative is to move the inspector classes to be based off, and to
work with, our overridden child classes of the view and page. But that's a
whole other piece of work, we might have to deal with signals and such meant
for web views that we don't want with the inspector. (On the other hand it
might actually be good. The inspector sometimes is surprising in how it acts
differently from the main views.)

There's a bit later on where I changed a local variable name from
`inspector_page` to `new_page`. The `inspector_page` variable is used later
and the type checker was complaining.

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
toofar ca2b6c93ea Override getters for some WebEngineView attributes
With PyQt6-WebEngine 6.6.0 some pointer return types are now wrapped in
Optionals[]. In practice they should never be none though. So in a low effort
way of keeping the types we have to deal with in the calling code to
what they were before I'm overriding these getters that just do `assert thing
not None` to tell mypy not to worry about that case.

    QWebEngineView.page()
      The docs don't say anything but the source says it should always return
      something: https://github.com/qt/qtwebengine/blob/6.6.0/src/webenginewidgets/api/qwebengineview.cpp#L1001
    QWebEngineView.history()
      calls QWebEnginePage.history()
      where it is always set in the constructor: https://github.com/qt/qtwebengine/blob/6.6.0/src/core/api/qwebenginepage.cpp#L90
    QWebEngineView.settings()
      calls QWebEnginePage.settings()
      where it is always set in the constructor: https://github.com/qt/qtwebengine/blob/6.6.0/src/core/api/qwebenginepage.cpp#L90

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
toofar cedef129f9 Change browsertab WidgetType to be our tab implementations
Changing the type to be our overridden implementation of the view means
we can push more common code down into the view class and make use of
overridden methods more consistently. In this case I'm adding some type
checking to some of the getters on the view.

`_set_widget()` should be being called from the concrete child tab
implementations. So the widget should always be our overridden version of
the Qt tab implementations.

Also change `_set_widget()` to use the common typevar.

Also change the _widget type in WebEngineTab to match what it is
actually being set to and to match all the _widgets in the other
concrete classes in that file.

ref: https://github.com/qutebrowser/qutebrowser/pull/7990
2023-11-13 18:45:18 +13:00
qutebrowser bot 9ebd28a108 Update dependencies 2023-11-13 18:45:18 +13:00
qutebrowser bot ef9301da92 Update dependencies 2023-11-13 04:24:22 +00:00
Florian Bruhin ea9dfcf710 Update backers.md 2023-11-10 16:03:12 +01:00
Florian Bruhin 044b1e38e9
Merge pull request #7980 from qutebrowser/update-dependencies
Update dependencies
2023-10-31 09:28:32 +01:00
qutebrowser bot 27b43bd5ac Update dependencies 2023-10-30 04:22:08 +00:00
toofar ab7b079411 debug python imports
For windows I'm getting a "Module not found." error, which I suspect is
it not finding qutebrowser itself, but lets see.

ref: https://pyinstaller.org/en/stable/spec-files.html#giving-run-time-python-options
2023-10-28 10:44:55 +13:00
toofar 1fa678db61 Revert "Re-compile PyInstaller bootloader in CI."
This reverts commit 6042fccbf5.
2023-10-28 10:44:55 +13:00
toofar 6e534c74e7 Revert "walk_module workaround for PyInstaller"
This reverts commit 64af5f0e26.
2023-10-28 10:44:55 +13:00
toofar b4bbf3252f un-pin pyinstaller
ref: #7806
2023-10-28 10:44:44 +13:00
Florian Bruhin cee9e909fb doc: Group chrome pages 2023-10-24 14:39:58 +02:00
Florian Bruhin c75ee977f3 doc: Update chrome:// URLs 2023-10-24 14:39:58 +02:00
Florian Bruhin 0f0853d77b
Merge pull request #7973 from qutebrowser/dependabot/github_actions/actions/setup-node-4
build(deps): bump actions/setup-node from 3 to 4
2023-10-24 08:48:36 +02:00
dependabot[bot] f53933b329
build(deps): bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 18:49:54 +00:00
Florian Bruhin 34f8fe0599
Merge pull request #7971 from qutebrowser/update-dependencies
Update dependencies
2023-10-23 12:42:43 +02:00
qutebrowser bot 1709987966 Update dependencies 2023-10-23 04:23:17 +00:00
toofar 50e8117099 fix typo
if -> is
where -> were
2023-10-20 17:30:59 +13:00
qutebrowser bot fa862c786e Release v3.0.2
(cherry picked from commit f4ba52d33f)
2023-10-19 18:39:52 +00:00
Florian Bruhin 193b5a50a7 Fix up changelog 2023-10-19 20:36:07 +02:00
qutebrowser bot ea80b73d73 Release v3.0.1
(cherry picked from commit b3b1384037)
2023-10-19 18:15:46 +00:00
Florian Bruhin ccb5480cf6 Update UA completions 2023-10-19 20:02:57 +02:00
Florian Bruhin 4f549669bc Revert "Use different PyPI token tempoarily"
This reverts commit 597873286c.
2023-10-19 19:58:42 +02:00
Florian Bruhin 47c786484b docker: Downgrade more Qt for QtWebKit 2023-10-17 17:05:34 +02:00
Florian Bruhin a794c87e9b tox: Make -qt5 explicit for docker builds
Not needed on CI for a reason I don't quite understand, but needed locally for things to run.
2023-10-17 16:01:36 +02:00
Florian Bruhin 9d9f892ded docker: Also downgrade qt5-translations for WebKit 2023-10-17 16:01:36 +02:00
Florian Bruhin cb9095f870
Merge pull request #7964 from qutebrowser/update-dependencies
Update dependencies
2023-10-17 11:04:22 +02:00
Florian Bruhin 4fd5af3ab3 scripts: Fix typo 2023-10-17 09:46:44 +02:00
Florian Bruhin 1b7e3cdb7d scripts: Add more debugging info 2023-10-17 09:46:16 +02:00
Florian Bruhin a8355674da log: Ignore deprecation warning from new SIP
See https://riverbankcomputing.com/news/SIP_v6.7.12_Released
2023-10-17 09:33:06 +02:00
Florian Bruhin 4c6b34ea05 mypy fixup 2023-10-17 09:25:53 +02:00
Florian Bruhin 513fc2c329 Adjust diff_cover changelog name 2023-10-16 21:24:59 +02:00
Florian Bruhin a087b81451 Adjust for mypy 1.6
See https://mypy-lang.blogspot.com/2023/10/mypy-16-released.html
2023-10-16 21:24:34 +02:00