Closed kemzeb closed 5 months ago
Still working on this, I'll see if I can finish this and open it for review by the end of today.
Did a redesign and this seems to be a better implementation than the last. Just need to add coverage tests then I'll open this PR for review
I think this is ready to go, going to open this for review
Here are my design decisions:
_warning
module; did try to add it to render
but I encountered dependency cycle errorsWarningPrinter
class, where I also exposed a shared module-level singleton of it--warn fail
is passed. My reasoning for this is that Python allows these duplicate distributions to exist and pip actively ignores them.WarningPrinter.print_multi_line()
to pass what file to write to to the callback so that we avoid throwing sys.stderr
everywhere, but due to an odd long-standing bug with the capsys
/capfd
fixtures, it won't properly capture sys.stderr
if we were to pass it down to the callback.Ignore my previous deleted comment, I've reconsidered and the handling of "duplicated" here should be fine.
No questions for me here. But I don't have the approve auth, so maybe need to wait for @gaborbernat to take a further look.
Great, will release 2.19.0 after merging this
This resolves #355 by making changes and refactors to the warning logic. It does so by introducing a module-level singleton "WarningPrinter" object and refactors the code in such a way to integrate this object for it to be used.