Re: What way of opting out form a particular Python shebang flag do you prefer?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jun 30, 2022 5:13:21 AM Miro Hrončok <mhroncok@xxxxxxxxxx>:

> Basically, packagers would do something like this:
> 
> 
>    # Unset -s on python shebang - ensure that extensions installed with pip
>    # to user locations are seen and properly loaded
>    %global _python3_shebang_nousersite %{nil}
> 
> Or:
> 
>    # Don't add -P to Python shebang
>    # This package only works when /usr/bin is in sys.path
>    %global _python3_shebang_safepath %{nil}
> 
> The macro names are not set in stone, it could even be %_python3_shebang_s and %_python3_shebang_P.
> 
> The previous sed-based way would still work and packages that already use it would not need to change immediately.
> 
> Do you consider the macro based approach better (worth it)? And if so, do you prefer actual flag letters in the macro names, or the verbose names?
Of course, I think this is worth doing this as the person who suggested it :p. I prefer the flag letter names. They're shorter and easier to remember (after you first learn about them). Packagers will probably have to look up how to disable these flags when necessary and thus read the docs about what they actually do, anyways.

I also find the double negative `%global _python3_shebang_nousersite %{nil}` confusing. If we really want to use the verbose names (I don't), I would at least name the macro in terms of it limiting imports to only the system site-packages instead of the other way around. Something like `%_python3_shebang_sys_site_only` would be clearer, but it's a bit long for my taste.

I haven't followed it closely, but there is a Change proposal to do something similar for compiler flags in redhat-rpm-config. It might be worth alligning with that in terms of macro naming.
--
Thanks,

Maxwell G (@gotmax23)
Pronouns: He/Him/His

Attachment: signature.asc
Description: PGP signature

_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux