1010[ ![ Github build status] ( https://github.com/spyder-ide/qtpy/workflows/Tests/badge.svg )] ( https://github.com/spyder-ide/qtpy/actions )
1111[ ![ Coverage Status] ( https://coveralls.io/repos/github/spyder-ide/qtpy/badge.svg?branch=master )] ( https://coveralls.io/github/spyder-ide/qtpy?branch=master )
1212
13- * Copyright © 2009–2022 The Spyder Development Team*
13+ * Copyright © 2009– The Spyder Development Team*
1414
1515
1616## Description
1717
1818** QtPy** is a small abstraction layer that lets you
1919write applications using a single API call to either PyQt or PySide.
2020
21- It provides support for PyQt5, PyQt6, PySide6, PySide2 using the Qt5 layout
21+ It provides support for PyQt5, PySide2, PyQt6 and PySide6 using the Qt5 layout
2222(where the QtGui module has been split into QtGui and QtWidgets).
2323
2424Basically, you can write your code as if you were using PyQt or PySide directly,
@@ -41,7 +41,7 @@ to a particular project or namespace.
4141
4242### License
4343
44- This project is released under the MIT license.
44+ This project is released under the [ MIT license] ( LICENSE.txt ) .
4545
4646
4747### Requirements
@@ -107,10 +107,12 @@ conda install qtpy
107107Type checkers have no knowledge of installed packages, so these tools require
108108additional configuration.
109109
110+ A Command Line Interface (CLI) is offered to help with usage of QtPy (to get MyPy
111+ and Pyright/Pylance args/configurations).
112+
110113#### Mypy
111114
112- A Command Line Interface (CLI) is offered to help with usage of QtPy.
113- Presently, its only feature is to generate command line arguments for Mypy
115+ The ` mypy-args ` command helps you to generate command line arguments for Mypy
114116that will enable it to process the QtPy source files with the same API
115117as QtPy itself would have selected.
116118
@@ -139,8 +141,11 @@ mypy --package mypackage $(qtpy mypy-args)
139141
140142#### Pyright/Pylance
141143
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+ In the case of Pyright, instead of runtime arguments, it is required to create a
145+ config file for the project, called ` pyrightconfig.json ` or a ` pyright ` section
146+ in ` pyproject.toml ` . See [ here] ( https://github.com/microsoft/pyright/blob/main/docs/configuration.md )
147+ for reference. In order to set this configuration, QtPy offers the ` pyright-config `
148+ command for guidance.
144149
145150If you run
146151
@@ -149,14 +154,63 @@ qtpy pyright-config
149154```
150155
151156you 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.
157+ have them, it is recommended to create the latter. For example, in an environment where PyQt5
158+ is installed and selected (or the default fallback, if no binding can be found in the
159+ environment), this would output the following:
160+
161+ ``` text
162+ pyrightconfig.json:
163+ {"defineConstant": {"PYQT5": true, "PYSIDE2": false, "PYQT6": false, "PYSIDE6": false}}
164+
165+ pyproject.toml:
166+ [tool.pyright.defineConstant]
167+ PYQT5 = true
168+ PYSIDE2 = false
169+ PYQT6 = false
170+ PYSIDE6 = false
171+ ```
172+
173+ ** Note** : These configurations are necessary for the correct usage of the default VSCode's type
174+ checking feature while using QtPy in your source code.
175+
176+
177+ ## Testing matrix
178+
179+ Currently, QtPy runs tests for different bindings on Linux, Windows and macOS, using
180+ Python 3.7 and 3.11, and installing those bindings with ` conda ` and ` pip ` . For the
181+ PyQt bindings, we also check the installation of extra packages via ` pip ` .
182+
183+ Following this, the current test matrix looks something like this:
184+
185+ | | Python | 3.7 | | 3.11 | |
186+ | ---------| -----------------| --------------------------------------------| ------| --------------------| ----------------------------|
187+ | OS | Binding / manager | conda | pip | conda | pip |
188+ | Linux | PyQt5 | 5.12 | 5.15 | 5.15 | 5.15 (with extras) |
189+ | | PyQt6 | skip (unavailable) | 6.3 | skip (unavailable) | 6.5 (with extras) |
190+ | | PySide2 | 5.13 | 5.12 | 5.15 | skip (no wheels available) |
191+ | | PySide6 | 6.4 | 6.3 | 6.5 | 6.5 |
192+ | Windows | PyQt5 | 5.9 | 5.15 | 5.15 | 5.15 (with extras) |
193+ | | PyQt6 | skip (unavailable) | 6.2 | skip (unavailable) | 6.5 (with extras) |
194+ | | PySide2 | 5.13 | 5.12 | 5.15 | skip (no wheels available) |
195+ | | PySide6 | skip (test hang with 6.4. 6.5 unavailable) | 6.2 | 6.5 | 6.5 |
196+ | MacOS | PyQt5 | 5.12 | 5.15 | 5.15 | 5.15 (with extras) |
197+ | | PyQt6 | skip (unavailable) | 6.3 | skip (unavailable) | 6.5 (with extras) |
198+ | | PySide2 | 5.13 | 5.12 | 5.15 | skip (no wheels available) |
199+ | | PySide6 | 6.4 | 6.3 | 6.5 | 6.5 |
153200
154- These steps are necessary for running the default VSCode's type checking.
201+ ** Note ** : The mentioned extra packages for the PyQt bindings are the following:
155202
203+ * ` PyQt3D ` and ` PyQt6-3D `
204+ * ` PyQtChart ` and ` PyQt6-Charts `
205+ * ` PyQtDataVisualization ` and ` PyQt6-DataVisualization `
206+ * ` PyQtNetworkAuth ` and ` PyQt6-NetworkAuth `
207+ * ` PyQtPurchasing `
208+ * ` PyQtWebEngine ` and ` PyQt6-WebEngine `
209+ * ` QScintilla ` and ` PyQt6-QScintilla `
156210
157211## Contributing
158212
159- Everyone is welcome to contribute!
213+ Everyone is welcome to contribute! See our [ Contributing guide ] ( CONTRIBUTING.md ) for more details.
160214
161215
162216## Sponsors
0 commit comments