2017-05-03 15:15:28 +00:00
|
|
|
#
|
2024-11-10 21:36:51 +00:00
|
|
|
# spec file for package python-QtPy
|
2017-05-03 15:15:28 +00:00
|
|
|
#
|
2025-02-19 14:19:29 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2017-05-03 15:15:28 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
2018-12-04 13:58:14 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
|
#
|
2017-05-03 15:15:28 +00:00
|
|
|
|
|
|
|
|
|
2022-04-11 09:31:42 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
|
%define psuffix -test
|
|
|
|
|
%bcond_without test
|
|
|
|
|
%else
|
|
|
|
|
%define psuffix %{nil}
|
|
|
|
|
%bcond_with test
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%endif
|
2022-08-19 06:48:25 +00:00
|
|
|
%bcond_without pyqt5
|
2022-04-10 21:49:55 +00:00
|
|
|
%bcond_without pyqt6
|
2022-08-19 06:48:25 +00:00
|
|
|
%ifnarch %power64 s390x
|
|
|
|
|
%bcond_without pyside2
|
2022-08-17 15:13:27 +00:00
|
|
|
%bcond_without pyside6
|
2025-08-12 12:17:38 +02:00
|
|
|
%else
|
|
|
|
|
%bcond_with pyside2
|
|
|
|
|
%bcond_with pyside6
|
2022-08-19 06:48:25 +00:00
|
|
|
%endif
|
2024-04-19 22:14:14 +00:00
|
|
|
# make sure using pytest-3.11 on Leap 15.6
|
|
|
|
|
%if 0%{?suse_version} == 1500 && 0%{?sle_version} > 150500
|
|
|
|
|
%define python3_bin_suffix 3.11
|
|
|
|
|
%endif
|
2023-06-11 07:52:26 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-04-11 09:31:42 +00:00
|
|
|
Name: python-QtPy%{psuffix}
|
2025-02-19 14:19:29 +00:00
|
|
|
Version: 2.4.3
|
2017-05-03 15:15:28 +00:00
|
|
|
Release: 0
|
|
|
|
|
Summary: Abstraction layer on top of Qt bindings
|
2018-12-04 13:58:14 +00:00
|
|
|
License: MIT
|
2017-05-03 15:15:28 +00:00
|
|
|
Group: Development/Languages/Python
|
2019-03-06 10:27:11 +00:00
|
|
|
URL: https://github.com/spyder-ide/qtpy
|
2024-11-10 21:36:51 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/Q/QtPy/qtpy-%{version}.tar.gz
|
2023-11-21 13:40:17 +00:00
|
|
|
# from https://github.com/spyder-ide/qtpy/pull/466
|
|
|
|
|
Patch1: qt6.6-deprecations.patch
|
2022-06-04 08:55:00 +00:00
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
2022-04-10 21:49:55 +00:00
|
|
|
BuildRequires: %{python_module packaging}
|
2023-09-25 07:25:17 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2018-12-04 13:58:14 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2023-09-25 07:25:17 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2018-05-31 19:33:23 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2022-04-10 21:49:55 +00:00
|
|
|
Requires: python-packaging
|
2022-06-04 08:55:00 +00:00
|
|
|
Requires(post): update-alternatives
|
2024-11-10 21:36:51 +00:00
|
|
|
Requires(postun): update-alternatives
|
2022-06-04 08:55:00 +00:00
|
|
|
# Note: Don't add any Requires, Recommends, or Suggests for a
|
|
|
|
|
# specific backend here, because we need to minimize the space
|
|
|
|
|
# occupied on the Tumbleweed DVD. The application importing QtPy
|
|
|
|
|
# will have to know what backend to recommend and what extras to
|
|
|
|
|
# require (e.g. qtwebengine). Note that setup.py does not declare
|
|
|
|
|
# any requirements, in this regard either.
|
2022-04-11 09:31:42 +00:00
|
|
|
%if %{with test}
|
Accepting request 1036979 from home:bnavigator:branches:devel:languages:python
- Update to 2.3.0
* PR 382 - PR: Add QtPdf and QtPdfWidgets, by @jschueller (381)
* PR 380 - PR: Enable more qt6 tests, by @jschueller
* PR 379 - PR: Raise error when no bindings are found at
__init__, by @dalthviz (367)
* PR 378 - PR: Try PySide6 on conda, by @jschueller
* PR 376 - PR: Expand the CI test matrix with Qt/bindings 6.4 and
fix tests with PyQt 5.9, by @CAM-Gerlach (375)
* PR 374 - Don't re-assign Qt.MouseButton.MiddleButton on
PySide6, by @astrofrog (373)
* PR 372 - PR: Add Qsci to the imports, by @dgoeries (134)
- Release 2.2.1
* PR 368 - PR: Add missing self for QtBindingsNotFoundError
definition, by @dalthviz
* PR 366 - PR: Aliased QUndoCommand, provided
QLineEdit.getTextMargins() and QFontMetricsF.width(), by
@random-developer (365)
* PR 363 - PR: Fix typo in Qt flags in Readme, by @Czaki
* PR 362 - PR: Fix various minor typos found with Codespell, by
@luzpaz
* PR 361 - PR: toPython helpers for QDate and QTime, by
@bob-schumaker
* PR 360 - CI: Ensure conda-forge channel usage when testing with
conda, by @dalthviz
OBS-URL: https://build.opensuse.org/request/show/1036979
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-QtPy?expand=0&rev=41
2022-11-20 21:42:40 +00:00
|
|
|
BuildRequires: %{python_module QtPy-test = %{version}}
|
2022-04-10 21:49:55 +00:00
|
|
|
BuildRequires: %{python_module pytest >= 6}
|
2024-11-10 21:36:51 +00:00
|
|
|
BuildRequires: %{python_module pytest-cov}
|
2022-04-10 21:49:55 +00:00
|
|
|
BuildRequires: %{python_module pytest-qt}
|
2022-04-11 09:31:42 +00:00
|
|
|
%if %{with pyqt5}
|
2021-08-18 09:54:49 +00:00
|
|
|
BuildRequires: %{python_module qt3d-qt5}
|
|
|
|
|
BuildRequires: %{python_module qt5}
|
|
|
|
|
BuildRequires: %{python_module qtcharts-qt5}
|
|
|
|
|
BuildRequires: %{python_module qtdatavis3d-qt5}
|
2022-04-11 09:31:42 +00:00
|
|
|
%ifnarch %{power64} s390x
|
2021-08-18 09:54:49 +00:00
|
|
|
BuildRequires: %{python_module qtwebengine-qt5}
|
2022-04-11 09:31:42 +00:00
|
|
|
%endif
|
|
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
%if %{with pyqt6}
|
|
|
|
|
BuildRequires: %{python_module PyQt6-3D}
|
|
|
|
|
BuildRequires: %{python_module PyQt6-Charts}
|
|
|
|
|
BuildRequires: %{python_module PyQt6-DataVisualization}
|
|
|
|
|
BuildRequires: %{python_module PyQt6}
|
|
|
|
|
BuildRequires: qt6-sql-sqlite
|
2022-04-11 09:31:42 +00:00
|
|
|
%ifnarch %{ix86} %{arm} %{power64} s390x
|
|
|
|
|
# QtWebEngine 6.3.0 ceased support for 32-bit
|
|
|
|
|
BuildRequires: %{python_module PyQt6-WebEngine}
|
|
|
|
|
%endif
|
|
|
|
|
%endif
|
2022-08-19 06:48:25 +00:00
|
|
|
%if %{with pyside2}
|
2025-08-12 12:17:38 +02:00
|
|
|
%if 0%{?suse_version} == 1500 && 0%{?sle_version} > 150500
|
2024-04-19 22:14:14 +00:00
|
|
|
BuildRequires: %{python_module pyside2}
|
2025-08-12 12:17:38 +02:00
|
|
|
%else
|
|
|
|
|
BuildRequires: python3-pyside2
|
|
|
|
|
%endif
|
2024-04-19 22:14:14 +00:00
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
%if %{with pyside6}
|
2024-04-19 22:14:14 +00:00
|
|
|
%if 0%{?suse_version} == 1500 && 0%{?sle_version} > 150500
|
|
|
|
|
BuildRequires: %{python_module pyside6}
|
|
|
|
|
%else
|
2024-11-10 21:36:51 +00:00
|
|
|
BuildRequires: python3-pyside6 > 6.8.0
|
2024-04-19 22:14:14 +00:00
|
|
|
%endif
|
2022-04-11 09:31:42 +00:00
|
|
|
BuildRequires: qt6-sql-sqlite
|
|
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
%endif
|
2017-05-03 15:15:28 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
2021-08-18 09:54:49 +00:00
|
|
|
QtPy is a small abstraction layer that lets you
|
|
|
|
|
write applications using a single API call to either PyQt or PySide.
|
2017-05-03 15:15:28 +00:00
|
|
|
|
2022-06-04 08:55:00 +00:00
|
|
|
It provides support for PyQt5, PyQt6, PySide6, PySide2 using the Qt5
|
|
|
|
|
layout (where the QtGui module has been split into QtGui and QtWidgets).
|
|
|
|
|
Basically, you can write your code as if you were using PyQt or PySide
|
|
|
|
|
directly, but import Qt modules from qtpy instead of PyQt5, PySide2,
|
|
|
|
|
PyQt6 or PySide6.
|
2017-05-03 15:15:28 +00:00
|
|
|
|
Accepting request 1036979 from home:bnavigator:branches:devel:languages:python
- Update to 2.3.0
* PR 382 - PR: Add QtPdf and QtPdfWidgets, by @jschueller (381)
* PR 380 - PR: Enable more qt6 tests, by @jschueller
* PR 379 - PR: Raise error when no bindings are found at
__init__, by @dalthviz (367)
* PR 378 - PR: Try PySide6 on conda, by @jschueller
* PR 376 - PR: Expand the CI test matrix with Qt/bindings 6.4 and
fix tests with PyQt 5.9, by @CAM-Gerlach (375)
* PR 374 - Don't re-assign Qt.MouseButton.MiddleButton on
PySide6, by @astrofrog (373)
* PR 372 - PR: Add Qsci to the imports, by @dgoeries (134)
- Release 2.2.1
* PR 368 - PR: Add missing self for QtBindingsNotFoundError
definition, by @dalthviz
* PR 366 - PR: Aliased QUndoCommand, provided
QLineEdit.getTextMargins() and QFontMetricsF.width(), by
@random-developer (365)
* PR 363 - PR: Fix typo in Qt flags in Readme, by @Czaki
* PR 362 - PR: Fix various minor typos found with Codespell, by
@luzpaz
* PR 361 - PR: toPython helpers for QDate and QTime, by
@bob-schumaker
* PR 360 - CI: Ensure conda-forge channel usage when testing with
conda, by @dalthviz
OBS-URL: https://build.opensuse.org/request/show/1036979
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-QtPy?expand=0&rev=41
2022-11-20 21:42:40 +00:00
|
|
|
%package test
|
|
|
|
|
Summary: The qtpy.tests module
|
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
|
|
|
|
|
|
%description test
|
|
|
|
|
QtPy is a small abstraction layer that lets you
|
|
|
|
|
write applications using a single API call to either PyQt or PySide.
|
|
|
|
|
|
|
|
|
|
This subpackage separately provides the qtpy.tests module
|
|
|
|
|
in order to avoid stupid rpmlint errors.
|
|
|
|
|
|
2017-05-03 15:15:28 +00:00
|
|
|
%prep
|
2024-11-10 21:36:51 +00:00
|
|
|
%autosetup -p1 -n qtpy-%{version}
|
2021-08-18 09:54:49 +00:00
|
|
|
# wrong EOL encondig
|
|
|
|
|
sed -i 's/\r$//' LICENSE.txt *.md
|
2022-04-10 21:49:55 +00:00
|
|
|
# qtcharts is present in our PyQt
|
2021-08-18 09:54:49 +00:00
|
|
|
sed -i '/skipif.*not PYSIDE2/ d' qtpy/tests/test_qtcharts.py
|
2022-08-19 06:48:25 +00:00
|
|
|
sed -i '/addopts/ {s/--cov=.*//; s/--color=yes//}' pytest.ini
|
2017-05-03 15:15:28 +00:00
|
|
|
|
|
|
|
|
%build
|
2023-09-25 07:25:17 +00:00
|
|
|
%if ! %{with test}
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
%endif
|
2017-05-03 15:15:28 +00:00
|
|
|
|
|
|
|
|
%install
|
2022-04-11 09:31:42 +00:00
|
|
|
%if ! %{with test}
|
2023-09-25 07:25:17 +00:00
|
|
|
%pyproject_install
|
2022-06-04 08:55:00 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/qtpy
|
2020-08-28 15:30:34 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2022-04-11 09:31:42 +00:00
|
|
|
%endif
|
2017-05-03 15:15:28 +00:00
|
|
|
|
|
|
|
|
%check
|
2022-04-11 09:31:42 +00:00
|
|
|
%if %{with test}
|
2018-05-31 19:33:23 +00:00
|
|
|
export QT_HASH_SEED=0
|
2022-04-10 21:49:55 +00:00
|
|
|
export QT_QPA_PLATFORM="offscreen"
|
2018-05-31 19:33:23 +00:00
|
|
|
mkdir empty
|
|
|
|
|
pushd empty
|
2022-06-04 08:55:00 +00:00
|
|
|
# expects an unset FORCE_QT_API
|
|
|
|
|
donttest_qt_api="test_qt_api_environ"
|
2023-09-25 07:25:17 +00:00
|
|
|
# too wide in our setup (and upstream doesn't care: https://github.com/spyder-ide/qtpy/issues/371)
|
|
|
|
|
donttest=" or test_qfontmetrics_width"
|
2022-04-11 09:31:42 +00:00
|
|
|
%ifarch %{arm} aarch64
|
|
|
|
|
# no QtOpenGL for these platforms
|
2023-09-25 07:25:17 +00:00
|
|
|
donttest+=" or test_qtopengl"
|
2022-04-11 09:31:42 +00:00
|
|
|
%endif
|
|
|
|
|
%if %{with pyqt5}
|
2022-04-10 21:49:55 +00:00
|
|
|
# no QtSensors in our PyQt5
|
|
|
|
|
donttest_pyqt5=" or test_qtsensors"
|
2022-04-11 09:31:42 +00:00
|
|
|
%ifarch %{power64} s390x
|
|
|
|
|
# No QtWebengine on ppc and s390x
|
|
|
|
|
donttest_pyqt5="${donttest_pyqt5} or test_qtwebengine or test_qt_api"
|
|
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
export QT_API=pyqt5 FORCE_QT_API=1
|
2022-06-04 08:55:00 +00:00
|
|
|
%pytest -rwEfs -v ../qtpy -k "not ($donttest_qt_api $donttest $donttest_pyqt5)"
|
2022-04-11 09:31:42 +00:00
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
%if %{with pyqt6}
|
2022-04-11 09:31:42 +00:00
|
|
|
%ifarch %{ix86} %{arm} %{power64} s390x
|
|
|
|
|
# QtWebEngine 6.3.0 ceased support for 32-bit
|
2022-08-19 06:48:25 +00:00
|
|
|
# No QtWebengine on ppc and s390x
|
2022-04-11 09:31:42 +00:00
|
|
|
donttest_pyqt6=" or test_qtwebengine"
|
|
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
export QT_API=pyqt6 FORCE_QT_API=1
|
2022-06-04 08:55:00 +00:00
|
|
|
%pytest -rwEfs -v ../qtpy -k "not ($donttest_qt_api $donttest $donttest_pyqt6)"
|
2022-04-10 21:49:55 +00:00
|
|
|
%endif
|
2022-08-19 06:48:25 +00:00
|
|
|
%if %{with pyside2}
|
|
|
|
|
export QT_API=pyside2 FORCE_QT_API=1
|
|
|
|
|
pytest-%{python3_bin_suffix} -rwEfs -v ../qtpy -k "not ($donttest_qt_api $donttest)"
|
|
|
|
|
%endif
|
2022-04-10 21:49:55 +00:00
|
|
|
%if %{with pyside6}
|
2023-09-25 07:25:17 +00:00
|
|
|
# no pyside6-uic
|
|
|
|
|
donttest_pyside6=" or test_load_ui_type"
|
2022-04-10 21:49:55 +00:00
|
|
|
export QT_API=pyside6 FORCE_QT_API=1
|
2023-09-25 07:25:17 +00:00
|
|
|
pytest-%{python3_bin_suffix} -rwEfs -v ../qtpy -k "not ($donttest_qt_api $donttest $donttest_pyside6)"
|
2022-04-10 21:49:55 +00:00
|
|
|
%endif
|
2022-06-04 08:55:00 +00:00
|
|
|
# Default backend
|
|
|
|
|
unset QT_API
|
|
|
|
|
unset FORCE_QT_API
|
|
|
|
|
%pytest -rwEfs -vvv ../qtpy -k "not (dummyprefix $donttest $donttest_pyqt5)"
|
2018-05-31 19:33:23 +00:00
|
|
|
popd
|
2022-04-11 09:31:42 +00:00
|
|
|
%endif
|
2017-05-03 15:15:28 +00:00
|
|
|
|
2022-06-04 08:55:00 +00:00
|
|
|
%post
|
|
|
|
|
%python_install_alternative qtpy
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative qtpy
|
|
|
|
|
|
2022-04-11 09:31:42 +00:00
|
|
|
%if ! %{with test}
|
2017-05-03 15:15:28 +00:00
|
|
|
%files %{python_files}
|
2018-05-31 19:33:23 +00:00
|
|
|
%doc AUTHORS.md CHANGELOG.md README.md
|
|
|
|
|
%license LICENSE.txt
|
2020-08-28 15:30:34 +00:00
|
|
|
%{python_sitelib}/qtpy
|
Accepting request 1036979 from home:bnavigator:branches:devel:languages:python
- Update to 2.3.0
* PR 382 - PR: Add QtPdf and QtPdfWidgets, by @jschueller (381)
* PR 380 - PR: Enable more qt6 tests, by @jschueller
* PR 379 - PR: Raise error when no bindings are found at
__init__, by @dalthviz (367)
* PR 378 - PR: Try PySide6 on conda, by @jschueller
* PR 376 - PR: Expand the CI test matrix with Qt/bindings 6.4 and
fix tests with PyQt 5.9, by @CAM-Gerlach (375)
* PR 374 - Don't re-assign Qt.MouseButton.MiddleButton on
PySide6, by @astrofrog (373)
* PR 372 - PR: Add Qsci to the imports, by @dgoeries (134)
- Release 2.2.1
* PR 368 - PR: Add missing self for QtBindingsNotFoundError
definition, by @dalthviz
* PR 366 - PR: Aliased QUndoCommand, provided
QLineEdit.getTextMargins() and QFontMetricsF.width(), by
@random-developer (365)
* PR 363 - PR: Fix typo in Qt flags in Readme, by @Czaki
* PR 362 - PR: Fix various minor typos found with Codespell, by
@luzpaz
* PR 361 - PR: toPython helpers for QDate and QTime, by
@bob-schumaker
* PR 360 - CI: Ensure conda-forge channel usage when testing with
conda, by @dalthviz
OBS-URL: https://build.opensuse.org/request/show/1036979
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-QtPy?expand=0&rev=41
2022-11-20 21:42:40 +00:00
|
|
|
%exclude %{python_sitelib}/qtpy/tests
|
2025-08-12 12:17:38 +02:00
|
|
|
%{python_sitelib}/[Qq]t[Pp]y-%{version}.dist-info
|
2022-06-04 08:55:00 +00:00
|
|
|
%python_alternative %{_bindir}/qtpy
|
Accepting request 1036979 from home:bnavigator:branches:devel:languages:python
- Update to 2.3.0
* PR 382 - PR: Add QtPdf and QtPdfWidgets, by @jschueller (381)
* PR 380 - PR: Enable more qt6 tests, by @jschueller
* PR 379 - PR: Raise error when no bindings are found at
__init__, by @dalthviz (367)
* PR 378 - PR: Try PySide6 on conda, by @jschueller
* PR 376 - PR: Expand the CI test matrix with Qt/bindings 6.4 and
fix tests with PyQt 5.9, by @CAM-Gerlach (375)
* PR 374 - Don't re-assign Qt.MouseButton.MiddleButton on
PySide6, by @astrofrog (373)
* PR 372 - PR: Add Qsci to the imports, by @dgoeries (134)
- Release 2.2.1
* PR 368 - PR: Add missing self for QtBindingsNotFoundError
definition, by @dalthviz
* PR 366 - PR: Aliased QUndoCommand, provided
QLineEdit.getTextMargins() and QFontMetricsF.width(), by
@random-developer (365)
* PR 363 - PR: Fix typo in Qt flags in Readme, by @Czaki
* PR 362 - PR: Fix various minor typos found with Codespell, by
@luzpaz
* PR 361 - PR: toPython helpers for QDate and QTime, by
@bob-schumaker
* PR 360 - CI: Ensure conda-forge channel usage when testing with
conda, by @dalthviz
OBS-URL: https://build.opensuse.org/request/show/1036979
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-QtPy?expand=0&rev=41
2022-11-20 21:42:40 +00:00
|
|
|
|
|
|
|
|
%files %{python_files test}
|
|
|
|
|
%license LICENSE.txt
|
|
|
|
|
%{python_sitelib}/qtpy/tests
|
2022-04-11 09:31:42 +00:00
|
|
|
%endif
|
2017-05-03 15:15:28 +00:00
|
|
|
|
|
|
|
|
%changelog
|