File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/pip/_internal/locations Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ Suppress location mismatch warnings when pip is invoked from a Python source
2
+ tree, so ``ensurepip `` does not emit warnings on CPython ``make install ``.
Original file line number Diff line number Diff line change @@ -303,6 +303,18 @@ def get_scheme(
303
303
if skip_msys2_mingw_bug :
304
304
continue
305
305
306
+ # CPython's POSIX install script invokes pip (via ensurepip) against the
307
+ # interpreter located in the source tree, not the install site. This
308
+ # triggers special logic in sysconfig that's not present in distutils.
309
+ # https://github.com/python/cpython/blob/8c21941ddaf/Lib/sysconfig.py#L178-L194
310
+ skip_cpython_build = (
311
+ sysconfig .is_python_build (check_home = True )
312
+ and not WINDOWS
313
+ and k in ("headers" , "include" , "platinclude" )
314
+ )
315
+ if skip_cpython_build :
316
+ continue
317
+
306
318
warning_contexts .append ((old_v , new_v , f"scheme.{ k } " ))
307
319
308
320
if not warning_contexts :
You can’t perform that action at this time.
0 commit comments