Skip to content

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

3 watching

Forks

Repository files navigation

mypy logo

Mypy stubs for the PyQt6 framework

This repository holds the stubs of the PyQt6 framework. The stubs are based on the stubs which are delivered with the PyQt6 package.

My work relies on the PyQt5-stubs and this is an intermediate solution until the PyQt5-stubs are ready for PyQt6. The idea of stub generation is based on this post of The-Compiler (python-qt-tools/PyQt5-stubs#6).

Please note that this work is far from complete. You can use the stubs to get rid of some annoying things that are present in the original stubs, nevertheless, other things which are fixed already in the PyQt5-stubs might still be present here.

Installation

WARNING: The Stubs are not yet on pypi

Clone the latest version from Github and install the stubs:

$ git clone https://github.com/TilmanK/PyQt6-stubs
$ cd PyQt6-stubs
$ pip install .

To opt into enforcement of any declared PyQt6 version compatibility constraints, select the pyqt6 extra from the cloned repository:

$ pip install ".[pyqt6]"

The extra currently declares no PyQt6 version bounds. Selecting it may also cause pip to install PyQt6 as a side effect of satisfying the dependency.

Generation of stubs

Stubs are generated by running generate_upstream.py. It will download the latest PyQt6 release, extract the stubs and rewrite them. Currently, the following changes are made:

  • Simple errors from mypy are fixed on the go (like adding ignore comments).
  • Obsolete annotations are removed.
  • All signals are fixed.
  • Custom fixes are applied.

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages