%global pypi_name pyqtdarktheme Name: python-%{pypi_name} Version: 2.1.0 Release: 2%{?dist} Summary: Flat dark theme for PySide and PyQt License: MIT URL: https://github.com/5yutan5/PyQtDarkTheme Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel # qdarktheme imports a Qt binding at import time; %check uses PySide6 offscreen BuildRequires: python3dist(pyside6) %global _description %{expand: PyQtDarkTheme applies a flat dark (or light) theme to Qt for Python applications. datalad-gooey uses it.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} # Useless without one of the Qt bindings it supports Requires: (python3dist(pyside6) or python3dist(pyqt6) or python3dist(pyqt5) or python3dist(pyside2)) %description -n python3-%{pypi_name} %{_description} %prep %autosetup -p1 -n pyqtdarktheme-%{version} # Upstream (archived in 2023) caps Python <3.12 and darkdetect <0.8. Neither cap is # needed: %check loads the stylesheets on this Python with this darkdetect. sed -i -E 's/^python = ">=3.7,<3.12"/python = ">=3.7"/; s/^darkdetect = "\^0.7.1"/darkdetect = ">=0.7.1"/' pyproject.toml grep -q '^python = ">=3.7"$' pyproject.toml grep -q '^darkdetect = ">=0.7.1"$' pyproject.toml sed -i -E 's/^Requires-Python: .*/Requires-Python: >=3.7/' PKG-INFO %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # Build helpers some DataLad-template projects install at top level; not part of the package. rm -rf %{buildroot}%{python3_sitelib}/_datalad_buildsupport %{buildroot}%{python3_sitelib}/tools %{buildroot}%{python3_sitelib}/benchmarks %{buildroot}%{python3_sitelib}/tests %{buildroot}%{python3_sitelib}/tests.py # Old setup.py data_files can drop these at the top of site-packages (osfclient does). rm -f %{buildroot}%{python3_sitelib}/{LICENSE,VERSION,requirements.txt} %pyproject_save_files -L qdarktheme %check export QT_QPA_PLATFORM=offscreen %pyproject_check_import -e 'qdarktheme.tests*' -e 'qdarktheme.*.tests*' -e '*.test_*' -e '*.conftest' -e '*.pytest_plugin' %{py3_test_envvars} %{python3} - <<'EOF' from PySide6.QtWidgets import QApplication app = QApplication([]) import qdarktheme for theme in ('dark', 'light'): s = qdarktheme.load_stylesheet(theme) assert len(s) > 1000, (theme, len(s)) print(theme, 'stylesheet', len(s)) EOF %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE.txt %changelog * Mon Oct 12 2026 Morgan Hough - 2.1.0-2 - BuildRequires PySide6 and Requires a Qt binding; %check creates a QApplication. * Mon Oct 12 2026 Morgan Hough - 2.1.0-1 - Initial package, for the DataLad extension stack and dandi.