From 22e8fd24924c2a76b4db16e65974c43dd2215b7f Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 23 Oct 2026 10:40:40 -0400 Subject: [PATCH 1/2] Make PySide2 an optional dependency via the pyside2 extra --- CHANGELOG.md | 1 + README.md | 6 +++++- setup.cfg | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62c0559..7feaad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ To be released ============== +* Make PySide2 an optional dependency, installed with the `pyside2` extra. * remove `@staticmethod` applied to functions * fix `QTabBar.setButtonWidget()` to accept `None` as a widget argument * fix `QTreeWidget.setItemWidget()` and `QListWidget.setItemWidget()` to accept `None` as a widget argument diff --git a/README.md b/README.md index 69cb3d4..670f858 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,14 @@ As a derived work from PySide2, the stubs are delivered under the LGPL v2.1 . Se # Installation -Simply install the official PySide2-stubs with pip: +Install the stubs without installing PySide2: $ pip install PySide2-stubs +To also install the PySide2 binding, use the `pyside2` extra: + + $ pip install "PySide2-stubs[pyside2]" + Or use the latest version from Github: $ pip install git+https://github.com/python-qt-tools/PySide2-stubs diff --git a/setup.cfg b/setup.cfg index 8cd1a45..494caa2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,6 @@ package_dir = python_requires = >=3.6 install_requires = mypy>=0.940 - PySide2>=5.11.0 [options.package_data] * = *.pyi @@ -37,5 +36,7 @@ exclude = [options.extras_require] +pyside2 = + PySide2>=5.11.0 dev = pytest \ No newline at end of file From d4e74c83a70b7610bd5e295843b5f6f2f110391b Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 23 Oct 2026 10:59:24 -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 7feaad9..afc3525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ To be released ============== -* Make PySide2 an optional dependency, installed with the `pyside2` extra. +* Make the PySide2 version compatibility constraint optional through the `pyside2` extra. * remove `@staticmethod` applied to functions * fix `QTabBar.setButtonWidget()` to accept `None` as a widget argument * fix `QTreeWidget.setItemWidget()` and `QListWidget.setItemWidget()` to accept `None` as a widget argument diff --git a/README.md b/README.md index 670f858..e7822e2 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,18 @@ As a derived work from PySide2, the stubs are delivered under the LGPL v2.1 . Se # Installation -Install the stubs without installing PySide2: +Install the stubs with pip: $ pip install PySide2-stubs -To also install the PySide2 binding, use the `pyside2` extra: +To have the dependency resolver enforce the declared PySide2 version +compatibility constraints, select the `pyside2` extra: $ pip install "PySide2-stubs[pyside2]" +Selecting this extra may also cause pip to install or change PySide2 as a side +effect of satisfying those constraints. + Or use the latest version from Github: $ pip install git+https://github.com/python-qt-tools/PySide2-stubs