File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/pip/_internal/locations Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11import logging
22import pathlib
3+ import sys
34import sysconfig
45from typing import List , Optional
56
@@ -99,6 +100,21 @@ def get_scheme(
99100 # Extra join because distutils can return relative paths.
100101 old_v = pathlib .Path (base , getattr (old , k ))
101102 new_v = pathlib .Path (getattr (new , k ))
103+
104+ # distutils incorrectly put PyPy packages under ``site-packages/python``
105+ # in the ``posix_home`` scheme, but PyPy devs said they expect the
106+ # directory name to be ``pypy`` instead. So we treat this as a bug fix
107+ # and not warn about it. See bpo-43307 and python/cpython#24628.
108+ skip_pypy_special_case = (
109+ sys .implementation .name == "pypy"
110+ and home is not None
111+ and k in ("platlib" , "purelib" )
112+ and old_v .parent == new_v .parent
113+ and old_v .name == "python" and new_v .name == "pypy"
114+ )
115+ if skip_pypy_special_case :
116+ continue
117+
102118 warned .append (_warn_if_mismatch (old_v , new_v , key = f"scheme.{ k } " ))
103119
104120 if any (warned ):
You can’t perform that action at this time.
0 commit comments