From 76c9ab9efc3f13e5ef8681614bebbe437bf51012 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 20 Dec 2021 11:50:50 -0500 Subject: In easy_install, re-use scheme selection from distutils if available. --- setuptools/command/easy_install.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'setuptools/command') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index fc848d0d..00b59904 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -17,10 +17,10 @@ from distutils.errors import ( DistutilsArgError, DistutilsOptionError, DistutilsError, DistutilsPlatformError, ) -from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS from distutils import log, dir_util from distutils.command.build_scripts import first_line_re from distutils.spawn import find_executable +from distutils.command import install import sys import os import zipimport @@ -251,6 +251,9 @@ class easy_install(Command): 'exec_prefix': exec_prefix, # Only python 3.2+ has abiflags 'abiflags': getattr(sys, 'abiflags', ''), + 'platlibdir': getattr(sys, 'platlibdir', 'lib'), + 'implementation_lower': install._get_implementation().lower(), + 'implementation': install._get_implementation(), } if site.ENABLE_USER_SITE: @@ -711,13 +714,7 @@ class easy_install(Command): return dist def select_scheme(self, name): - """Sets the install directories by applying the install schemes.""" - # it's the caller's problem if they supply a bad name! - scheme = INSTALL_SCHEMES[name] - for key in SCHEME_KEYS: - attrname = 'install_' + key - if getattr(self, attrname) is None: - setattr(self, attrname, scheme[key]) + install._select_scheme(self, name) # FIXME: 'easy_install.process_distribution' is too complex (12) def process_distribution( # noqa: C901 -- cgit v1.2.1