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
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,11 @@ conda install qtpy
104
104
105
105
### Type checker integration
106
106
107
+
Type checkers have no knowledge of installed packages, so these tools require
108
+
additional configuration.
109
+
110
+
#### Mypy
111
+
107
112
A Command Line Interface (CLI) is offered to help with usage of QtPy.
108
113
Presently, its only feature is to generate command line arguments for Mypy
109
114
that will enable it to process the QtPy source files with the same API
@@ -132,7 +137,21 @@ the Mypy command line invocation as follows:
132
137
mypy --package mypackage $(qtpy mypy-args)
133
138
```
134
139
135
-
For Pyright support and other usage notes, see [this comment](https://github.com/spyder-ide/qtpy/issues/352#issuecomment-1170684412).
140
+
#### Pyright/Pylance
141
+
142
+
Instead of runtime arguments, it is required to create a config file for the project,
143
+
called `pyrightconfig.json` or a `pyright` section in `pyproject.toml`. See [here](https://github.com/microsoft/pyright/blob/main/docs/configuration.md) for reference.
144
+
145
+
If you run
146
+
147
+
```bash
148
+
qtpy pyright-config
149
+
```
150
+
151
+
you will get the necessary configs to be included in your project files. If you don't
152
+
have them, it is recommended to create the latter.
153
+
154
+
These steps are necessary for running the default VSCode's type checking.
0 commit comments