#83 [WIP] Fedora < 36 only: Instruct pip to use distutils
Closed 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/python3.10 f35-pip-force-distutils  into  f35

@@ -2,17 +2,27 @@ 

  From: Michal Cyprian <m.cyprian@gmail.com>

  Date: Mon, 26 Jun 2017 16:32:56 +0200

  Subject: [PATCH] 00251: Change user install location

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

  

  Set values of prefix and exec_prefix in distutils install command

  to /usr/local if executable is /usr/bin/python* and RPM build

  is not detected to make pip and distutils install into separate location.

  

  Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe

- Downstream only: Awaiting resources to work on upstream PEP

+ Downstream only: Reworked in Fedora 36+ to follow https://bugs.python.org/issue43976

+ 

+ Also set sysconfig._PIP_USE_SYSCONFIG = False, to force pip-upgraded-pip

+ to respect this patched distutils install command.

+ See https://bugzilla.redhat.com/show_bug.cgi?id=2014513

+ 

+ Co-authored-by: Miro Hrončok <miro@hroncok.cz>

  ---

   Lib/distutils/command/install.py | 15 +++++++++++++--

   Lib/site.py                      |  9 ++++++++-

-  2 files changed, 21 insertions(+), 3 deletions(-)

+  Lib/sysconfig.py                 |  4 ++++

+  3 files changed, 25 insertions(+), 3 deletions(-)

  

  diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py

  index 26696cfb9d..1826cbcb38 100644
@@ -61,3 +71,18 @@ 

       for sitedir in getsitepackages(prefixes):

           if os.path.isdir(sitedir):

               addsitedir(sitedir, known_paths)

+ diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py

+ index 95b48f6429..f78b374748 100644

+ --- a/Lib/sysconfig.py

+ +++ b/Lib/sysconfig.py

+ @@ -58,6 +58,10 @@

+          },

+      }

+  

+ +# Force pip to use distutils paths instead of sysconfig

+ +# https://github.com/pypa/pip/issues/10647

+ +_PIP_USE_SYSCONFIG = False

+ +

+  

+  # NOTE: site.py has copy of this function.

+  # Sync it when modify this function.

file modified
+11 -3
@@ -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

  

  
@@ -267,7 +267,7 @@ 

  # Was Patch0 in ivazquez' python3000 specfile

  Patch1: 00001-rpath.patch

  

- # 00251 # 5c445123f04d96be42a35eef5119378ba1713a96

+ # 00251 # f9b6509e62a9b05c96470903cb0280760c443e29

  # Change user install location

  #

  # Set values of prefix and exec_prefix in distutils install command
@@ -275,7 +275,11 @@ 

  # is not detected to make pip and distutils install into separate location.

  #

  # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe

- # Downstream only: Awaiting resources to work on upstream PEP

+ # Downstream only: Reworked in Fedora 36+ to follow https://bugs.python.org/issue43976

+ #

+ # Also set sysconfig._PIP_USE_SYSCONFIG = False, to force pip-upgraded-pip

+ # to respect this patched distutils install command.

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

  Patch251: 00251-change-user-install-location.patch

  

  # 00328 # 318e500c98f5e59eb1f23e0fcd32db69b9bd17e1
@@ -1592,6 +1596,10 @@ 

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

  

  %changelog

+ * Thu Dec 09 2021 Miro Hrončok <mhroncok@redhat.com> - 3.10.1-2

+ - Instruct pip to use distutils

+ - Fixes rhbz#2014513

+ 

  * Tue Dec 07 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.10.1-1

  - Update to 3.10.1

  

Build succeeded.

rebased onto b7b2fa4

2 years ago

Build succeeded.

Pull-Request has been closed by churchyard

2 years ago