| |
@@ -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.
|
| |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2014513