Merge pull request #7576 from qutebrowser/update-dependencies

Update dependencies
This commit is contained in:
toofar 2023-02-07 20:16:21 +13:00 committed by GitHub
commit 1e67b26df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 81 additions and 71 deletions

View File

@ -16,6 +16,8 @@ load-plugins=qute_pylint.config,
pylint.extensions.typing,
pylint.extensions.docparams,
pylint.extensions.private_import,
pylint.extensions.dict_init_mutate,
pylint.extensions.dunder
persistent=n
py-version=3.7

View File

@ -45,4 +45,4 @@ typing_extensions==4.4.0
uritemplate==4.1.1
# urllib3==1.26.14
webencodings==0.5.1
zipp==3.12.0
zipp==3.12.1

View File

@ -8,11 +8,11 @@ Jinja2==3.1.2
lxml==4.9.2
MarkupSafe==2.1.2
mypy==0.991
mypy-extensions==0.4.3
mypy-extensions==1.0.0
pluggy==1.0.0
Pygments==2.14.0
PyQt5-stubs==5.15.6.0
tomli==2.0.1
types-PyYAML==6.0.12.3
types-PyYAML==6.0.12.4
typing_extensions==4.4.0
zipp==3.12.0
zipp==3.12.1

View File

@ -1,6 +1,6 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
astroid==2.13.5
astroid==2.14.1
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.0.1
@ -9,14 +9,14 @@ dill==0.3.6
future==0.18.3
github3.py==3.2.0
idna==3.4
isort==5.11.4
isort==5.11.5
lazy-object-proxy==1.9.0
mccabe==0.7.0
pefile==2022.5.30
platformdirs==2.6.2
pycparser==2.21
PyJWT==2.6.0
pylint==2.15.10
pylint==2.16.1
python-dateutil==2.8.2
./scripts/dev/pylint_checkers
requests==2.28.2

View File

@ -18,9 +18,9 @@ snowballstemmer==2.2.0
Sphinx==6.1.3
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
urllib3==1.26.14
zipp==3.12.0
zipp==3.12.1

View File

@ -1,7 +1,7 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
attrs==22.2.0
beautifulsoup4==4.11.1
beautifulsoup4==4.11.2
certifi==2022.12.7
charset-normalizer==3.0.1
cheroot==9.0.0
@ -12,7 +12,7 @@ execnet==1.9.0
filelock==3.9.0
Flask==2.2.2
hunter==3.5.1
hypothesis==6.65.2
hypothesis==6.67.1
idna==3.4
importlib-metadata==6.0.0
iniconfig==2.0.0
@ -53,4 +53,4 @@ typing_extensions==4.4.0
urllib3==1.26.14
vulture==2.7
Werkzeug==2.2.2
zipp==3.12.0
zipp==3.12.1

View File

@ -6,12 +6,12 @@ colorama==0.4.6
distlib==0.3.6
filelock==3.9.0
packaging==23.0
pip==22.3.1
pip==23.0
platformdirs==2.6.2
pluggy==1.0.0
pyproject_api==1.5.0
setuptools==67.0.0
setuptools==67.1.0
tomli==2.0.1
tox==4.4.2
tox==4.4.4
virtualenv==20.17.1
wheel==0.38.4

View File

@ -490,7 +490,7 @@ class AbstractZoom(QObject):
raise ValueError("Can't zoom to factor {}!".format(factor))
default_zoom_factor = float(config.val.zoom.default) / 100
self._default_zoom_changed = (factor != default_zoom_factor)
self._default_zoom_changed = factor != default_zoom_factor
self._zoom_factor = factor
self._set_factor_internal(factor)

View File

@ -1294,9 +1294,8 @@ class CommandDispatcher:
was_added = bookmark_manager.add(url, title, toggle=toggle)
except urlmarks.Error as e:
raise cmdutils.CommandError(str(e))
else:
msg = "Bookmarked {}" if was_added else "Removed bookmark {}"
message.info(msg.format(url.toDisplayString()))
msg = "Bookmarked {}" if was_added else "Removed bookmark {}"
message.info(msg.format(url.toDisplayString()))
@cmdutils.register(instance='command-dispatcher', scope='window',
maxsplit=0)

View File

@ -563,9 +563,8 @@ def qute_pdfjs(url: QUrl) -> _HandlerRet:
log.misc.warning(
"pdfjs resource requested but not found: {}".format(e.path))
raise NotFoundError("Can't find pdfjs resource '{}'".format(e.path))
else:
mimetype = utils.guess_mimetype(url.fileName(), fallback=True)
return mimetype, data
mimetype = utils.guess_mimetype(url.fileName(), fallback=True)
return mimetype, data
@add_handler('warning')

View File

@ -405,6 +405,7 @@ def debug_crash(typ: str = 'exception') -> None:
Args:
typ: either 'exception' or 'segfault'.
"""
# pylint: disable=broad-exception-raised
if typ == 'segfault':
os.kill(os.getpid(), signal.SIGSEGV)
raise Exception("Segfault failed (wat.)")

View File

@ -1106,7 +1106,7 @@ class QtColor(BaseType):
mult = 359.0 if kind == 'h' else 255.0
if val.endswith('%'):
val = val[:-1]
mult = mult / 100
mult /= 100
try:
return int(float(val) * mult)

View File

@ -564,19 +564,17 @@ def session_load(name: str, *,
except SessionError as e:
raise cmdutils.CommandError("Error while loading session: {}"
.format(e))
else:
if clear:
for win in old_windows:
win.close()
if delete:
try:
session_manager.delete(name)
except SessionError as e:
log.sessions.exception("Error while deleting session!")
raise cmdutils.CommandError("Error while deleting session: {}"
.format(e))
else:
log.sessions.debug("Loaded & deleted session {}.".format(name))
if clear:
for win in old_windows:
win.close()
if delete:
try:
session_manager.delete(name)
except SessionError as e:
log.sessions.exception("Error while deleting session!")
raise cmdutils.CommandError("Error while deleting session: {}"
.format(e))
log.sessions.debug("Loaded & deleted session {}.".format(name))
@cmdutils.register()
@ -622,11 +620,10 @@ def session_save(name: ArgType = default, *,
with_history=not no_history)
except SessionError as e:
raise cmdutils.CommandError("Error while saving session: {}".format(e))
if quiet:
log.sessions.debug("Saved session {}.".format(name))
else:
if quiet:
log.sessions.debug("Saved session {}.".format(name))
else:
message.info("Saved session {}.".format(name))
message.info("Saved session {}.".format(name))
@cmdutils.register()
@ -649,8 +646,7 @@ def session_delete(name: str, *, force: bool = False) -> None:
log.sessions.exception("Error while deleting session!")
raise cmdutils.CommandError("Error while deleting session: {}"
.format(e))
else:
log.sessions.debug("Deleted session {}.".format(name))
log.sessions.debug("Deleted session {}.".format(name))
def load_default(name):

View File

@ -330,8 +330,10 @@ def _create(path: str) -> None:
for k, v in os.environ.items():
if k == 'HOME' or k.startswith('XDG_'):
log.init.debug(f"{k} = {v}")
raise Exception("Trying to create directory inside /home during "
"tests, this should not happen.")
raise AssertionError(
"Trying to create directory inside /home during "
"tests, this should not happen."
)
os.makedirs(path, 0o700, exist_ok=True)

View File

@ -9,7 +9,7 @@ MarkupSafe==2.1.2
Pygments==2.14.0
PyYAML==6.0
typing_extensions==4.4.0 ; python_version<"3.8"
zipp==3.12.0
zipp==3.12.1
# Unpinned due to recompile_requirements.py limitations
pyobjc-core ; sys_platform=="darwin"
pyobjc-framework-Cocoa ; sys_platform=="darwin"

View File

@ -223,7 +223,7 @@ def smoke_test(executable: pathlib.Path, debug: bool) -> None:
"",
]
raise Exception("\n".join(lines))
raise Exception("\n".join(lines)) # pylint: disable=broad-exception-raised
def verify_windows_exe(exe_path: pathlib.Path) -> None:
@ -598,7 +598,7 @@ def read_github_token(
if optional:
return None
else:
raise Exception(
raise Exception( # pylint: disable=broad-exception-raised
"GitHub token needed, but ~/.gh_token not found, "
"and --gh-token not given.")
@ -614,6 +614,7 @@ def github_upload(artifacts: List[Artifact], tag: str, gh_token: str) -> None:
tag: The name of the release tag
gh_token: The GitHub token to use
"""
# pylint: disable=broad-exception-raised
import github3
import github3.exceptions
utils.print_title("Uploading to github...")

View File

@ -499,6 +499,7 @@ def _format_block(filename, what, data):
what: What to change (authors, options, etc.)
data; A list of strings which is the new data.
"""
# pylint: disable=broad-exception-raised
what = what.upper()
oshandle, tmpname = tempfile.mkstemp()
try:
@ -525,9 +526,8 @@ def _format_block(filename, what, data):
except:
os.remove(tmpname)
raise
else:
os.remove(filename)
shutil.move(tmpname, filename)
os.remove(filename)
shutil.move(tmpname, filename)
def regenerate_manpage(filename):

View File

@ -66,6 +66,7 @@ def download_nsis_plugins():
def find_pdfjs_asset(assets, legacy):
"""Find the PDF.js asset to use."""
# pylint: disable=broad-exception-raised
for asset in assets:
name = asset["name"]
if (
@ -82,6 +83,7 @@ def get_latest_pdfjs_url(gh_token, legacy):
Returns a (version, url)-tuple.
"""
# pylint: disable=broad-exception-raised
github_api = 'https://api.github.com'
endpoint = 'repos/mozilla/pdf.js/releases/latest'
request = urllib.request.Request(f'{github_api}/{endpoint}')

View File

@ -289,7 +289,7 @@ def pytest_report_header(config):
@pytest.fixture(scope='session', autouse=True)
def check_display(request):
if utils.is_linux and not os.environ.get('DISPLAY', ''):
raise Exception("No display and no Xvfb available!")
raise RuntimeError("No display and no Xvfb available!")
@pytest.fixture(autouse=True)

View File

@ -523,7 +523,7 @@ class QuteProc(testprocess.Process):
profile = self.request.config.getoption('--qute-profile-subprocs')
if hasattr(sys, 'frozen'):
if profile:
raise Exception("Can't profile with sys.frozen!")
raise RuntimeError("Can't profile with sys.frozen!")
executable = str(pathlib.Path(sys.executable).parent / 'qutebrowser')
args = []
else:

View File

@ -204,9 +204,9 @@ def test_misconfigured_user_dirs(request, server, temp_basedir_env,
home = tmp_path / 'home'
home.mkdir()
temp_basedir_env['HOME'] = str(home)
config_userdir_dir = (tmp_path / 'config')
config_userdir_dir = tmp_path / 'config'
config_userdir_dir.mkdir(parents=True)
config_userdir_file = (tmp_path / 'config' / 'user-dirs.dirs')
config_userdir_file = tmp_path / 'config' / 'user-dirs.dirs'
config_userdir_file.touch()
assert temp_basedir_env['XDG_CONFIG_HOME'] == str(tmp_path / 'config')
@ -307,7 +307,7 @@ def test_webengine_download_suffix(request, quteproc_new, tmp_path):
(tmp_path / 'user-dirs.dirs').write_text(
'XDG_DOWNLOAD_DIR={}'.format(download_dir))
env = {'XDG_CONFIG_HOME': str(tmp_path)}
args = (['--temp-basedir'] + _base_args(request.config))
args = ['--temp-basedir'] + _base_args(request.config)
quteproc_new.start(args, env=env)
quteproc_new.set_setting('downloads.location.prompt', 'false')

View File

@ -630,6 +630,10 @@ class FakeDownloadManager:
return False
class FakeHistoryTick(Exception):
pass
class FakeHistoryProgress:
"""Fake for a WebHistoryProgress object."""
@ -648,7 +652,7 @@ class FakeHistoryProgress:
def tick(self):
if self._raise_on_tick:
raise Exception('tick-tock')
raise FakeHistoryTick('tick-tock')
self._value += 1
def finish(self):

View File

@ -471,7 +471,7 @@ class TestRebuild:
# Trigger a completion rebuild
monkeypatch.setattr(web_history.database, 'user_version_changed', lambda: True)
with pytest.raises(Exception, match='tick-tock'):
with pytest.raises(stubs.FakeHistoryTick, match='tick-tock'):
history.WebHistory(web_history.database, progress=progress)
assert web_history.metainfo['force_rebuild']

View File

@ -34,7 +34,7 @@ def test_version(message_mock, caplog):
with caplog.at_level(logging.WARNING):
assert spell.version('malformed_filename') is None
msg = message_mock.getmsg(usertypes.MessageLevel.warning)
expected = ("Found a dictionary with a malformed name: malformed_filename")
expected = "Found a dictionary with a malformed name: malformed_filename"
assert msg.text == expected

View File

@ -94,8 +94,8 @@ def test_refuses_non_ascii_header_value(checker, header, value):
'root_content': b'',
'content_location': 'http://example.com',
'content_type': 'text/plain',
header: value,
}
defaults[header] = value
writer = mhtml.MHTMLWriter(**defaults)
with pytest.raises(UnicodeEncodeError, match="'ascii' codec can't encode"):
writer.write_to(checker.fp)

View File

@ -78,7 +78,7 @@ def test_debug_trace_exception(mocker):
"""Check that exceptions thrown by hunter.trace are handled."""
def _mock_exception():
"""Side effect for testing debug_trace's reraise."""
raise Exception('message')
raise Exception('message') # pylint: disable=broad-exception-raised
hunter_mock = mocker.patch.object(misccommands, 'hunter')
hunter_mock.trace.side_effect = _mock_exception

View File

@ -59,7 +59,7 @@ def test_no_option_error(deleted, renamed, all_names, expected):
def test_no_option_error_clash():
with pytest.raises(AssertionError):
configexc.NoOptionError('opt', deleted=True, renamed='foo')
_ = configexc.NoOptionError('opt', deleted=True, renamed='foo')
def test_no_autoconfig_error():

View File

@ -91,7 +91,7 @@ class _Hook:
def __call__(self, *args):
if self.raising:
raise Exception("Should not be called!")
raise AssertionError("Should not be called!")
self.called = True

View File

@ -262,7 +262,7 @@ class TestSocketName:
elif utils.is_linux:
pass
else:
raise Exception("Unexpected platform!")
raise AssertionError("Unexpected platform!")
class TestExceptions:

View File

@ -286,7 +286,7 @@ class FakeWebView:
def load_history(self, data):
self.loaded_history = data
if self.raise_error is not None:
raise self.raise_error # pylint: disable=raising-bad-type
raise self.raise_error
@pytest.fixture

View File

@ -406,7 +406,9 @@ class TestTransaction:
with database.transaction():
my_table.insert({'column': 1})
my_table.insert({'column': 2})
raise Exception('something went horribly wrong')
except Exception:
raise RuntimeError(
'something went horribly wrong and the transaction will be aborted'
)
except RuntimeError:
pass
assert database.query('select count(*) from my_table').run().value() == 0

View File

@ -281,7 +281,7 @@ class TestArguments:
def test_basedir_relative(self, tmpdir):
"""Test --basedir with a relative path."""
basedir = (tmpdir / 'basedir')
basedir = tmpdir / 'basedir'
basedir.ensure(dir=True)
with tmpdir.as_cwd():
args = types.SimpleNamespace(basedir='basedir')

View File

@ -425,7 +425,7 @@ class TestPreventExceptions:
@utils.prevent_exceptions(42)
def func_raising(self):
raise Exception
raise RuntimeError("something went wrong")
def test_raising(self, caplog):
"""Test with a raising function."""
@ -434,6 +434,7 @@ class TestPreventExceptions:
assert ret == 42
expected = 'Error in test_utils.TestPreventExceptions.func_raising'
assert caplog.messages == [expected]
assert caplog.records[0].exc_info[1].args[0] == "something went wrong"
@utils.prevent_exceptions(42)
def func_not_raising(self):
@ -448,7 +449,7 @@ class TestPreventExceptions:
@utils.prevent_exceptions(42, True)
def func_predicate_true(self):
raise Exception("its-true")
raise RuntimeError("its-true")
def test_predicate_true(self, caplog):
"""Test with a True predicate."""
@ -456,15 +457,16 @@ class TestPreventExceptions:
ret = self.func_predicate_true()
assert ret == 42
assert len(caplog.records) == 1
assert caplog.records[0].exc_info[1].args[0] == "its-true"
@utils.prevent_exceptions(42, False)
def func_predicate_false(self):
raise Exception("its-false")
raise RuntimeError("its-false")
def test_predicate_false(self, caplog):
"""Test with a False predicate."""
with caplog.at_level(logging.ERROR, 'misc'):
with pytest.raises(Exception, match="its-false"):
with pytest.raises(RuntimeError, match="its-false"):
self.func_predicate_false()
assert not caplog.records