Skip to content

Commit

Permalink
In easy_install, re-use scheme selection from distutils if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 20, 2021
1 parent 5807a33 commit 76c9ab9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
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
Expand Down Expand Up @@ -251,6 +251,9 @@ def finalize_options(self): # noqa: C901 # is too complex (25) # FIXME
'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:
Expand Down Expand Up @@ -711,13 +714,7 @@ def install_item(self, spec, download, tmpdir, deps, install_needed=False):
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
Expand Down

0 comments on commit 76c9ab9

Please sign in to comment.