From Fedora Project Wiki

Platform Python Stack


A revisit of the System Python change from Fedora 24. It has been renamed from System Python to Platform Python not to collide with upstream PEP 432.

Platform Python will be a separate stack fo Python packages aimed to provide all necessary dependencies to run and build dnf. In Fedora 27 this will be Python 3.6 (same version as Package-x-generic-16.pngpython3, but this might change in the future with the Modularity effort).


Current status

Detailed Description

The changes made during the System Python change from Fedora 24 will be reverted.

A new platform-python (source) package will be created as a copy of the Package-x-generic-16.pngpython3 package. Unlike python3, it will be changed so that:

  • the location of files will not be /usr/lib/python3.6/ but /usr/lib/platform-python3.6/
    • the script that generates the python(abi) requirement will be adapted to generate platform-python(abi) requirement for that location
  • the location of the binary will be /usr/libexec/platform-python
  • all the macros will use the platform python binary and will be renamed
  • all subpackages will be named platform-python-*
  • the debug build will be disabled
  • the modules that are (before this change) not part of system-python-libs but rather python3-libs will relocate to platform-python-libs-devel to be available only on build-time
  • platform-python will provide platform-python(abi) instead of python(abi)

Several packages (see bellow) will introduce a new platform-python- subpackage. Example specfile of such package:

%global pypi_name foo

%bcond_without python2
%bcond_without python3
%bcond_without platform_python

Name:           python-%{pypi_name}
Version:        0.13
Release:        1%{?dist}
Summary:        Python %{pypi_name} module

License:        GPLv2
URL:  {pypi_name}

%if %{with python2}
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools

%if %{with python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%if %{with platform_python}
BuildRequires:  platform-python-devel
BuildRequires:  platform-python-setuptools

BuildArch:      noarch


%if %{with python2}
%package -n     python2-%{pypi_name}
Summary:        %{summary}
Requires:       python2-bar
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}

%if %{with python3}
%package -n     python3-%{pypi_name}
Summary:        %{summary}
Requires:       python3-bar
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}

%if %{with platform_python}
%package -n     platform-python-%{pypi_name}
Summary:        %{summary}
Requires:       platform-python-bar

%description -n platform-python-%{pypi_name}

%autosetup -n %{pypi_name}-%{version}

%if %{with python2}

%if %{with python3}

%if %{with platform_python}

%if %{with python2}
rm %{buildroot}%{_bindir}/%{pypi_name}

%if %{with platform_python}
rm %{buildroot}%{_bindir}/%{pypi_name}

%if %{with python3}

%if %{with python2}
export PYTHONPATH=%{buildroot}%{python2_sitelib}
%{__python2} -m unittest discover -v

%if %{with python3}
export PYTHONPATH=%{buildroot}%{python3_sitelib}
%{__python3} -m unittest discover -v

%if %{with platform_python}
export PYTHONPATH=%{buildroot}%{platform_python_sitelib}
%{__platform_python} -m unittest discover -v

%if %{with python2}
%files -n python2-%{pypi_name}
%doc README.rst CHANGES.rst
%license COPYING

%if %{with python3}
%files -n python3-%{pypi_name}
%doc README.rst CHANGES.rst
%license COPYING

%if %{with platform_python}
%files -n platform-python-%{pypi_name}
%doc README.rst CHANGES.rst
%license COPYING


The complete list of affected packages is not final yet. It should be all the Python build dependencies of dnf and their build dependencies as well, excluding packages only needed to build the documentation (normal python3- (or even python2-) packages will be used to build the documentation as it is now).

Currently, we have established this as a list of packages:


Only the following list will be installable from the platform module (the rest is merely meant as a build dependency):


(And other subpackages from their source RPMs needed as dependencies for those, such as gpgme etc.)

Benefit to Fedora

With the Modularity effort a minimal stack of Python only needed to run dnf (and potentially other system management utilities later on) is needed to be part of the Platform. Changing System/Platform Python to be a separate stack will allow us to do that. In the future that allows us to have different version of Python in Platform and in the "Python 3" module.

Splitting the full Python stack away from Platform allows for flexible and fast paced, upstream-driven delivery, independent of the main Fedora release cycle. See Modularity for more information about this concept in general and the Host and Platform change proposal to learn more about the abovementioned Platform module.


  • Proposal owners:
    • A Roadmap has been created
    • identify a list of runtime and build dependencies of dnf
    • create a platform-python source package
    • change the script that generates the python(abi) requirements to also generate platform-python(abi) requirements
    • revert system-python related things from the Package-x-generic-16.pngpython3 package (add appropriate provides/obsoletes)
    • add a platform-python- subpackage to identified list of packages
    • switch dnf to use that stack
  • Other developers: N/A (not a System Wide Change)
  • Release engineering: #6917 (a check of an impact with Release Engineering is needed)
  • 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

Nothing should change for the user, except a slightly larger amount of packages will be installed on the system.


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? No (not a System Wide Change)
  • Blocks product? No

If not done on time: Keep dnf running on Package-x-generic-16.pngpython3. Finish the work in time of Fedora 28.

If proven not to work as designed: Retire platform-python package and remove all the platform-python- subpackages. Provide/obsolete platform-python- subpackages from their python3- counterparts.


N/A (not a System Wide Change)

Release Notes