I create my .ui
files with QT Designer and convert them to a python file using the pyside6-uic ...
command. Each time I load such an `auto-generated' python file via :
class MyCrazyTestDialog(QDialog):
def __init__(self) -> None:
super().__init__()
self.ui = Ui_MyCrazyTestDialog()
self.ui.setupUi(self)
the line self.ui.setupUi(self)
will generate the mypy error:
Mypy: Call to untyped function "setupUi" in typed context [no-untyped-call]
I have tried several ways to exclude all auto-generated files from the mypy search. But had no success. The obvious solution with self.ui.setupUi(self) # type: ignore
does not work either, because it will complain about calling an untyped function in the type environment for every line that uses self.ui
...
I have already installed the unofficial pyside6 stubs from here, which helped with mypy errors for the self.translate qt code, but it does not help here.
Does anyone know how I can configure my mypy setup so that it will ignore calls to the auto-generated files?