From Fedora Project Wiki
(Created page with "<!-- Self Contained or System Wide Change Proposal? Use this guide to determine to which category your proposed change belongs to. Self Contained Changes are: * changes to is...")
 
Line 125: Line 125:


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
0. Install Fedora 29 or 30
# Install Fedora 29 or 30
1. Upgrade it to Fedora 31
# Upgrade it to Fedora 31
2. Check if running "python" runs Python 3
# Check if running "python" runs Python 3
3. Check if installing python just says python3 is already isnatlled
# Check if installing python just says python3 is already isnatlled
4. Check if critical system components works (dnf, etc.)
# Check if critical system components works (dnf, etc.)
5. Check if your favorite Python applications work
# Check if your favorite Python applications work


== User Experience ==
== User Experience ==

Revision as of 13:22, 3 December 2016


Make /usr/bin/python Python 3

Summary

It's 2020 and Python 2 is not supported any more. In the line with https://www.python.org/dev/peps/pep-0394/ PEP 394], /usr/bin/python will point to Python 3 sine Fedora 31 (the release number might change, depending on release schedules of Python and Fedora). All python3-foo packages will provide the python-foo variant and python2-foo will stop providing it.


Owner

  • Name: Miro Hrončok
  • Email: <python-maint@redhat.com>
  • Release notes owner:

Current status

  • Targeted release: Fedora 31
  • Last updated: 2016-12-03
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

According to PEP 394 /usr/bin/python should mean Python 2 up until 2020, now whne it's already 2020, the PEP was changed (TODO check) and /usr/bin/python should mean Python 3. We will change that and together with that we will change our policy about the Python naming.

Current state

  • python2 and python2-<module> packages provide python and python-<module>
  • /usr/bin/python and other unversioned executables from the pythonX package belong to python2 package and are symlinks to /usr/bin/python2 etc.
  • Python tools have their unversioned executable in the python2-<tool> package and /usr/bin/<tool> is a symlink to /usr/bin/<tool>-2

State after this change

  • python3 and python3-<module> packages provide python and python-<module>
  • /usr/bin/python and other unversioned executables from the pythonX package belong to python3 package and are symlinks to /usr/bin/python3 etc.
  • Python tools have their unversioned executable in the python3-<tool> package and /usr/bin/<tool> is a symlink to /usr/bin/<tool>-3

Benefit to Fedora

Users will no longer be confused that there is no /usr/bin/python in Fedora by default and will no longer get old legacy Python 2 when installing and running just "python". Python means Python 3 for the outer world and that should be the the same for Fedora.

Also, users that still need Python 2 will be able to get it form the repositories, simply by installing and invoking "python2".


Scope

  • Proposal owners: Switch %python_provide macro, change python and python3 packages, help *Other developers* with their packages, update documentation (RPM porting guide, Developer Portal)
  • Other developers: Make sure your package uses either python2 or python3, not juts python (in dependencies, shebangs, scripts...). If your package is a Python tool, make sure the unversioned executable uses Python 3.
  • Policies and guidelines: Fedora Python Packaging Guidelines have to be changed to reflect this change
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

TBD

How To Test

  1. Install Fedora 29 or 30
  2. Upgrade it to Fedora 31
  3. Check if running "python" runs Python 3
  4. Check if installing python just says python3 is already isnatlled
  5. Check if critical system components works (dnf, etc.)
  6. Check if your favorite Python applications work

User Experience

Fedora would feel more modern. Users will stop reporting bugs like this one.

Dependencies

We need the PEP in question to actually 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? Yes
  • Blocks product? All

Documentation

See PEP 394 and this page.

Release Notes