Deprecate imports when installation has started#13829
Deprecate imports when installation has started#13829notatallshaw wants to merge 8 commits intopypa:mainfrom
Conversation
0e6fd49 to
95b0b44
Compare
|
This approach has a reasonable chance of breaking tools which manipulate pip such as pip-tools, and possibly redistributions of pip. If we agree this is the correct approach we should contact Linux distributions and known tools that are coupled to the internals of pip and see what could be done to make it less likely to break or give configuration options. |
2fe9b9e to
26b00eb
Compare
I've taken the approach I discuss in #13828 (comment) and turned this into a depreciation which makes it significantly safer to roll out. |
|
This is 100% a drive-by review since I have zero free time, but FWIW, if we're going with a warning initially, I'd want the call stack to be printed (or a truncated one, at least) so we can easily identify where these imports are happening. |
Towards #13828
Uses the
addaudithookapproach to what was suggested in the DPO thread on the problems with globally disabling PEP 810 style lazy imports, but had to be expanded a little as various nuances where found while testing.