From 1982144e22f33b58fa2e69ce6ed9ec67fbf55120 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 23 Oct 2026 10:40:28 -0400 Subject: [PATCH 1/2] Add a pyqt5 extra to install PyQt5 --- CHANGELOG.md | 1 + README.md | 6 +++++- setup.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9e2c8c8..4e1675f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## To be released ### Added +* Add a `pyqt5` extra to optionally install PyQt5 alongside the stubs. * [#192](https://github.com/python-qt-tools/PyQt5-stubs/pull/192) Add missing platform specific stubs: * Windows specific: QAxContainer.pyi QtWinExtras.pyi QtCore.QWinEventNotifier * MacOs X specific: QtMacExtras.pyi QtWidgets.QMacCocoaViewContainer diff --git a/README.md b/README.md index 4b9548d6..49ed31f9 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,14 @@ appreciate any PRs or Issues that help making this stub-repository more reliable # Installation -Simply install PyQt5-stubs with pip: +Install the stubs without installing PyQt5: $ pip install PyQt5-stubs +To also install the PyQt5 binding, use the `pyqt5` extra: + + $ pip install "PyQt5-stubs[pyqt5]" + Or clone the latest version from Github and install it via Python setuptools: $ git clone https://github.com/python-qt-tools/PyQt5-stubs diff --git a/setup.py b/setup.py index 579928e6..4572efba 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ def find_version(*file_paths): package_data={"PyQt5-stubs": ['*.pyi']}, packages=["PyQt5-stubs"], extras_require={ + "pyqt5": ["PyQt5"], "dev": ["mypy==0.930", "pytest", "pytest-xvfb"], }, classifiers=[ From d2a4a3ed1f8326f7836362ac311264953793ee89 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 23 Oct 2026 10:59:23 -0400 Subject: [PATCH 2/2] Explain extras as optional compatibility constraint enforcement --- CHANGELOG.md | 2 +- README.md | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1675f6..c560be63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## To be released ### Added -* Add a `pyqt5` extra to optionally install PyQt5 alongside the stubs. +* Add a `pyqt5` extra for optional PyQt5 version compatibility constraints. * [#192](https://github.com/python-qt-tools/PyQt5-stubs/pull/192) Add missing platform specific stubs: * Windows specific: QAxContainer.pyi QtWinExtras.pyi QtCore.QWinEventNotifier * MacOs X specific: QtMacExtras.pyi QtWidgets.QMacCocoaViewContainer diff --git a/README.md b/README.md index 49ed31f9..cf1013d7 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,18 @@ appreciate any PRs or Issues that help making this stub-repository more reliable # Installation -Install the stubs without installing PyQt5: +Install the stubs with pip: $ pip install PyQt5-stubs -To also install the PyQt5 binding, use the `pyqt5` extra: +To opt into enforcement of any declared PyQt5 version compatibility constraints, +select the `pyqt5` extra: $ pip install "PyQt5-stubs[pyqt5]" +The extra currently declares no PyQt5 version bounds. Selecting it may also +cause pip to install PyQt5 as a side effect of satisfying the dependency. + Or clone the latest version from Github and install it via Python setuptools: $ git clone https://github.com/python-qt-tools/PyQt5-stubs