#122 Python now means Python 3
Merged 2 months ago by churchyard. Opened 2 months ago by churchyard.
rpms/ churchyard/python3 the_big_switch  into  master

file modified
+79 -22

@@ -17,7 +17,7 @@ 

  #global prerel ...

  %global upstream_version %{general_version}%{?prerel}

  Version: %{general_version}%{?prerel:~%{prerel}}

- Release: 1%{?dist}

+ Release: 2%{?dist}

  License: Python

  

  

@@ -329,12 +329,17 @@ 

  # replace python36-3.6.2.

  Obsoletes: python%{pyshortver}

  

- # Shall be removed in Fedora 31

- # The release is bumped to 20, so we can do f27 platform-python updates

- # If the release in f27 ever goes >= 20, raise it here

- # If platform-python is ever reintroduced, make it higher version than this:

- %global platpyver 3.6.2-20

- Obsoletes: platform-python < %{platpyver}

+ # https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package

+ # https://fedoraproject.org/wiki/Changes/Python_means_Python3

+ # We recommend /usr/bin/python so users get it by default

+ # Versioned recommends are problematic, and we know that the package requires

+ # python3 back with fixed version, so we just use the path here:

+ Recommends: %{_bindir}/python

+ 

+ # In Fedora 31, /usr/bin/pydoc was moved here from Python 2.

+ # Ideally we'd have an explicit conflict with "/usr/bin/pydoc < 3",

+ # but file provides aren't versioned and the file moved across packages.

+ # Instead, we rely on the conflict in python3-libs.

  

  # Previously, this was required for our rewheel patch to work.

  # This is technically no longer needed, but we keep it recommended

@@ -371,6 +376,22 @@ 

  the "%{name}-" prefix.

  

  

+ # https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package

+ # https://fedoraproject.org/wiki/Changes/Python_means_Python3

+ %package -n python-unversioned-command

+ Summary: The "python" command that runs Python 3

+ BuildArch: noarch

+ 

+ # In theory this could require any python3 version

+ Requires: python3 == %{version}-%{release}

+ # But since we want to provide versioned python, we require exact version

+ Provides: python = %{version}-%{release}

+ # This also save us an explicit conflict for older python3 builds

+ 

+ %description -n python-unversioned-command

+ This package contains /usr/bin/python - the "python" command that runs Python 3.

+ 

+ 

  %package libs

  Summary:        Python runtime libraries

  

@@ -390,9 +411,17 @@ 

  # See https://bugzilla.redhat.com/show_bug.cgi?id=1547131

  Recommends: %{name}%{?_isa} = %{version}-%{release}

  

- # Shall be removed in Fedora 31

- Obsoletes: platform-python-libs < %{platpyver}

- Obsoletes: platform-python-libs-devel < %{platpyver}

+ # https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package

+ # In Fedora 31, several "unversioned" files like /usr/bin/pydoc and all the

+ # "unversioned" provides were moved from python2 to python3.

+ # So, newer python3 packages need to conflict with old Python 2 builds that

+ # still provided unversioned Python.

+ # Since all python packages, new and old, have versioned requires on

+ # python?-libs, we do it here:

+ Conflicts: python-libs < 3

+ # (We explicitly conflict with python-libs and not python2-libs, so only the

+ # old Python 2 builds that still provided unversioned Python are handled.)

+ 

  

  %description libs

  This package contains runtime libraries for use by Python:

@@ -426,8 +455,9 @@ 

  

  Conflicts: %{name} < %{version}-%{release}

  

- # Shall be removed in Fedora 31

- Obsoletes: platform-python-devel < %{platpyver}

+ # In Fedora 31, several "unversioned" files were moved here from Python 2:

+ # pygettext.py, msgfmt.py, python-config, python.pc

+ Conflicts: python-devel < 3

  

  %description devel

  This package contains the header files and configuration needed to compile

@@ -444,15 +474,16 @@ 

  Requires: %{name}-tkinter = %{version}-%{release}

  

  Provides: idle3 = %{version}-%{release}

+ Provides: idle = %{version}-%{release}

  

  Provides: %{name}-tools = %{version}-%{release}

  Provides: %{name}-tools%{?_isa} = %{version}-%{release}

  Obsoletes: %{name}-tools < %{version}-%{release}

  

- %{?python_provide:%python_provide python3-idle}

+ # In Fedora 31, /usr/bin/idle was moved here from Python 2.

+ Conflicts: python-tools < 3

  

- # Shall be removed in Fedora 31

- Obsoletes: platform-python-tools < %{platpyver}

+ %{?python_provide:%python_provide python3-idle}

  

  %description idle

  IDLE is Python’s Integrated Development and Learning Environment.

@@ -473,9 +504,6 @@ 

  

  %{?python_provide:%python_provide python3-tkinter}

  

- # Shall be removed in Fedora 31

- Obsoletes: platform-python-tkinter < %{platpyver}

- 

  %description tkinter

  The Tkinter (Tk interface) library is a graphical user interface toolkit for

  the Python programming language.

@@ -488,9 +516,6 @@ 

  

  %{?python_provide:%python_provide python3-test}

  

- # Shall be removed in Fedora 31

- Obsoletes: platform-python-test < %{platpyver}

- 

  %description test

  The self-test suite for the Python interpreter.

  

@@ -513,6 +538,9 @@ 

  Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}

  Requires: %{name}-idle%{?_isa} = %{version}-%{release}

  

+ # In Fedora 31, /usr/bin/python-debug was moved here from Python 2.

+ Conflicts: python-debug < 3

+ 

  %{?python_provide:%python_provide python3-debug}

  

  %description debug

@@ -939,6 +967,20 @@ 

  rm %{buildroot}%{_libdir}/libpython3.so

  rm %{buildroot}%{_mandir}/man1/python3.1*

  rm %{buildroot}%{_libdir}/pkgconfig/python3.pc

+ %else

+ # Link the unversioned stuff

+ # https://fedoraproject.org/wiki/Changes/Python_means_Python3

+ ln -s ./python3 %{buildroot}%{_bindir}/python

+ ln -s ./pydoc3 %{buildroot}%{_bindir}/pydoc

+ ln -s ./pygettext3.py %{buildroot}%{_bindir}/pygettext.py

+ ln -s ./msgfmt3.py %{buildroot}%{_bindir}/msgfmt.py

+ ln -s ./idle3 %{buildroot}%{_bindir}/idle

+ ln -s ./python3-config %{buildroot}%{_bindir}/python-config

+ ln -s ./python3.1 %{buildroot}%{_mandir}/man1/python.1

+ ln -s ./python3.pc %{buildroot}%{_libdir}/pkgconfig/python.pc

+ %if %{with debug_build}

+ ln -s ./python3-debug %{buildroot}%{_bindir}/python-debug

+ %endif

  %endif

  

  

@@ -1041,10 +1083,14 @@ 

  %{_bindir}/python%{pybasever}

  %{_bindir}/python%{pybasever}m

  %{_bindir}/pyvenv-%{pybasever}

- %{_mandir}/*/*

+ %{_mandir}/*/*3*

  

  

  %if %{without flatpackage}

+ %files -n python-unversioned-command

+ %{_bindir}/python

+ %{_mandir}/*/python.1*

+ 

  %files libs

  %license LICENSE

  %doc README.rst

@@ -1290,10 +1336,14 @@ 

  

  %if %{without flatpackage}

  %{_bindir}/python3-config

+ %{_bindir}/python-config

  %{_libdir}/pkgconfig/python3.pc

+ %{_libdir}/pkgconfig/python.pc

  %{_bindir}/pathfix.py

  %{_bindir}/pygettext3.py

+ %{_bindir}/pygettext.py

  %{_bindir}/msgfmt3.py

+ %{_bindir}/msgfmt.py

  %endif

  

  %{_bindir}/pygettext%{pybasever}.py

@@ -1378,6 +1428,7 @@ 

  %if %{without flatpackage}

  %files debug

  %{_bindir}/python3-debug

+ %{_bindir}/python-debug

  %endif

  

  # Analog of the core subpackage's files:

@@ -1506,6 +1557,12 @@ 

  # ======================================================

  

  %changelog

+ * Fri Jul 12 2019 Miro Hrončok <mhroncok@redhat.com> - 3.7.4-2

+ - https://fedoraproject.org/wiki/Changes/Python_means_Python3

+ - The python-unversioned-command package is no longer Python 2, but 3

+ - The python, pydoc, python-config, python-debug, idle, pygettext.py and

+   msgfmt.py commands are now in python3

+ 

  * Tue Jul 09 2019 Miro Hrončok <mhroncok@redhat.com> - 3.7.4-1

  - Update to 3.7.4

  

DO NOT BUILD

This is blocked by https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/26 and https://src.fedoraproject.org/rpms/python2/pull-request/45

This here looks rather fragile. We can possibly bump the release of python2 to 100, but we don't bump python2 releases so often, we rather bump the version :(

I've done same upgrade paths tests in mock and it seems good.

However there are only 2 more planned versions according to https://www.python.org/dev/peps/pep-0373/#maintenance-releases

1 new commit added

  • WIP: Solve the explicit conflict without hardcoding python2 version
2 months ago

2 new commits added

  • Python now means Python 3
  • Remove obsolete obsoletes
2 months ago

Pull-Request has been merged by churchyard

2 months ago