From 638d3461d3c29bd91982996f0b1b6d365f91d5dfb638c4793bc3e6d223badabd Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 9 Jan 2025 12:05:38 +0000 Subject: [PATCH] - Build doc package just for tumbleweed to remove pydata-sphinx-theme requirement OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=61 --- python-falcon.changes | 6 ++++++ python-falcon.spec | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/python-falcon.changes b/python-falcon.changes index 03bb72b..77e1a03 100644 --- a/python-falcon.changes +++ b/python-falcon.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 9 11:57:38 UTC 2025 - Daniel Garcia + +- Build doc package just for tumbleweed to remove + pydata-sphinx-theme requirement + ------------------------------------------------------------------- Tue Nov 12 10:49:26 UTC 2024 - John Paul Adrian Glaubitz diff --git a/python-falcon.spec b/python-falcon.spec index ea1d62b..fb4040c 100644 --- a/python-falcon.spec +++ b/python-falcon.spec @@ -1,7 +1,7 @@ # # spec file for package python-falcon # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1600 +%bcond_without doc +%else +%bcond_with doc +%endif + %{?sle15_python_module_pythons} Name: python-falcon Version: 4.0.2 @@ -31,7 +37,6 @@ BuildRequires: %{python_module ddt} BuildRequires: %{python_module httpx} BuildRequires: %{python_module myst-parser >= 2} BuildRequires: %{python_module pip} -BuildRequires: %{python_module pydata-sphinx-theme} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sphinx-design} BuildRequires: %{python_module sphinx-tabs} @@ -53,6 +58,9 @@ BuildRequires: %{python_module httpx if (%python-base without python36-base)} BuildRequires: %{python_module uvicorn if (%python-base without python36-base)} BuildRequires: %{python_module websockets if (%python-base without python36-base)} %endif +%if %{with doc} +BuildRequires: %{python_module pydata-sphinx-theme} +%endif # /SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -86,11 +94,14 @@ rm tests/test_media_handlers.py %build export CFLAGS="%{optflags} -fno-strict-aliasing" %pyproject_wheel + +%if %{with doc} export PYTHONPATH="$(pwd)" pushd docs make html rm _build/html/.buildinfo popd +%endif %install %pyproject_install @@ -98,9 +109,12 @@ popd %python_clone -a %{buildroot}%{_bindir}/falcon-inspect-app %python_clone -a %{buildroot}%{_bindir}/falcon-print-routes %python_expand %fdupes %{buildroot}%{$python_sitelib} + +%if %{with doc} mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-doc cp -ar docs/_build/html examples %{buildroot}%{_defaultdocdir}/%{name}-doc/ %fdupes %{buildroot}%{_defaultdocdir}/%{name}-doc/ +%endif %check export LANG=en_US.UTF8 @@ -121,7 +135,9 @@ export LANG=en_US.UTF8 %{python_sitelib}/falcon %{python_sitelib}/falcon-%{version}.dist-info +%if %{with doc} %files -n %{name}-doc %doc %{_defaultdocdir}/%{name}-doc +%endif %changelog