-
-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add RichPipStreamHandler as allowed handler in repositories/pypi.py #1565
Conversation
…ng handler in repositories/pypi.py
@@ -452,7 +461,7 @@ def _setup_logging(self) -> None: | |||
logger = logging.getLogger() | |||
for handler in logger.handlers: | |||
if handler.name == "console": # pragma: no branch | |||
assert isinstance(handler, logging.StreamHandler) | |||
assert isinstance(handler, compatible_handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's going to take more than this. The RichPipStreamHandler sends its output to a rich console
, not to a stream
.
It looks like this code was added in #949 to fix a problem with displaying the progress bars from pip's verbose output.
But it appears that that fix is no longer needed when the progress bars are rendered using rich
. I tested and if I simply remove lines 451-466 and run pip-compile in verbose mode, the progress bars display fine and the command completes successfully with pip 22.
So I would suggest making these lines conditional on whether RichPipStreamHandler was imported above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected something like this would come up. Thanks for checking! Sounds like a reasonable solution, while I'm not sure if the whole code introduced in #949 can be "reverted / ignored" depending on pip version or we should only skip the assignment of the "proper" stream to the respective handler during execution.
@atugushev would be happy to have your expertise here as you worked on adding this back then in case you have time.
This has been included in #1567, and tests pass. |
to avoid parallel work and confusion, closing this in favour of #1567 |
adressing #1558 .
This needs to tested with actual output. Currently this PR is only adressing the assertion, that now with newest pip version there may be an additional handler - no details inspected about this behaves concretely.
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.