#1165 Python: Don't suggest emptying or undefining %py3_shebang_flags
Merged 2 years ago by tibbs. Opened 2 years ago by churchyard.
churchyard/packaging-committee dont-undefine-py3_shebang_flags  into  master

@@ -865,8 +865,8 @@ 

  Shebang lines to invoke Python *SHOULD* be `+#!%{python3} -%{py3_shebang_flags}+`

  and they *MAY* include extra flags.

  

- If the default flags from <<py3_shebang_flags,the `+%{py3_shebang_flags}+` macro>>

- are not desirable,

+ If (some of) the default flags from

+ <<py3_shebang_flags,the `+%{py3_shebang_flags}+` macro>> are not desirable,

  packages *SHOULD* explicitly redefine the macro to remove them.

  

  Using `+#!%{python3}+` (`+#!/usr/bin/python3+`)
@@ -881,10 +881,19 @@ 

  or just placed in the current directory)

  don’t interfere with the RPM installed software.

  Sometimes, such content is desirable, such as with plugins.

- Undefining <<py3_shebang_flags,the `+%{py3_shebang_flags}+` macro>>

- or redefining it to a set of flags without `+s+`,

+ Redefining <<py3_shebang_flags,the `+%{py3_shebang_flags}+` macro>>

+ to a set of flags without `+s+`,

  rather than not using the macro at all,

  ensures that existing or future automation won’t add the flag.

+ The default set of flags might be extended in the future,

+ hence only explicitly removing the undesired flags is more future-proof than emptying the macro:

+ 

+ [source,spec]

+ ----

+ # Remove -s from Python shebang - ensure that extensions installed with pip

+ # to user locations are seen and properly loaded

+ %global py3_shebang_flags %(echo %py3_shebang_flags | sed s/s//)

+ ----

  

  The <<pyproject_install,`+%pyproject_install+` macro>>

  automatically changes all Python shebangs

@@ -407,7 +407,7 @@ 

  

  |`+%{py3_shebang_flags}+`

  |`s`

- |The default set of flags for Python shebangs. Redefine or undefine this to change the set. Used by `+%py3_shebang_fix+`.

+ |The default set of flags for Python shebangs. Redefine this to change the set. Used by `+%py3_shebang_fix+`.

  

  |`+%py3_shebang_fix …+`

  |(Python script)

no initial comment

Pull-Request has been merged by tibbs

2 years ago