rpm-software-management / spec-cleaner

spec-cleaner
BSD 3-Clause "New" or "Revised" License
27 stars 33 forks source link

%{?sle15_python_module_pythons} is moved #308

Closed pgajdos closed 10 months ago

pgajdos commented 1 year ago

This macro is meant to be in preamble, spec-cleaner moves it somewhere below.

Index: python-munch.spec
===================================================================
--- python-munch.spec   (revision 7b3ff50000dadfc221eea7d0e22bdbec)
+++ python-munch.spec   (working copy)
@@ -16,7 +16,6 @@
 #

-%{?sle15_python_module_pythons}
 Name:           python-munch
 Version:        3.0.0
 Release:        0
@@ -33,6 +32,7 @@
 BuildRequires:  python-rpm-macros
 Requires:       python-six
 BuildArch:      noarch
+%{?sle15_python_module_pythons}
 # SECTION test requirements
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module six}
pgajdos commented 1 year ago

CC @kstreitova @mcepl

kstreitova commented 1 year ago

The reason for this behavior is # SECTION and # /SECTION code block that is treated on the same level as conditions.

The defined order of preamble elements is

<snip>
        'excludearch',
        'misc',
        'build_conditions',
        'conditions',
        'tail',
</snip>

So it means that we have misc (where %{?sle15_python_module_pythons} goes right now) before conditions (where `# SECTION goes).

Btw. the only tail macro is currently %{?python_subpackages} so that's why this macro is at the end of the preamble.

@mcepl What is the desired place for %{?sle15_python_module_pythons}? What about other python macros?

mcepl commented 1 year ago

@mcepl What is the desired place for %{?sle15_python_module_pythons}? What about other python macros?

We usually have it somewhere close to the top.