diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..fcc7b97
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ test
+
diff --git a/python-MarkupSafe.changes b/python-MarkupSafe.changes
index 3b4dbdc..e27c674 100644
--- a/python-MarkupSafe.changes
+++ b/python-MarkupSafe.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Thu Feb 20 08:14:24 UTC 2025 - Dirk Müller
+
+- split test dependencies into a multibuild to break cycle
+ with pytest
+
-------------------------------------------------------------------
Wed Dec 4 23:21:41 UTC 2024 - Matej Cepl
diff --git a/python-MarkupSafe.spec b/python-MarkupSafe.spec
index 8f31778..17e4a5e 100644
--- a/python-MarkupSafe.spec
+++ b/python-MarkupSafe.spec
@@ -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