Do not add user site-packages directory to sys.path (RHEL-26646)#2074
Conversation
8aa5298 to
ab22cb9
Compare
Current directory is controlled by -P option. Not -s option. Remove these words from the commit message. |
Probably not just the current directory. Python Packaging Guidelines https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_shebangs states (I'll comment the code): Anyway, I copied the text from the Python Packaging Guidelines and they probably have a mistake in the description (I found another error there already yesterday). |
Adds `-s` to shebang lines. The `-s` flag ensures that the user’s Python packages (e.g. installed by pip install --user) don’t interfere with the RPM installed software. According to Fedora Python Packaging Guidelines, the flag is added using `%py3_shebang_fix` macro. Note: DNF supports plugins. There is a risk that the change will break a custom plugins that require something from PIP. Therefore, the change is only in the .spec file and is only allowed for Fedora >= 41 and RHEL >= 10.
ab22cb9 to
0a90976
Compare
ppisar
left a comment
There was a problem hiding this comment.
Good. I verified it by building on Fedora 41 and inspecting sys.path Python object.
Adds
-sto shebang lines.The
-sflag ensures that the user’s Python packages (e.g. installed bypip install --user) don’t interfere with the RPM installed software.According to Fedora Python Packaging Guidelines, the flag is added using
%py3_shebang_fixmacro.Note:
DNF supports plugins. There is a risk that the change will break a custom plugins that require something from PIP.
Therefore, the change is only in the .spec file and is only allowed for Fedora >= 41 and RHEL >= 10.