From 93b911f259ec80b02491462b2fae0fbd4e1a63d8d81e3dfbb423000192ea392f Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 12 Mar 2024 00:25:08 +0000 Subject: [PATCH] - Sprinkle in multibuild to avoid build cycles. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-core?expand=0&rev=4 --- _multibuild | 3 +++ python-pydantic-core.changes | 5 +++++ python-pydantic-core.spec | 24 ++++++++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 _multibuild 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-pydantic-core.changes b/python-pydantic-core.changes index f77d777..3cea4c8 100644 --- a/python-pydantic-core.changes +++ b/python-pydantic-core.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 12 00:24:28 UTC 2024 - Steve Kowalik + +- Sprinkle in multibuild to avoid build cycles. + ------------------------------------------------------------------- Sat Mar 9 13:15:13 UTC 2024 - ecsos diff --git a/python-pydantic-core.spec b/python-pydantic-core.spec index 6d05e14..ed8b451 100644 --- a/python-pydantic-core.spec +++ b/python-pydantic-core.spec @@ -16,8 +16,16 @@ # +%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-pydantic-core +Name: python-pydantic-core%{psuffix} Version: 2.16.3 Release: 0 Summary: Core functionality for pydantic validation and serialization @@ -31,12 +39,15 @@ BuildRequires: %{python_module typing-extensions >= 4.6.0} BuildRequires: cargo-packaging BuildRequires: python-rpm-macros # SECTION test requirements -BuildRequires: %{python_module pytest} +%if %{with test} BuildRequires: %{python_module dirty-equals} BuildRequires: %{python_module hypothesis} +BuildRequires: %{python_module pydantic-core == %{version}} BuildRequires: %{python_module pytest-benchmark} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest-timeout} +BuildRequires: %{python_module pytest} +%endif # /SECTION BuildRequires: fdupes Requires: python-typing-extensions >= 4.6.0 @@ -51,17 +62,26 @@ Pydantic-core is currently around 17x faster than pydantic V1. %autosetup -p1 -n pydantic_core-%{version} -a1 %build +# The build takes quite a long time, so we don't want to build this while under test. +%if %{without test} %pyproject_wheel +%endif %install +%if %{without test} %pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} +%endif %check +%if %{with test} %pytest_arch +%endif +%if %{without test} %files %{python_files} %{python_sitearch}/pydantic_core %{python_sitearch}/pydantic_core-%{version}.dist-info +%endif %changelog