summaryrefslogtreecommitdiff
path: root/pyrightconfig.json
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2022-10-29 14:55:23 +1300
committertoofar <toofar@spalge.com>2022-10-29 15:08:48 +1300
commit97920c8271170b1347b6b3cd351790959589ab6a (patch)
tree3bf4cce09e25ffccec0f8b443466b0cc47460cfe /pyrightconfig.json
parent9c17f9d9b302dd548f2cc60f0f3457ce191de52b (diff)
downloadqutebrowser-97920c8271170b1347b6b3cd351790959589ab6a.tar.gz
qutebrowser-97920c8271170b1347b6b3cd351790959589ab6a.zip
Configure pyright to look at PyQt5 imports.
Define some constants for pyright to control how it handles the imports in qutebrowser.qt.* This is mainly for autocompletion and definitions with VS Code, which uses pyright via the pylance extension. If you have multiple possible places something could be imported from, and one of them isn't installed, the type of the thing being imported will fall back to Any, and you wont get nice things. So we use this file to make sure only certain imports are configured. The most important thing to remember about this file is it'll control where type definitions come from in VS Code. You can have multiple backends defined as true, generally the last import will win in that case. If any of the enabled imports aren't installed though you may not get any type hints at all. PyQt5 has been configured for now to match the type checking configured in CI. Personally I would be fine with PyQt6 configured here anyway since that's generally what we are developing against these days. See #7370 for more info.
Diffstat (limited to 'pyrightconfig.json')
-rw-r--r--pyrightconfig.json10
1 files changed, 10 insertions, 0 deletions
diff --git a/pyrightconfig.json b/pyrightconfig.json
new file mode 100644
index 000000000..138687c53
--- /dev/null
+++ b/pyrightconfig.json
@@ -0,0 +1,10 @@
+{
+ "defineConstant": {
+ "USE_PYQT6": false,
+ "USE_PYQT5": true,
+ "USE_PYSIDE2": false,
+ "USE_PYSIDE6": false,
+ "IS_QT5": true,
+ "IS_QT6": false
+ }
+}