From Fedora Project Wiki
< Changes
Churchyard (talk | contribs) (Name, summary, owner, targeted release) |
Churchyard (talk | contribs) (Move the list of macros to detailed description) |
||
Line 8: | Line 8: | ||
<!-- A sentence or two summarizing what this change is and what it will do. This information is used for the overall changeset summary page for each release. Note that motivation for the change should be in the Benefit to Fedora section below, and this part should answer the question "What?" rather than "Why?". --> | <!-- A sentence or two summarizing what this change is and what it will do. This information is used for the overall changeset summary page for each release. Note that motivation for the change should be in the Benefit to Fedora section below, and this part should answer the question "What?" rather than "Why?". --> | ||
The [https://docs.python.org/3.11/using/cmdline.html#cmdoption-P `-P` flag] will be added to the Python shebang macros (`%{py3_shbang_opts | The [https://docs.python.org/3.11/using/cmdline.html#cmdoption-P `-P` flag] will be added to the Python shebang macros (`%{py3_shbang_opts}`, `%{py3_shebang_flags}`, ...). Packages that adhere to those macros will change their Python shbanegs from `#! /usr/bin/python3 -s` to `#! /usr/bin/python3 -sP` and as a result, will no longer have the directory of the script (such as `/usr/bin`) in `sys.path`. An opt-out mechanism exists. | ||
== Owner == | == Owner == | ||
Line 48: | Line 48: | ||
== Detailed Description == | == Detailed Description == | ||
<!-- Expand on the summary, if appropriate. A couple sentences suffices to explain the goal, but the more details you can provide the better. --> | <!-- Expand on the summary, if appropriate. A couple sentences suffices to explain the goal, but the more details you can provide the better. --> | ||
=== List of RPM macros that will gain `-P` === | |||
* `%{py3_shbang_opts}` | |||
* `%{py3_shbang_opts_nodash}` | |||
* `%{py3_shebang_flags}` | |||
* `%{py_shbang_opts}` | |||
* `%{py_shbang_opts_nodash}` | |||
* `%{py_shebang_flags}` | |||
== Feedback == | == Feedback == |
Revision as of 14:11, 10 May 2022
Python: Add -P to default shebangs
Summary
The -P
flag will be added to the Python shebang macros (%{py3_shbang_opts}
, %{py3_shebang_flags}
, ...). Packages that adhere to those macros will change their Python shbanegs from #! /usr/bin/python3 -s
to #! /usr/bin/python3 -sP
and as a result, will no longer have the directory of the script (such as /usr/bin
) in sys.path
. An opt-out mechanism exists.
Owner
- Name: Miro Hrončok, Victor Stinner
- Email: python-maint@redhat.com
Current status
- Targeted release: Fedora Linux 37
- Last updated: 2022-05-10
- FESCo issue: <will be assigned by the Wrangler>
- Tracker bug: <will be assigned by the Wrangler>
- Release notes tracker: <will be assigned by the Wrangler>
Detailed Description
List of RPM macros that will gain -P
%{py3_shbang_opts}
%{py3_shbang_opts_nodash}
%{py3_shebang_flags}
%{py_shbang_opts}
%{py_shbang_opts_nodash}
%{py_shebang_flags}
Feedback
Benefit to Fedora
Scope
- Proposal owners:
- Other developers:
- Release engineering: #Releng issue number
- Policies and guidelines: N/A (not needed for this Change)
- Trademark approval: N/A (not needed for this Change)
- Alignment with Objectives:
Upgrade/compatibility impact
How To Test
User Experience
Dependencies
Contingency Plan
- Contingency mechanism: (What to do? Who will do it?) N/A (not a System Wide Change)
- Contingency deadline: N/A (not a System Wide Change)
- Blocks release? N/A (not a System Wide Change), Yes/No
Documentation
N/A (not a System Wide Change)