< Changes
Churchyard (talk | contribs) (Migration plan) |
Churchyard (talk | contribs) m (→%py2_build, %py2_install: typo) |
||
Line 182: | Line 182: | ||
%install | %install | ||
python2 setup.py install --skip-build --root %{ | python2 setup.py install --skip-build --root %{buildroot} | ||
Note: Add additional `sleep 1` after/before the build if you also build for Python 3. | Note: Add additional `sleep 1` after/before the build if you also build for Python 3. |
Revision as of 16:39, 14 January 2021
Remove Python2 RPM Macros
Summary
The python2-rpm-macros
package (contains /usr/lib/rpm/macros.d/macros.python2
) will be removed from Fedora 34 and further. The python2 RPM macros will ceases to exist. Python 2 packages are not allowed any more. Around a dozen of packages use the macros in Fedora and will need to be adjusted either by expanding them or by no longer using Python 2.
Owner
- Name: Miro Hrončok
- Email: mhroncok@redhat.com
Current status
- Targeted release: Fedora 34
- Last updated: 2021-01-14
- 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
Python 2 is upstream dead, usage in Fedora packages is forbidden, except for several package with an explicit FESCo approved exception. The Python Maintenance team no longer wishes to support the pythn2 RPM macros from python2-rpm-macros
//usr/lib/rpm/macros.d/macros.python2
and hence decided to remove the package. The following macros will be undefined:
%{python2_sitelib} %{python2_sitearch} %{python2_version} %{python2_version_nodots} %{python2_platform} %{py2_shbang_opts} %{py2_shbang_opts_nodash} %{py2_shebang_flags} %py2_shebang_fix %py2_build %py2_build_egg %py2_build_wheel %py2_install %py2_install_egg %py2_install_wheel
The following macros will remain defined for the time being to not break packages that are using Python 2 as build-time only dependency (which is also not allowed, but happens more often):
%{__python2} %{python2}
The Python 2 section of Python packaging guidelines will be removed.
python2.7
will no longer require python2-rpm-macros
and python3-rpm-generators
.
Packages that used to use those macros in Fedora will need to be adapted to expand the macros or switch to Python 3. In January 2021, we have:
- several Python 2 trac plugins, but
trac
uses Python 3 now - several Python 2 sugar packages, but they already don't build or install as
sugar
uses Python 3 now - 14 other affected packages in Fedora (some of them co-owned by Python Maint):
- avahi
- gimp-layer-via-copy-cut
- gimp-resynthesizer
- chromium
- NFStest
- offlineimap
- pygobject2
- pygtk2
- python-psutil
- python-six
- python2-cairo
- python2-dns
- python2-numpy
- python2-setuptools
The removed macros and migration plan:
%{python2_sitelib}
Affected Fedora packages:
- avahi
- NFStest
- offlineimap
- python2-dns
- python2-setuptools
- python-six
Migration plan if not possible to switch to Python 3 / retire: Use %{_prefix}/lib/python2.7/site-packages
.
%{python2_sitearch}
Affected Fedora packages:
- chromium
- offlineimap
- pygobject2
- pygtk2
- python2-cairo
- python2-numpy
- python-psutil
Migration plan if not possible to switch to Python 3 / retire: Use %{_libdir}/python2.7/site-packages
.
%{python2_version}
Affected Fedora packages:
- offlineimap
- pygtk2
- python2-numpy
- python2-setuptools
Migration plan if not possible to switch to Python 3 / retire: Use 2.7
.
%{python2_version_nodots}
No affected Fedora packages.
Migration plan: Use 27
.
%{python2_platform}
No affected Fedora packages.
Migration plan: Use a glob like linux-*
.
%{py2_shbang_opts}, %{py2_shbang_opts_nodash}, %{py2_shebang_flags}, %py2_shebang_fix
Affected Fedora packages:
- gimp-layer-via-copy-cut
- gimp-resynthesizer
- offlineimap
All use pathfix.py -pni "%{__python2} %{py2_shbang_opts}" ...
Migration plan: pathfix.py -pni "%{_bindir}/python2" -kas ...
%py2_build, %py2_install
Affected Fedora packages:
- NFStest
- offlineimap
- python2-cairo
- python2-dns
- python2-setuptools
- python-psutil
- python-six
Migration plan:
%build %set_build_flags python2 setup.py build %install python2 setup.py install --skip-build --root %{buildroot}
Note: Add additional sleep 1
after/before the build if you also build for Python 3.
%py2_build_egg, %py2_build_wheel, %py2_install_egg, %py2_install_wheel
No affected Fedora packages. There are no build dependencies in Fedora to build a wheel or install it.
Migration plan for egg: Please don't use this!
%build %set_build_flags python2 setup.py bdist_egg
%install python2 -m easy_install -m --prefix %{buildroot}%{_prefix} -Z <path_to_egg>
Feedback
Benefit to Fedora
Scope
- Proposal owners:
- Other developers: N/A (not a System Wide Change)
- Release engineering: #Releng issue number (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)
- Alignment with Objectives:
Upgrade/compatibility impact
N/A (not a System Wide Change)
How To Test
N/A (not a System Wide Change)
User Experience
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)