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-sqlmodel.changes b/python-sqlmodel.changes
index 10734bf..a171e4e 100644
--- a/python-sqlmodel.changes
+++ b/python-sqlmodel.changes
@@ -1,4 +1,9 @@
+-------------------------------------------------------------------
+Tue Oct 29 08:06:12 UTC 2024 - Dirk Müller
+
+- fix buildcycle with fastapi
+
-------------------------------------------------------------------
Tue Sep 17 13:21:38 UTC 2024 - Aline Werner
-- Initial package for v0.0.22.
+- Initial package for v0.0.22.
diff --git a/python-sqlmodel.spec b/python-sqlmodel.spec
index b5eba0f..3278810 100644
--- a/python-sqlmodel.spec
+++ b/python-sqlmodel.spec
@@ -16,39 +16,49 @@
#
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
%{?sle15_python_module_pythons}
-Name: python-sqlmodel
+Name: python-sqlmodel%{psuffix}
Version: 0.0.22
Release: 0
Summary: SQL databases in Python, designed for simplicity, compatibility, and robustness
License: MIT
URL: https://github.com/fastapi/sqlmodel
Source: https://files.pythonhosted.org/packages/source/s/sqlmodel/sqlmodel-%{version}.tar.gz
-BuildRequires: python-rpm-macros
-BuildRequires: %{python_module pip}
-BuildRequires: %{python_module setuptools}
-BuildRequires: %{python_module pdm-backend}
-BuildRequires: %{python_module pydantic >= 1.10.13}
BuildRequires: %{python_module SQLAlchemy >= 2.0.14}
+BuildRequires: %{python_module pdm-backend}
+BuildRequires: %{python_module pip}
+BuildRequires: %{python_module pydantic >= 1.10.13}
+BuildRequires: %{python_module setuptools}
+BuildRequires: fdupes
+BuildRequires: python-rpm-macros
+Requires: python-SQLAlchemy >= 2.0.14
+Requires: python-pydantic >= 1.10.13
+BuildArch: noarch
# SECTION test requirements
+%if %{with test}
+BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module black}
BuildRequires: %{python_module dirty-equals}
BuildRequires: %{python_module fastapi}
BuildRequires: %{python_module httpx}
-BuildRequires: %{python_module Jinja2}
-BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-cov}
+BuildRequires: %{python_module pytest}
+%endif
# /SECTION
-BuildRequires: fdupes
-Requires: python-pydantic >= 1.10.13
-Requires: python-SQLAlchemy >= 2.0.14
-BuildArch: noarch
%python_subpackages
%description
-SQLModel is a library for interacting with SQL databases from Python code,
-with Python objects. It is designed to be intuitive, easy to use, highly
-compatible, and robust. SQLModel is based on Python type annotations, and
+SQLModel is a library for interacting with SQL databases from Python code,
+with Python objects. It is designed to be intuitive, easy to use, highly
+compatible, and robust. SQLModel is based on Python type annotations, and
powered by Pydantic and SQLAlchemy.
%prep
@@ -58,12 +68,16 @@ powered by Pydantic and SQLAlchemy.
%pyproject_wheel
%install
+%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
export PYTHONPATH=$(pwd):$PYTHONPATH
%pytest -v tests
+%endif
%files %{python_files}
%doc README.md