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 |
||
|---|---|---|
| .. | ||
| README.md | ||
| requirements-check-manifest.txt | ||
| requirements-check-manifest.txt-raw | ||
| requirements-dev.txt | ||
| requirements-dev.txt-raw | ||
| requirements-docs.txt | ||
| requirements-docs.txt-raw | ||
| requirements-flake8.txt | ||
| requirements-flake8.txt-raw | ||
| requirements-mypy.txt | ||
| requirements-mypy.txt-raw | ||
| requirements-pyinstaller.txt | ||
| requirements-pyinstaller.txt-raw | ||
| requirements-pylint.txt | ||
| requirements-pylint.txt-raw | ||
| requirements-pyqt-5.15.2.txt | ||
| requirements-pyqt-5.15.2.txt-raw | ||
| requirements-pyqt-5.15.txt | ||
| requirements-pyqt-5.15.txt-raw | ||
| requirements-pyqt-5.txt | ||
| requirements-pyqt-5.txt-raw | ||
| requirements-pyqt-6.2.txt | ||
| requirements-pyqt-6.2.txt-raw | ||
| requirements-pyqt-6.3.txt | ||
| requirements-pyqt-6.3.txt-raw | ||
| requirements-pyqt-6.4.txt | ||
| requirements-pyqt-6.4.txt-raw | ||
| requirements-pyqt-6.5.txt | ||
| requirements-pyqt-6.5.txt-raw | ||
| requirements-pyqt-6.6.txt | ||
| requirements-pyqt-6.6.txt-raw | ||
| requirements-pyqt-6.txt | ||
| requirements-pyqt-6.txt-raw | ||
| requirements-pyqt.txt | ||
| requirements-pyqt.txt-raw | ||
| requirements-pyroma.txt | ||
| requirements-pyroma.txt-raw | ||
| requirements-qutebrowser.txt-raw | ||
| requirements-sphinx.txt | ||
| requirements-sphinx.txt-raw | ||
| requirements-tests-bleeding.txt | ||
| requirements-tests.txt | ||
| requirements-tests.txt-raw | ||
| requirements-tox.txt | ||
| requirements-tox.txt-raw | ||
| requirements-vulture.txt | ||
| requirements-vulture.txt-raw | ||
| requirements-yamllint.txt | ||
| requirements-yamllint.txt-raw | ||
README.md
This directory contains various requirements files which are used by tox to
have reproducible tests with pinned versions.
The files are generated based on unpinned requirements in *.txt-raw files.
Those files can also contain some special commands:
- Add an additional comment to a line:
#@ comment: <package> <comment here> - Filter a line for requirements.io:
#@ filter: <package> <filter> - Don't include a package in the output:
#@ ignore: <package>(or multiple packages) - Replace a part of a frozen package specification with another:
#@ replace: <regex> <replacement> - Add a new line:
#@ add: <line> - Add environment markers to a line:
#@ markers: <package> <markers>
Some examples:
#@ comment: mypkg blah blub
#@ filter: mypkg != 1.0.0
#@ ignore: mypkg, otherpkg
#@ replace: foo bar
## Use the marker line to restrict the unpinned Flask requirement to python
## 3.7. For python 3.7 add a specific version into the output.
Flask
# Python 3.7
#@ markers: Flask python_version>="3.7"
#@ add: Flask==2.2.5 ; python_version=="3.7.*"