From 2c503bf35d5f465e5adf2838ee7b1b9d1775e1e1 Mon Sep 17 00:00:00 2001 From: qutebrowser bot Date: Mon, 9 Oct 2023 04:25:45 +0000 Subject: Update dependencies --- misc/requirements/requirements-dev.txt | 2 +- misc/requirements/requirements-pylint.txt | 10 ++++------ misc/requirements/requirements-pyroma.txt | 2 +- misc/requirements/requirements-sphinx.txt | 4 ++-- misc/requirements/requirements-tests.txt | 10 +++++----- misc/requirements/requirements-tox.txt | 2 +- misc/requirements/requirements-vulture.txt | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/misc/requirements/requirements-dev.txt b/misc/requirements/requirements-dev.txt index eb0ace85e..c51b2bf41 100644 --- a/misc/requirements/requirements-dev.txt +++ b/misc/requirements/requirements-dev.txt @@ -42,5 +42,5 @@ tomli==2.0.1 twine==4.0.2 typing_extensions==4.8.0 uritemplate==4.1.1 -# urllib3==2.0.5 +# urllib3==2.0.6 zipp==3.17.0 diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 4aabef52c..073894108 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -astroid==2.15.8 +astroid==3.0.0 certifi==2023.7.22 cffi==1.16.0 charset-normalizer==3.3.0 @@ -9,13 +9,12 @@ dill==0.3.7 github3.py==4.0.1 idna==3.4 isort==5.12.0 -lazy-object-proxy==1.9.0 mccabe==0.7.0 pefile==2023.2.7 -platformdirs==3.10.0 +platformdirs==3.11.0 pycparser==2.21 PyJWT==2.8.0 -pylint==2.17.7 +pylint==3.0.1 python-dateutil==2.8.2 ./scripts/dev/pylint_checkers requests==2.31.0 @@ -24,5 +23,4 @@ tomli==2.0.1 tomlkit==0.12.1 typing_extensions==4.8.0 uritemplate==4.1.1 -# urllib3==2.0.5 -wrapt==1.15.0 +# urllib3==2.0.6 diff --git a/misc/requirements/requirements-pyroma.txt b/misc/requirements/requirements-pyroma.txt index 04cdcefe3..72dc5545c 100644 --- a/misc/requirements/requirements-pyroma.txt +++ b/misc/requirements/requirements-pyroma.txt @@ -13,5 +13,5 @@ pyroma==4.2 requests==2.31.0 tomli==2.0.1 trove-classifiers==2023.9.19 -urllib3==2.0.5 +urllib3==2.0.6 zipp==3.17.0 diff --git a/misc/requirements/requirements-sphinx.txt b/misc/requirements/requirements-sphinx.txt index c28a4c2d0..afc173af6 100644 --- a/misc/requirements/requirements-sphinx.txt +++ b/misc/requirements/requirements-sphinx.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py alabaster==0.7.13 -Babel==2.12.1 +Babel==2.13.0 certifi==2023.7.22 charset-normalizer==3.3.0 docutils==0.20.1 @@ -22,5 +22,5 @@ sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -urllib3==2.0.5 +urllib3==2.0.6 zipp==3.17.0 diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 19af1d9f9..137663b10 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -2,18 +2,18 @@ attrs==23.1.0 beautifulsoup4==4.12.2 -blinker==1.6.2 +blinker==1.6.3 certifi==2023.7.22 charset-normalizer==3.3.0 cheroot==10.0.0 click==8.1.7 -coverage==7.3.1 +coverage==7.3.2 exceptiongroup==1.1.3 execnet==2.0.2 filelock==3.12.4 Flask==3.0.0 hunter==3.6.1 -hypothesis==6.87.1 +hypothesis==6.87.3 idna==3.4 importlib-metadata==6.8.0 iniconfig==2.0.0 @@ -51,7 +51,7 @@ tldextract==3.6.0 toml==0.10.2 tomli==2.0.1 typing_extensions==4.8.0 -urllib3==2.0.5 -vulture==2.9.1 +urllib3==2.0.6 +vulture==2.10 Werkzeug==3.0.0 zipp==3.17.0 diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index d98da70d9..00755bbbf 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -7,7 +7,7 @@ distlib==0.3.7 filelock==3.12.4 packaging==23.2 pip==23.2.1 -platformdirs==3.10.0 +platformdirs==3.11.0 pluggy==1.3.0 pyproject-api==1.6.1 setuptools==68.2.2 diff --git a/misc/requirements/requirements-vulture.txt b/misc/requirements/requirements-vulture.txt index 1d091baf3..9bceeb7b1 100644 --- a/misc/requirements/requirements-vulture.txt +++ b/misc/requirements/requirements-vulture.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py toml==0.10.2 -vulture==2.9.1 +vulture==2.10 -- cgit v1.2.3-54-g00ecf From 750e2b0a72e39c1e915b63d8fca245e0094ef4d6 Mon Sep 17 00:00:00 2001 From: toofar Date: Wed, 11 Oct 2023 19:10:45 +1300 Subject: pylint 3.0 deprectations Changelog: https://pylint.pycqa.org/en/latest/whatsnew/3/3.0/index.html#summary-release-highlights remove `__implements__`: That attribute is apparently from a rejected PEP. They say to inherit from BaseChecker, which we are already doing. https://github.com/pylint-dev/pylint/pull/8404 check_messages -> only_required_for_messages: Seems straightforward instructions. I haven't actually tested it. https://github.com/pylint-dev/pylint/pull/8409 remove emptystring extension: Looks like this has been replaced by https://pylint.readthedocs.io/en/stable/user_guide/messages/convention/use-implicit-booleaness-not-comparison-to-string.html Which is disabled by default but we have `enable=ALL`, so I guess that means we indeed have it enabled. And update changelog URLs. --- .pylintrc | 1 - scripts/dev/changelog_urls.json | 4 +--- scripts/dev/pylint_checkers/qute_pylint/config.py | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.pylintrc b/.pylintrc index a02732c2d..46a8ae2e8 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,7 +3,6 @@ ignore=resources.py extension-pkg-whitelist=PyQt5,PyQt6,sip load-plugins=qute_pylint.config, pylint.extensions.docstyle, - pylint.extensions.emptystring, pylint.extensions.overlapping_exceptions, pylint.extensions.code_style, pylint.extensions.comparison_placement, diff --git a/scripts/dev/changelog_urls.json b/scripts/dev/changelog_urls.json index 5a9c9b34a..1870d0228 100644 --- a/scripts/dev/changelog_urls.json +++ b/scripts/dev/changelog_urls.json @@ -1,9 +1,8 @@ { - "pylint": "https://pylint.pycqa.org/en/latest/whatsnew/2/index.html", + "pylint": "https://pylint.pycqa.org/en/latest/whatsnew/3/index.html", "tomlkit": "https://github.com/sdispater/tomlkit/blob/master/CHANGELOG.md", "dill": "https://github.com/uqfoundation/dill/commits/master", "isort": "https://github.com/PyCQA/isort/blob/main/CHANGELOG.md", - "lazy-object-proxy": "https://github.com/ionelmc/python-lazy-object-proxy/blob/master/CHANGELOG.rst", "mccabe": "https://github.com/PyCQA/mccabe#changes", "pytest-cov": "https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst", "pytest-xdist": "https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst", @@ -93,7 +92,6 @@ "altgraph": "https://github.com/ronaldoussoren/altgraph/blob/master/doc/changelog.rst", "urllib3": "https://github.com/urllib3/urllib3/blob/main/CHANGES.rst", "lxml": "https://github.com/lxml/lxml/blob/master/CHANGES.txt", - "wrapt": "https://github.com/GrahamDumpleton/wrapt/blob/develop/docs/changes.rst", "cryptography": "https://cryptography.io/en/latest/changelog.html", "toml": "https://github.com/uiri/toml/releases", "tomli": "https://github.com/hukkin/tomli/blob/master/CHANGELOG.md", diff --git a/scripts/dev/pylint_checkers/qute_pylint/config.py b/scripts/dev/pylint_checkers/qute_pylint/config.py index 283de5d35..be5bae082 100644 --- a/scripts/dev/pylint_checkers/qute_pylint/config.py +++ b/scripts/dev/pylint_checkers/qute_pylint/config.py @@ -21,7 +21,6 @@ class ConfigChecker(checkers.BaseChecker): """Custom astroid checker for config calls.""" - __implements__ = interfaces.IAstroidChecker name = 'config' msgs = { 'E9998': ('%s is no valid config option.', # flake8: disable=S001 @@ -31,7 +30,7 @@ class ConfigChecker(checkers.BaseChecker): priority = -1 printed_warning = False - @utils.check_messages('bad-config-option') + @utils.only_required_for_messages('bad-config-option') def visit_attribute(self, node): """Visit a getattr node.""" # We're only interested in the end of a config.val.foo.bar chain -- cgit v1.2.3-54-g00ecf From 207de5828decfa54217b06905e00f9d298f27e57 Mon Sep 17 00:00:00 2001 From: toofar Date: Sat, 14 Oct 2023 17:25:39 +1300 Subject: fix lint Was getting R0913: Too many arguments (14/10) (too-many-arguments) no idea what that is just showing up now --- qutebrowser/commands/command.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index 5e4281474..effdcc9b0 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -62,10 +62,12 @@ class Command: COUNT_COMMAND_VALUES = [usertypes.CommandValue.count, usertypes.CommandValue.count_tab] - def __init__(self, *, handler, name, instance=None, maxsplit=None, - modes=None, not_modes=None, debug=False, deprecated=False, - no_cmd_split=False, star_args_optional=False, scope='global', - backend=None, no_replace_variables=False): + def __init__( + self, *, handler, name, instance=None, maxsplit=None, + modes=None, not_modes=None, debug=False, deprecated=False, + no_cmd_split=False, star_args_optional=False, scope='global', + backend=None, no_replace_variables=False, + ): # pylint: disable=too-many-arguments if modes is not None and not_modes is not None: raise ValueError("Only modes or not_modes can be given!") if modes is not None: -- cgit v1.2.3-54-g00ecf From a927a93d2833de61cdf85defb88b94ef8e17d51b Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 15 Oct 2023 16:45:22 +1300 Subject: lint: allow comparing variables to 0 With pylint 3 there is a new option: https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/use-implicit-booleaness-not-comparison-to-zero.html It's disabled by default but we enable all warnings and disabled them as desired. This one is of the opinion that: if x == 0: is bad and if x: is good. I feel that the first one (x == 0) is more clear. We aren't checking for truthiness here, we are checking for a literal value, its very intentional. One might argue that being precious about making the type here is redundant in current year with type checking tooling and all that. But there are like a hundred of these checks in the code base so it seems a well established pattern anyhow. In summary, the new warning doesn't have a very strong use case and we would prefer to stick with out established pattern. --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index 46a8ae2e8..a6784c0e4 100644 --- a/.pylintrc +++ b/.pylintrc @@ -59,6 +59,7 @@ disable=locally-disabled, useless-param-doc, wrong-import-order, # doesn't work with qutebrowser.qt, even with known-third-party set ungrouped-imports, # ditto + use-implicit-booleaness-not-comparison-to-zero, [BASIC] function-rgx=[a-z_][a-z0-9_]{2,50}$ -- cgit v1.2.3-54-g00ecf From 2a32e1b1aeee4affa3407782f47fe9cc97bef4a4 Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 15 Oct 2023 17:16:55 +1300 Subject: lint: the exec in namedtuple is useful here https://pylint.readthedocs.io/en/stable/user_guide/messages/refactor/prefer-typing-namedtuple.html Says to using the class based typing.NamedTuple instead of collections.namedtuple, which just constructs a class based off of strings. Here we are creating a dynamic class based on the fields in the SQL result. It's only called once for a query, so I don't think speed is an issue. Also it's not used by the completion, looks like just :history --- qutebrowser/misc/sql.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py index 1481ba219..b23b862a3 100644 --- a/qutebrowser/misc/sql.py +++ b/qutebrowser/misc/sql.py @@ -320,6 +320,7 @@ class Query: raise BugError("Cannot iterate inactive query") rec = self.query.record() fields = [rec.fieldName(i) for i in range(rec.count())] + # pylint: disable=prefer-typing-namedtuple rowtype = collections.namedtuple( # type: ignore[misc] 'ResultRow', fields) -- cgit v1.2.3-54-g00ecf