Skip to content

Commit

Permalink
Fix support for pip>=22.1 (#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizpig64 committed May 13, 2022
1 parent 37ce9e3 commit ce441d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion piptools/repositories/pypi.py
Expand Up @@ -20,7 +20,6 @@

from click import progressbar
from pip._internal.cache import WheelCache
from pip._internal.cli.progress_bars import BAR_TYPES
from pip._internal.commands import create_command
from pip._internal.commands.install import InstallCommand
from pip._internal.index.package_finder import PackageFinder
Expand Down Expand Up @@ -473,6 +472,9 @@ def _setup_logging(self) -> None:
# refactored-out logging config.
log.warning("Couldn't find a 'console' logging handler")

# This import will fail with pip 22.1, but here we're pip<22.0
from pip._internal.cli.progress_bars import BAR_TYPES

# Sync pip's progress bars stream with LogContext.stream
for bar_cls in itertools.chain(*BAR_TYPES.values()):
bar_cls.file = log.stream
Expand Down

0 comments on commit ce441d2

Please sign in to comment.