@@ -165,12 +165,6 @@ def unpack_http_url(
165
165
# downloading archives, they have to be unpacked to parse dependencies
166
166
unpack_file (from_path , location , content_type )
167
167
168
- # a download dir is specified; let's copy the archive there
169
- if download_dir and not os .path .exists (
170
- os .path .join (download_dir , link .filename )
171
- ):
172
- _copy_file (from_path , download_dir , link )
173
-
174
168
return from_path
175
169
176
170
@@ -261,12 +255,6 @@ def unpack_file_url(
261
255
# archives, they have to be unpacked to parse dependencies
262
256
unpack_file (from_path , location , content_type )
263
257
264
- # a download dir is specified and not already downloaded
265
- if download_dir and not os .path .exists (
266
- os .path .join (download_dir , link .filename )
267
- ):
268
- _copy_file (from_path , download_dir , link )
269
-
270
258
return from_path
271
259
272
260
@@ -545,6 +533,10 @@ def prepare_linked_requirement(
545
533
if download_dir :
546
534
if link .is_existing_dir ():
547
535
logger .info ('Link is a directory, ignoring download_dir' )
536
+ elif local_path and not os .path .exists (
537
+ os .path .join (download_dir , link .filename )
538
+ ):
539
+ _copy_file (local_path , download_dir , link )
548
540
549
541
if self ._download_should_save :
550
542
# Make a .zip of the source_dir we already created.
0 commit comments