From 315101b3edc95e657addb053429ac0f4fef4e183f1a48e57fa1c9d3a0fedb220 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 1 Oct 2024 10:24:01 +0000 Subject: [PATCH] - Make Django build-requirement conditional and disable by default for SUSE:SLFO:Main OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-diskcache?expand=0&rev=26 --- python-diskcache.changes | 6 ++++++ python-diskcache.spec | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/python-diskcache.changes b/python-diskcache.changes index a188876..a7c2697 100644 --- a/python-diskcache.changes +++ b/python-diskcache.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 1 10:19:39 UTC 2024 - Daniel Garcia + +- Make Django build-requirement conditional and disable by default for + SUSE:SLFO:Main + ------------------------------------------------------------------- Wed Sep 27 12:15:19 UTC 2023 - ecsos diff --git a/python-diskcache.spec b/python-diskcache.spec index 36e9ec8..f2a88da 100644 --- a/python-diskcache.spec +++ b/python-diskcache.spec @@ -1,7 +1,7 @@ # # spec file for package python-diskcache # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 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,13 @@ # +%if 0%{?suse_version} == 1600 +# No django in SLFO:Main +%bcond_with django +%else +%bcond_without django +%endif + %{?sle15_python_module_pythons} Name: python-diskcache Version: 5.6.3 @@ -30,8 +37,10 @@ BuildRequires: %{python_module setuptools} BuildRequires: %{pythons} BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with django} BuildRequires: %{python_module Django if (%python-base without python36-base)} BuildRequires: %{python_module pytest-django if (%python-base without python36-base)} +%endif Requires: python BuildArch: noarch %python_subpackages @@ -54,11 +63,15 @@ sed -i '/--cov/d' tox.ini %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +%if %{without django} +python_flags=("--ignore" "tests/test_doctest.py" "-k" "not README.rst") +%else # No python36-Django 4 on TW python36_flags=("--ignore" "tests/test_doctest.py" "-k" "not README.rst") +%endif # Broken since Django 3.2 -- https://github.com/grantjenks/python-diskcache/issues/210 donttest_djangocache="--ignore tests/test_djangocache.py" -%pytest "${$python_flags[@]}" ${donttest_djangocache} +%pytest "${$python_flags[@]}" "${python_flags[@]}" ${donttest_djangocache} %files %{python_files} %license LICENSE