Accepting request 1204914 from devel:languages:python

- Make Django build-requirement conditional and disable by default for
  SUSE:SLFO:Main, bsc#1231124

OBS-URL: https://build.opensuse.org/request/show/1204914
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-semantic_version?expand=0&rev=13
This commit is contained in:
Ana Guerrero 2024-10-02 19:32:37 +00:00 committed by Git OBS Bridge
commit f9e9282431
2 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 1 10:35:31 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Make Django build-requirement conditional and disable by default for
SUSE:SLFO:Main, bsc#1231124
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Apr 21 12:33:45 UTC 2023 - Dirk Müller <dmueller@suse.com> Fri Apr 21 12:33:45 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file # spec file for package python-semantic_version
# #
# Copyright (c) 2023 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,6 +16,13 @@
# #
%if 0%{?suse_version} == 1600 || 0%{?suse_version} <= 1550
# No django in SLFO:Main
%bcond_with django
%else
%bcond_without django
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil} %global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test" %if "%{flavor}" == "test"
@ -40,7 +47,7 @@ BuildRequires: python-rpm-macros
BuildArch: noarch BuildArch: noarch
%if %{with test} %if %{with test}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
%if 0%{?suse_version} > 1550 %if %{with django}
# Django 4.0 dropped support for Python < 3.8 # Django 4.0 dropped support for Python < 3.8
BuildRequires: %{python_module Django >= 1.11 if (%python-base without python36-base)} BuildRequires: %{python_module Django >= 1.11 if (%python-base without python36-base)}
%endif %endif
@ -65,9 +72,14 @@ It follows strictly the 2.0.0 version of the SemVer scheme.
%if %{with test} %if %{with test}
%check %check
%if %{without django}
python_flags="--ignore tests/test_django.py"
%else
# Django 4.0 dropped support for Python < 3.8 # Django 4.0 dropped support for Python < 3.8
python36_flags="--ignore tests/test_django.py" python36_flags="--ignore tests/test_django.py"
%pytest ${$python_flags} %endif
%pytest ${$python_flags} ${python_flags}
%else %else