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
Update pypi.py #1559
Update pypi.py #1559
Conversation
Fixes AssertionError in Python>=V3.9.6 with Pip>=22.0.1 at Line 455
for more information, see https://pre-commit.ci
@fsecada01 Hey, there's a typo on line 453 |
It seems that with pip>=22 pip-tools removes dash normalization https://pip.pypa.io/en/stable/news/#id73 even if it was done in pip==21.2 🙄 |
piptools/repositories/pypi.py
Outdated
else: | ||
for handler in logger.handlers: | ||
if isinstance(handler, logging.StreamHandler): | ||
handler.stream = log.stream |
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.
while this is expected to suppress the error, this would lead to not assigning log.stream
to the relevant handler anymore as it's now a different type
Re-inserted handler assertions; included RichPipStreamHandler from pip internal logging module. Fix idea taken from: jazzband#1558 (comment)
for more information, see https://pre-commit.ci
Seems like this pull request resolves the issue more effectively and passes all tests: #1567 I'll wait until the request is approved and merged so this PR can be closed. |
try: | ||
assert isinstance(handler, logging.StreamHandler) | ||
except Exception: | ||
assert isinstance(handler, RichPipStreamHandler) |
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.
try: | |
assert isinstance(handler, logging.StreamHandler) | |
except Exception: | |
assert isinstance(handler, RichPipStreamHandler) | |
assert isinstance(handler, (logging.StreamHandler, RichPipStreamHandler)) |
Fixes AssertionError in Python>=V3.9.6 with Pip>=22.0.1 at Line 455
Addresses AssertionError with Pip V>=22.0.1 on Python V>=3.9.6.
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.