Skip to content

Commit

Permalink
Move Downloader construction to RequirementPreparer.__init__
Browse files Browse the repository at this point in the history
Just one step away from pulling this out of operations.prepare
altogether.
  • Loading branch information
chrahunt committed Nov 22, 2019
1 parent 3c8be92 commit 59f2206
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def __init__(
self.src_dir = src_dir
self.build_dir = build_dir
self.req_tracker = req_tracker
self.session = session
self.downloader = Downloader(session, progress_bar)
self.finder = finder

# Where still-packed archives should be written to. If None, they are
Expand All @@ -579,8 +579,6 @@ def __init__(
# be combined if we're willing to have non-wheel archives present in
# the wheelhouse output by 'pip wheel'.

self.progress_bar = progress_bar

# Is build isolation allowed?
self.build_isolation = build_isolation

Expand Down Expand Up @@ -680,11 +678,9 @@ def prepare_linked_requirement(
# dedicated dir.
download_dir = self.wheel_download_dir

downloader = Downloader(self.session, self.progress_bar)

try:
unpack_url(
link, req.source_dir, downloader, download_dir,
link, req.source_dir, self.downloader, download_dir,
hashes=hashes,
)
except requests.HTTPError as exc:
Expand Down

0 comments on commit 59f2206

Please sign in to comment.