From 698d2d6b8bb68d2b26ec4435b428457b5eba1deb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 14 Jun 2021 12:19:25 +0200 Subject: Add new types packages for mypy See http://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html --- misc/requirements/requirements-mypy.txt | 2 ++ misc/requirements/requirements-mypy.txt-raw | 3 +++ qutebrowser/browser/webkit/http.py | 2 +- scripts/dev/recompile_requirements.py | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/requirements/requirements-mypy.txt b/misc/requirements/requirements-mypy.txt index 4c99e06b4..031362958 100644 --- a/misc/requirements/requirements-mypy.txt +++ b/misc/requirements/requirements-mypy.txt @@ -15,5 +15,7 @@ pluggy==0.13.1 Pygments==2.9.0 PyQt5-stubs==5.15.2.0 toml==0.10.2 +types-dataclasses==0.1.4 +types-PyYAML==0.1.8 typing-extensions==3.10.0.0 zipp==3.4.1 diff --git a/misc/requirements/requirements-mypy.txt-raw b/misc/requirements/requirements-mypy.txt-raw index e93eaae0b..4baeec11f 100644 --- a/misc/requirements/requirements-mypy.txt-raw +++ b/misc/requirements/requirements-mypy.txt-raw @@ -1,7 +1,10 @@ mypy lxml # For HTML reports diff-cover + PyQt5-stubs +types-dataclasses +types-PyYAML # So stubs are available even on newer Python versions importlib_resources diff --git a/qutebrowser/browser/webkit/http.py b/qutebrowser/browser/webkit/http.py index 35cecd89a..eacb95679 100644 --- a/qutebrowser/browser/webkit/http.py +++ b/qutebrowser/browser/webkit/http.py @@ -64,7 +64,7 @@ class ContentDisposition: # "duplicate ignored"), because even if we did ignore that one, it still wouldn't # work properly... _IGNORED_DEFECT = DefectWrapper( - email.errors.InvalidHeaderDefect, # type: ignore[attr-defined] + email.errors.InvalidHeaderDefect, 'duplicate parameter name; duplicate ignored' ) diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index 5121bd27a..158741e5c 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -65,6 +65,8 @@ CHANGELOG_URLS = { 'glob2': 'https://github.com/miracle2k/python-glob2/blob/master/CHANGES', 'hypothesis': 'https://hypothesis.readthedocs.io/en/latest/changes.html', 'mypy': 'https://mypy-lang.blogspot.com/', + 'types-PyYAML': 'https://github.com/python/typeshed/commits/master/stubs/PyYAML', + 'types-dataclasses': 'https://github.com/python/typeshed/commits/master/stubs/dataclasses', 'pytest': 'https://docs.pytest.org/en/latest/changelog.html', 'iniconfig': 'https://github.com/RonnyPfannschmidt/iniconfig/blob/master/CHANGELOG', 'tox': 'https://tox.readthedocs.io/en/latest/changelog.html', -- cgit v1.2.3-54-g00ecf