You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self is used as parameter name in QgsVectorDataProvider (and I assume in all subclasses if that is relevant, for example in QgsPostgresProvider), and that conflicts with the instance parameter in Python method signature:
Steps to reproduce the issue
Use any python interpreter to create a new venv and install mypy
Set PYTHONPATH env var to point at the installed qgis python module
Use stubgen to generate stubs with stubgen -m qgis.core or stubgen -m qgis.gui
Observe that previously shown errors occur when parsing existing .pyis
Versions
QGIS 3.22.0 on Windows 10 (from osgeo v2 network installer qgis-package)
Supported QGIS version
I'm running a supported QGIS version according to the roadmap.
Unrelated to this specific bug (but contributing to missing types), PyQt5 .pyis are missing on Windows for now (ticket for that issue)
Lots of enum changes happened lately?
Update from 3.16/py3.7 to 3.22/py3.9 caused this issue to appear, previous stubs include the empty enums as they probably should appear as class Flag(int): .... Those were taken from docker image and are Generated by SIP 4.19.21, current install stubs are Generated by SIP 6.1.1, so SIP version might also be a relevant change.
The text was updated successfully, but these errors were encountered:
komima
added
the
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
label
Nov 26, 2021
What is the bug or the crash?
QGIS Python module type stub .pyi files have errors, and types are not available in IDE/mypy/pyright contexts.
Empty enums are output from QgsProcessingContext and QgsModelComponentGraphicItem, and the syntax is not valid:
self
is used as parameter name in QgsVectorDataProvider (and I assume in all subclasses if that is relevant, for example in QgsPostgresProvider), and that conflicts with the instance parameter in Python method signature:Steps to reproduce the issue
PYTHONPATH
env var to point at the installed qgis python modulestubgen -m qgis.core
orstubgen -m qgis.gui
Versions
QGIS 3.22.0 on Windows 10 (from osgeo v2 network installer
qgis
-package)Supported QGIS version
New profile
Additional context
class Flag(int): ...
. Those were taken from docker image and areGenerated by SIP 4.19.21
, current install stubs areGenerated by SIP 6.1.1
, so SIP version might also be a relevant change.The text was updated successfully, but these errors were encountered: