summaryrefslogtreecommitdiff
path: root/distutils/command
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-11-20 12:18:15 -0500
committerJason R. Coombs <jaraco@jaraco.com>2021-11-20 12:18:15 -0500
commit22e1669edc3ed00a87e59a2f6c5918aa67ae731e (patch)
tree31f0848e5a5944b72cb4eaee48977680e6d22f1a /distutils/command
parentc8fcf4d2e3aaf543f065971dcf78451be35adcc4 (diff)
downloadpython-setuptools-git-22e1669edc3ed00a87e59a2f6c5918aa67ae731e.tar.gz
Expose _prefix_addition as a class property on install.
Diffstat (limited to 'distutils/command')
-rw-r--r--distutils/command/install.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/distutils/command/install.py b/distutils/command/install.py
index dbc83fce..583b1713 100644
--- a/distutils/command/install.py
+++ b/distutils/command/install.py
@@ -190,6 +190,8 @@ class install(Command):
negative_opt = {'no-compile' : 'compile'}
+ # Allow Fedora to add components to the prefix
+ _prefix_addition = ""
def initialize_options(self):
"""Initializes options."""
@@ -471,24 +473,10 @@ class install(Command):
raise DistutilsOptionError(
"must not supply exec-prefix without prefix")
- # Fedora (and Fedora derived distros) used to patch distutils
- # until Fedora 36 and/or Python 3.11.
- # Here, we preserve that behavior conditionally on a special
- # _distutils_mangle_rpm_prefix attribute of sysconfig
- # that Fedora sets on their older Pythons to support this check.
- # When it is set and true-ish,
- # self.prefix is set to sys.prefix + /local/
- # if neither RPM build nor virtual environment is
- # detected to make pip and distutils install packages to /usr/local.
- addition = ""
- if (getattr(sysconfig, "_distutils_mangle_rpm_prefix", False) and
- not (hasattr(sys, 'real_prefix') or
- sys.prefix != sys.base_prefix) and
- 'RPM_BUILD_ROOT' not in os.environ):
- addition = "/local"
-
- self.prefix = os.path.normpath(sys.prefix) + addition
- self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition
+ self.prefix = (
+ os.path.normpath(sys.prefix) + self._prefix_addition)
+ self.exec_prefix = (
+ os.path.normpath(sys.exec_prefix) + self._prefix_addition)
else:
if self.exec_prefix is None: