9
9
from pip ._internal .models .scheme import SCHEME_KEYS , Scheme
10
10
from pip ._internal .utils .virtualenv import running_under_virtualenv
11
11
12
- from .base import get_major_minor_version
12
+ from .base import get_major_minor_version , is_osx_framework
13
13
14
14
logger = logging .getLogger (__name__ )
15
15
25
25
_AVAILABLE_SCHEMES = set (sysconfig .get_scheme_names ())
26
26
27
27
28
- def _is_osx_framework () -> bool :
29
- return sysconfig .get_config_var ("PYTHONFRAMEWORK" )
30
-
31
-
32
28
def _infer_prefix ():
33
29
# type: () -> str
34
30
"""Try to find a prefix scheme for the current platform.
@@ -44,7 +40,7 @@ def _infer_prefix():
44
40
45
41
If none of the above works, fall back to ``posix_prefix``.
46
42
"""
47
- os_framework_global = _is_osx_framework () and not running_under_virtualenv ()
43
+ os_framework_global = is_osx_framework () and not running_under_virtualenv ()
48
44
if os_framework_global and "osx_framework_library" in _AVAILABLE_SCHEMES :
49
45
return "osx_framework_library"
50
46
implementation_suffixed = f"{ sys .implementation .name } _{ os .name } "
@@ -63,7 +59,7 @@ def _infer_prefix():
63
59
def _infer_user ():
64
60
# type: () -> str
65
61
"""Try to find a user scheme for the current platform."""
66
- if _is_osx_framework () and not running_under_virtualenv ():
62
+ if is_osx_framework () and not running_under_virtualenv ():
67
63
suffixed = "osx_framework_user"
68
64
else :
69
65
suffixed = f"{ os .name } _user"
0 commit comments