44
55from __future__ import annotations
66
7+ import collections
78import contextlib
89import itertools
910import os
1314from site import USER_BASE , USER_SITE
1415from typing import ClassVar
1516
16- import jaraco .collections
17-
1817from ..core import Command
1918from ..debug import DEBUG
2019from ..errors import DistutilsOptionError , DistutilsPlatformError
@@ -145,7 +144,7 @@ def _resolve_scheme(name):
145144 try :
146145 resolved = sysconfig .get_preferred_scheme (key )
147146 except Exception :
148- resolved = fw .scheme (_pypy_hack ( name ) )
147+ resolved = fw .scheme (name )
149148 return resolved
150149
151150
@@ -162,7 +161,7 @@ def _inject_headers(name, scheme):
162161 """
163162 # Bypass the preferred scheme, which may not
164163 # have defined headers.
165- fallback = _load_scheme (_pypy_hack ( name ) )
164+ fallback = _load_scheme (name )
166165 scheme .setdefault ('headers' , fallback ['headers' ])
167166 return scheme
168167
@@ -172,14 +171,6 @@ def _scheme_attrs(scheme):
172171 return {f'install_{ key } ' : scheme [key ] for key in SCHEME_KEYS }
173172
174173
175- def _pypy_hack (name ):
176- PY37 = sys .version_info < (3 , 8 )
177- old_pypy = hasattr (sys , 'pypy_version_info' ) and PY37
178- prefix = not name .endswith (('_user' , '_home' ))
179- pypy_name = 'pypy' + '_nt' * (os .name == 'nt' )
180- return pypy_name if old_pypy and prefix else name
181-
182-
183174class install (Command ):
184175 description = "install everything from build directory"
185176
@@ -432,12 +423,12 @@ def finalize_options(self) -> None: # noqa: C901
432423 local_vars ['userbase' ] = self .install_userbase
433424 local_vars ['usersite' ] = self .install_usersite
434425
435- self .config_vars = jaraco .collections .DictStack ([
436- fw .vars (),
437- compat_vars ,
438- sysconfig .get_config_vars (),
426+ self .config_vars = collections .ChainMap (
439427 local_vars ,
440- ])
428+ sysconfig .get_config_vars (),
429+ compat_vars ,
430+ fw .vars (),
431+ )
441432
442433 self .expand_basedirs ()
443434
0 commit comments