Skip to content

Commit

Permalink
Honor sysconfig variables in easy_install. Fixes #3026.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 12, 2022
1 parent e358387 commit b789d31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.d/3026.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Honor sysconfig variables in easy_install.
16 changes: 8 additions & 8 deletions setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
import shlex
import io
import configparser
import sysconfig


from sysconfig import get_config_vars, get_path
from sysconfig import get_path

from setuptools import SetuptoolsDeprecationWarning

Expand Down Expand Up @@ -236,23 +237,22 @@ def finalize_options(self): # noqa: C901 # is too complex (25) # FIXME
self.version and self._render_version()

py_version = sys.version.split()[0]
prefix, exec_prefix = get_config_vars('prefix', 'exec_prefix')

self.config_vars = {
self.config_vars = dict(sysconfig.get_config_vars())

self.config_vars.update({
'dist_name': self.distribution.get_name(),
'dist_version': self.distribution.get_version(),
'dist_fullname': self.distribution.get_fullname(),
'py_version': py_version,
'py_version_short': f'{sys.version_info.major}.{sys.version_info.minor}',
'py_version_nodot': f'{sys.version_info.major}{sys.version_info.minor}',
'sys_prefix': prefix,
'prefix': prefix,
'sys_exec_prefix': exec_prefix,
'exec_prefix': exec_prefix,
'sys_prefix': self.config_vars['prefix'],
'sys_exec_prefix': self.config_vars['exec_prefix'],
# Only python 3.2+ has abiflags
'abiflags': getattr(sys, 'abiflags', ''),
'platlibdir': getattr(sys, 'platlibdir', 'lib'),
}
})
with contextlib.suppress(AttributeError):
# only for distutils outside stdlib
self.config_vars.update({
Expand Down

0 comments on commit b789d31

Please sign in to comment.