Accepting request 1247287 from devel:languages:python

- split test dependencies into a multibuild to break cycle
  with pytest

OBS-URL: https://build.opensuse.org/request/show/1247287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-MarkupSafe?expand=0&rev=32
This commit is contained in:
Ana Guerrero 2025-02-20 15:28:59 +00:00 committed by Git OBS Bridge
commit 4c155ad785
3 changed files with 26 additions and 2 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 20 08:14:24 UTC 2025 - Dirk Müller <dmueller@suse.com>
- split test dependencies into a multibuild to break cycle
with pytest
-------------------------------------------------------------------
Wed Dec 4 23:21:41 UTC 2024 - Matej Cepl <mcepl@cepl.eu>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-MarkupSafe
#
# 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,9 +16,16 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -%{flavor}
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-MarkupSafe
Name: python-MarkupSafe%{psuffix}
Version: 2.1.5
Release: 0
Summary: Implements a XML/HTML/XHTML Markup safe string for Python
@ -28,11 +35,13 @@ URL: https://github.com/pallets/markupsafe
Source: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-base >= 3.6
%if %{with test}
BuildRequires: %{python_module MarkupSafe >= %{version}}
BuildRequires: %{python_module pytest}
%endif
%python_subpackages
@ -48,23 +57,29 @@ safely encode strings for dynamically generated web pages.
sed -i -e '/^python_requires =/s/3\.7/3\.6/' setup.cfg
%build
%if !%{with test}
export CFLAGS="%{optflags}"
%pyproject_wheel
%endif
%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%python_expand rm %{buildroot}%{$python_sitearch}/markupsafe/_speedups.c
%endif
%if %{with test}
%check
%pytest_arch
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE.rst
%doc README.rst docs/
%{python_sitearch}/markupsafe/
%{python_sitearch}/MarkupSafe-%{version}.dist-info
%endif
%changelog