Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%{?sle15_python_module_pythons} is moved #308

Closed
pgajdos opened this issue Jun 8, 2023 · 3 comments · Fixed by #313
Closed

%{?sle15_python_module_pythons} is moved #308

pgajdos opened this issue Jun 8, 2023 · 3 comments · Fixed by #313

Comments

@pgajdos
Copy link

pgajdos commented Jun 8, 2023

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
Copy link
Author

pgajdos commented Jun 8, 2023

CC @kstreitova @mcepl

@kstreitova
Copy link
Contributor

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
Copy link
Contributor

mcepl commented Jun 23, 2023

@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.

danigm added a commit to danigm/spec-cleaner that referenced this issue Sep 19, 2023
This patch adds a new category "head", similar to the "tail" category,
to match the modern python macros for SUSE SLE
(sle15_python_module_pythons and sle15allpythons), these macros changed
the "pythons" definition, so they should go before any usage of the
python-rpm-macros.

Fix rpm-software-management#308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants