From Fedora Project Wiki
(owners)
(shebang change will not have automated patches)
Line 57: Line 57:


* Ensuring that <code>/usr/bin/python</code> or <code>/usr/bin/env python</code> shebangs are replaced with either <code>/usr/bin/python2</code> or <code>/usr/bin/python3</code>
* Ensuring that <code>/usr/bin/python</code> or <code>/usr/bin/env python</code> shebangs are replaced with either <code>/usr/bin/python2</code> or <code>/usr/bin/python3</code>
 
We are not planning to provide automated patches for this change, therefore the package owners are expected to make sure all scripts in their packages explicitly use either <code>/usr/bin/python2</code> or <code>/usr/bin/python3</code> shebangs.


Each of the above conforms to the [[Packaging:Python|Python packaging guidelines]] and was approved by FPC. The work on the change is already in progress and will be tracked by this Fedora change.
Each of the above conforms to the [[Packaging:Python|Python packaging guidelines]] and was approved by FPC. The work on the change is already in progress and will be tracked by this Fedora change.
Line 67: Line 67:
== Scope ==
== Scope ==
* Proposal owners:
* Proposal owners:
Proposal owners are to communicate the idea to the packagers and fix all affected packages via [[Mass_package_changes]] procedure.
Proposal owners are to communicate the idea to the packagers and rename the affected packages as well as fix the requirements via [[Mass_package_changes]] procedure.  


* Other developers:
* Other developers:
Package maintainers will be asked to review Pagure PRs.
Package maintainers are expected to fix package requirements generated from shebangs by making sure that no scripts in their packages use <code>/usr/bin/python</code> or <code>/usr/bin/env python</code> shebangs.
Package maintainers will also be asked to review Pagure PRs with automated patches fixing the ambiguous Python 2 dependency declarations.  


* Release engineering: [https://pagure.io/releng/issues #Releng issue number] (a check of an impact with Release Engineering is needed) <!-- REQUIRED FOR SYSTEM WIDE AS WELL AS FOR SELF CONTAINED CHANGES -->
* Release engineering: [https://pagure.io/releng/issues #Releng issue number] (a check of an impact with Release Engineering is needed) <!-- REQUIRED FOR SYSTEM WIDE AS WELL AS FOR SELF CONTAINED CHANGES -->

Revision as of 19:09, 2 January 2018


Use explicit version of Python 2/3 throughout Fedora

Summary

With Python 2 approaching it's EOL, we are trying to prepare Fedora for a transition to Python 3 and thus make python without a version number mean Python 3. This Fedora change is to track the progress of the Phase 1 in the Finalizing Fedora's Switch to Python 3 transition plan.

Owner

Current status

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

Detailed Description

Finalizing Fedora's Switch to Python 3 document provides detailed information on the matter. This Fedora change covers only Phase 1 of the transition steps, and aims to clean up Fedora packages in accordance with the recent changes to Python packaging guidelines regarding the usage of python without a version number in package names, requirements, shebangs, etc. The clean up involves:

  • Renaming Python 2 binary RPMs from python-foo to python2-foo

This is already partially done by applying automated patches as announced in Mass package change (python2- binary package renaming). The packages which still need to be fixed are tracked in PortingDB.

  • Fixing ambiguous Python 2 dependency declarations, i.e using python2-foo instead of python-foo in requirements

We have started opening automatic Pull Requests with patches as announced in Mass Pull Request filing for ambiguous Python 2 requirements. The packages which will be targeted are tracked in PortingDB.

  • Ensuring that /usr/bin/python or /usr/bin/env python shebangs are replaced with either /usr/bin/python2 or /usr/bin/python3

We are not planning to provide automated patches for this change, therefore the package owners are expected to make sure all scripts in their packages explicitly use either /usr/bin/python2 or /usr/bin/python3 shebangs.

Each of the above conforms to the Python packaging guidelines and was approved by FPC. The work on the change is already in progress and will be tracked by this Fedora change.

Benefit to Fedora

See Benefit to Fedora section in the Finalizing Fedora's Switch to Python 3 document.

Scope

  • Proposal owners:

Proposal owners are to communicate the idea to the packagers and rename the affected packages as well as fix the requirements via Mass_package_changes procedure.

  • Other developers:

Package maintainers are expected to fix package requirements generated from shebangs by making sure that no scripts in their packages use /usr/bin/python or /usr/bin/env python shebangs. Package maintainers will also be asked to review Pagure PRs with automated patches fixing the ambiguous Python 2 dependency declarations.

  • Policies and guidelines:
    • Using python2/python3 instead of python in binary RPM package name guidelines, fpc
    • Using python2/python3 instead of python in (Build)Requires, guidelines, fpc
    • Using /usr/bin/python2 instead of /usr/bin/python in shebangs and Requires, guidelines, fpc

How To Test

See How To Test section in the Finalizing Fedora's Switch to Python 3 document.

Dependencies

TBD

Contingency Plan

  • Contingency mechanism: (What to do? Who will do it?) In case the change is not completed in time, it will be moved to the next Fedora release.
  • Contingency deadline: beta freeze
  • Blocks release? No
  • Blocks product? No

Documentation

Release Notes

TBD