Age | Commit message (Collapse) | Author |
|
|
|
|
|
Avoid SC2140 shellcheck false-positive: https://github.com/koalaman/shellcheck/issues/2479
Also remove extra quoting
|
|
|
|
|
|
|
|
|
|
|
|
See https://listi.jpberlin.de/pipermail/qutebrowser/2022-March/000885.html
|
|
A zipfile.Path *is* a Traversable
|
|
|
|
If we have a builtin importlib.metadata (Python 3.8+) and the importlib_metadata
backport installed, we preferred the backport. However, the version.py tests do
the opposite: They only mock the builtin if it is available. This did lead to
failing tests if the backport was installed in an environment where the builtin
was available too.
Since we don't need any specialized functionality (only reading the version), we
can prefer the builtin no matter whether a backport is available or not.
|
|
|
|
|
|
|
|
|
|
This is the default now according to pip output
|
|
|
|
|
|
|
|
|
|
pytest understands that since a while: https://pytest.org/en/7.0.x/reference/reference.html#environment-variables and other tools are adopting it: https://github.com/sphinx-doc/sphinx/pull/10260
|
|
|
|
|
|
|
|
mypy was correct here: _path doesn't always return a pathlib.Path, it's why we need to handle that in _glob().
|
|
|
|
See https://github.com/PyCQA/pylint/issues/5783
|
|
See https://github.com/PyCQA/pylint/issues/6036 and https://github.com/PyCQA/pylint/issues/6037
|
|
We originally used Python 3.8 for pylint for https://github.com/PyCQA/pylint/issues/3760 which is long fixed... See 214dd63441063acffa7e888f3f5b42187007da11
|
|
See https://github.com/PyCQA/pylint/issues/6035
|
|
This makes new commands more discoverable for people with custom bindings, and helps in situations like https://www.reddit.com/r/qutebrowser/comments/tq7628/prompt_trap_closing_the_application_is_the_only/
|
|
|
|
It seems to only check the true condition based on the given Python version in the config...
See https://github.com/python/mypy/issues/12286
|
|
|
|
|
|
Refactor the magic tag creation thing to add python version checking support.
Makes `_check_version()` support checking plain tuples to so that I don't have
to copy the operator dict.
Now most of the branches of the if/else are the same, meh.
|
|
Since I added weakrefs into the cache stats debug registry thing it no longer
works on python version 3.5 to 3.8, since lru_cache doesn't support weak refs
for those versions. It should be possible to do some
conditional stuff and get some functionality working on all supported versions
but I don't think there is any great need to for a debug command.
Links:
https://bugs.python.org/issue14373
https://bugs.python.org/issue40504
https://github.com/qutebrowser/qutebrowser/pull/7079#issuecomment-1079539046
|
|
The warning says the `self` reference will get cached forever. In this
case though the cache is cleared on every page load (9b0395db087f).
|
|
In 4b93da6c69 I moved a cache that was registered with the
debugcache module to be per-window. Which means they may be deleted at
some point and we shouldn't hold strong references to them.
|
|
Flake8-bugbear correctly pointed out that TabBar instances would not be
reliably cleaned up because the `self` reference would be cached in the
lru_caches on a couple of the methods. And the caches are on the class
so they last for the whole lifetime of the process.
This commit move the caches to be created per instance, instead of on
the class.
Other options:
1. get rid of the caches
From running the benchmark tests (eg `python3 -m pytest --benchmark-columns Min,Max,Median,Rounds -k test_update_tab_titles_benchmark`)
it seems like the caches can still be helpful (even though when they
were introduced in #3122 we didn't have the config cache either)
2. use cachetools to manage our own cache instead of using lru_cache in
a non-standard way
I don't feel like introducing a new dependency given this change didn't
end up being too offensive.
3. clear the cache whenever a window get closed
That would solve the "not getting deleted issue" but flake8 would still
complain :)
Possibly the cache size could be reduced now that there is going to be
one per window. But the aren't caching large objects anyway.
Flake8-bugbear change: https://github.com/PyCQA/flake8-bugbear/pull/218
Video that pointed out this way of using lru_cache: https://youtu.be/sVjtp6tGo0g
|
|
|
|
Also some other small improvements / fixes.
|
|
|
|
On the last two runs we've been getting errors install lxml2-utils (a
dependency of asciidoc) because the version in the packages list isn't
available anymore. A new point build has been pushed.
The base image will be updated eventually but [the docs][] say to run
apt update before installing. That is already done once in this file
too. Yay for longer build times.
Last two runs:
https://github.com/qutebrowser/qutebrowser/runs/5578546699?check_suite_focus=true
https://github.com/qutebrowser/qutebrowser/runs/5581525862?check_suite_focus=true
[the docs]: https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners
|
|
Hide long description of settings
|
|
|
|
I am making the yt-dl program used in the `cast` userscript
configurable, via a pattern borrowed from some of the other
userscripts here (e.g. `password_fill` and `kodi`): we look for an
optional "cast_rc" file in the qutebrowser config directory and source
it if it exists.
(Technically this allows for overriding any variables used in `cast`,
but this is in line with how the pattern works in the other scripts
already.)
If the config file is not found, we default to yt-dlp, and if that
doesn't exist then youtube-dl. If after all this no program is
available, we emit an error message
(note, the error messaging function as currently written in the cast script
seems broken and doesn't display the full error message, but fixing this
existing bug is outside of the scope of this change. May be good for a
followup).
I recognize there's some danger of breakage for some users by switching
the default to yt-dlp, but I think it's reasonable to assume that almost
everybody who has yt-dlp installed would prefer it to be used anyway.
Those who don't will experience no difference.
|
|
The `cast` userscript hasn't worked for me in a while, because it attempts to launch youtube-dl which has been replaced by yt-dlp for some time. Switching this one command gets `cast` working for me.
|
|
|