From Fedora Project Wiki
mNo edit summary
mNo edit summary
Line 61: Line 61:


<!-- 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. -->
=== Status quo ===


As for Fedora 28, all <code>*.py</code> files outside of the <code>/usr/lib(64)?/pythonX.Y/</code> directories are bytecompiled by <code>/usr/bin/python</code>.
As for Fedora 28, all <code>*.py</code> files outside of the <code>/usr/lib(64)?/pythonX.Y/</code> directories are bytecompiled by <code>/usr/bin/python</code>.
Line 73: Line 75:
**** that assumption is forbidden by the Python packaging guidelines, yet here it is heavily used
**** that assumption is forbidden by the Python packaging guidelines, yet here it is heavily used


See [https://fedoraproject.org/w/index.php?title=Packaging:Python_Appendix&oldid=419140#Manual_byte_compilation Packaging:Python Appendix] for more information (this links to specific revision because this change will change it).
See [https://fedoraproject.org/w/index.php?title=Packaging:Python_Appendix&oldid=419140#Manual_byte_compilation Packaging:Python Appendix] for more information (this links to a specific revision so the link makes sense once this change is implemented and the guidelines change).
 
TODO put the example specfile that fails here
 
=== How we are changing it ===
 
TODO


== Benefit to Fedora ==
== Benefit to Fedora ==

Revision as of 14:26, 1 February 2018

Incomplete
This page is incomplete!


No more automagic Python bytecompilation

Summary

Owner

  • Name: Miro Hrončok
  • Email: mhroncok@redhat.com
  • Release notes owner:

Current status

  • Targeted release: Fedora 29
  • Last updated: 2018-02-01
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

Status quo

As for Fedora 28, all *.py files outside of the /usr/lib(64)?/pythonX.Y/ directories are bytecompiled by /usr/bin/python. This is overly magical and assumes several things (not always right):

  • all files named *.py are Python modules that need to be bytecompiled
  • when a file is not in /usr/lib(64)?/pythonX.Y/ it is intended for the /usr/bin/python interpreter
    • That is currently Python 2, but may be removed or changed to Python 3 at any point in the future.
    • This is only the default behavior, it can be changed by redefining %__python to:
      • python3: that currently happens in various packages and is documented in the guidelines as a way to do it
      • python2: nobody does that, because the magic "just works" for this use case - relying on the fact that /usr/bin/python is currently python2
        • that assumption is forbidden by the Python packaging guidelines, yet here it is heavily used

See Packaging:Python Appendix for more information (this links to a specific revision so the link makes sense once this change is implemented and the guidelines change).

TODO put the example specfile that fails here

How we are changing it

TODO

Benefit to Fedora

Scope

  • Proposal owners:
  • Other developers: N/A (not a System Wide Change)
  • Policies and guidelines: N/A (not a System Wide Change)
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

N/A (not a System Wide Change)

How To Test

N/A (not a System Wide Change)

User Experience

N/A (not a System Wide Change)

Dependencies

N/A (not a System Wide Change)

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
  • Blocks product? product

Documentation

N/A (not a System Wide Change)

Release Notes