From 0f00d2db7dd16f9174d23583176e91b3533e24a1845853681986cd7d5abefa58 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 29 Jan 2026 09:24:51 +0000 Subject: [PATCH 1/3] - Use %bcond_with macro for test flavor OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flit-core?expand=0&rev=54 --- python-flit-core.changes | 5 +++++ python-flit-core.spec | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/python-flit-core.changes b/python-flit-core.changes index 9adaf24..b18c7d0 100644 --- a/python-flit-core.changes +++ b/python-flit-core.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 29 09:13:15 UTC 2026 - Daniel Garcia + +- Use %bcond_with macro for test flavor + ------------------------------------------------------------------- Fri May 2 14:17:24 UTC 2025 - Nico Krapp diff --git a/python-flit-core.spec b/python-flit-core.spec index c7a1e42..46ca307 100644 --- a/python-flit-core.spec +++ b/python-flit-core.spec @@ -1,7 +1,7 @@ # # spec file for package python-flit-core # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,10 +24,12 @@ %if "%{flavor}" == "primary" %define pprefix %{primary_python} %define pythons %{primary_python} +%bcond_with test %endif # Additional flavors are built in Factory Ring1 %if "%{flavor}" == "" %define pprefix python +%bcond_with test %{expand:%%define skip_%{primary_python} 1} %if "%{shrink:%{pythons}}" == "" # Exclude for local osc build: unresolvable @@ -43,12 +45,14 @@ ExclusiveArch: do-not-build ExclusiveArch: do-not-build %else %define pprefix python +%bcond_with test %endif %endif # test everything in the buildset by standard python flavor expansion: primary and non-primary, if any. %if "%{flavor}" == "test" %define pprefix python %define psuffix -test +%bcond_without test %endif %{?sle15_python_module_pythons} Name: %{pprefix}-flit-core%{?psuffix} @@ -62,7 +66,7 @@ BuildRequires: %{python_module base >= 3.6} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch -%if "%{flavor}" == "test" +%if %{with test} BuildRequires: %{python_module flit-core = %{version}} BuildRequires: %{python_module packaging} BuildRequires: %{python_module pytest} @@ -90,7 +94,7 @@ The only public interface is the API specified by PEP 517, at flit_core.buildapi %prep %autosetup -p2 -n flit_core-%{version} -%if "%{flavor}" != "test" +%if !%{with test} %build # https://flit.readthedocs.io/en/latest/bootstrap.html, take the first available python in the build set mypython=%{expand:%%__%(echo %{pythons} | cut -d " " -f 1)} @@ -105,14 +109,14 @@ $python bootstrap_install.py dist/flit_core-%{version}-py3-none-any.whl -i %{bui %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif -%if "%{flavor}" == "test" +%if %{with test} %check # make sure we do not test the sources but the package rm flit_core/*.py pyproject.toml %pytest -rfEs %endif -%if "%{flavor}" != "test" +%if !%{with test} %files %{python_files} %{python_sitelib}/flit_core %{python_sitelib}/flit_core-%{version}.dist-info From 3e73ccb43ebb19454c4cb4b675f726886984da34ac52262d3b21a71b073b1f89 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 29 Jan 2026 09:40:30 +0000 Subject: [PATCH 2/3] Move flavor test bcond to the top OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flit-core?expand=0&rev=55 --- python-flit-core.spec | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/python-flit-core.spec b/python-flit-core.spec index 46ca307..d3e3b53 100644 --- a/python-flit-core.spec +++ b/python-flit-core.spec @@ -18,18 +18,26 @@ %define modname flit-core %global flavor @BUILD_FLAVOR@%{nil} + +# test everything in the buildset by standard python flavor expansion: primary and non-primary, if any. +%if "%{flavor}" == "test" +%define pprefix python +%define psuffix -test +%bcond_without test +%else +%bcond_with test +%endif + %define plainpython python %if 0%{?suse_version} >= 1550 # The primary python flavor is built in Factory Ring0 %if "%{flavor}" == "primary" %define pprefix %{primary_python} %define pythons %{primary_python} -%bcond_with test %endif # Additional flavors are built in Factory Ring1 %if "%{flavor}" == "" %define pprefix python -%bcond_with test %{expand:%%define skip_%{primary_python} 1} %if "%{shrink:%{pythons}}" == "" # Exclude for local osc build: unresolvable @@ -45,15 +53,8 @@ ExclusiveArch: do-not-build ExclusiveArch: do-not-build %else %define pprefix python -%bcond_with test %endif %endif -# test everything in the buildset by standard python flavor expansion: primary and non-primary, if any. -%if "%{flavor}" == "test" -%define pprefix python -%define psuffix -test -%bcond_without test -%endif %{?sle15_python_module_pythons} Name: %{pprefix}-flit-core%{?psuffix} Version: 3.12.0 From 31d30a46c0bcddbfafe875a099e74b25cf70bc174595c0aff8417a546438414c Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 29 Jan 2026 09:55:32 +0000 Subject: [PATCH 3/3] - Move flavor test back to the bottom - Do empty pythons list below macros that modifies it OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flit-core?expand=0&rev=56 --- python-flit-core.spec | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/python-flit-core.spec b/python-flit-core.spec index d3e3b53..8003ab5 100644 --- a/python-flit-core.spec +++ b/python-flit-core.spec @@ -18,16 +18,6 @@ %define modname flit-core %global flavor @BUILD_FLAVOR@%{nil} - -# test everything in the buildset by standard python flavor expansion: primary and non-primary, if any. -%if "%{flavor}" == "test" -%define pprefix python -%define psuffix -test -%bcond_without test -%else -%bcond_with test -%endif - %define plainpython python %if 0%{?suse_version} >= 1550 # The primary python flavor is built in Factory Ring0 @@ -39,12 +29,6 @@ %if "%{flavor}" == "" %define pprefix python %{expand:%%define skip_%{primary_python} 1} -%if "%{shrink:%{pythons}}" == "" -# Exclude for local osc build: unresolvable -%define python_module() empty-python-buildset -# Exclude for obs server -ExclusiveArch: do-not-build -%endif %endif %else # backport and option d projects for 15.X having one or more python in the buildset don't need the Ring split for bootstrap @@ -55,7 +39,25 @@ ExclusiveArch: do-not-build %define pprefix python %endif %endif + +# test everything in the buildset by standard python flavor expansion: primary and non-primary, if any. +%if "%{flavor}" == "test" +%define pprefix python +%define psuffix -test +%bcond_without test +%else +%bcond_with test +%endif + %{?sle15_python_module_pythons} + +%if "%{flavor}" == "" && "%{shrink:%{pythons}}" == "" +# Exclude for local osc build: unresolvable +%define python_module() empty-python-buildset +# Exclude for obs server +ExclusiveArch: do-not-build +%endif + Name: %{pprefix}-flit-core%{?psuffix} Version: 3.12.0 Release: 0