File tree 3 files changed +19
-9
lines changed
3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import absolute_import
2
2
3
+ import os
3
4
import sys
4
5
5
6
# If we are running from a wheel, add the wheel to sys.path
6
7
# This allows the usage python pip-*.whl/pip install pip-*.whl
7
8
if __package__ == '' :
8
- import os
9
9
# __file__ is pip-*.whl/pip/__main__.py
10
10
# first dirname call strips of '/__main__.py', second strips off '/pip'
11
11
# Resulting path is the name of the wheel itself
12
12
# Add that to sys.path so we can import pip
13
13
path = os .path .dirname (os .path .dirname (__file__ ))
14
14
sys .path .insert (0 , path )
15
15
16
- import pip
16
+ import pip # noqa
17
17
18
18
if __name__ == '__main__' :
19
19
sys .exit (pip .main ())
Original file line number Diff line number Diff line change @@ -519,6 +519,10 @@ def _get_hash_from_file(target_file, link):
519
519
return download_hash
520
520
521
521
522
+ def _progress_indicator (iterable , * args , ** kwargs ):
523
+ return iterable
524
+
525
+
522
526
def _download_url (resp , link , content_file ):
523
527
download_hash = None
524
528
if link .hash and link .hash_name :
@@ -587,7 +591,7 @@ def resp_read(chunk_size):
587
591
break
588
592
yield chunk
589
593
590
- progress_indicator = lambda x , * a , ** k : x
594
+ progress_indicator = _progress_indicator
591
595
592
596
if link .netloc == PyPI .netloc :
593
597
url = show_url
Original file line number Diff line number Diff line change @@ -397,22 +397,28 @@ def get_installed_distributions(local_only=True,
397
397
if local_only :
398
398
local_test = dist_is_local
399
399
else :
400
- local_test = lambda d : True
400
+ def local_test (d ):
401
+ return True
401
402
402
403
if include_editables :
403
- editable_test = lambda d : True
404
+ def editable_test (d ):
405
+ return True
404
406
else :
405
- editable_test = lambda d : not dist_is_editable (d )
407
+ def editable_test (d ):
408
+ return not dist_is_editable (d )
406
409
407
410
if editables_only :
408
- editables_only_test = lambda d : dist_is_editable (d )
411
+ def editables_only_test (d ):
412
+ return dist_is_editable (d )
409
413
else :
410
- editables_only_test = lambda d : True
414
+ def editables_only_test (d ):
415
+ return True
411
416
412
417
if user_only :
413
418
user_test = dist_in_usersite
414
419
else :
415
- user_test = lambda d : True
420
+ def user_test (d ):
421
+ return True
416
422
417
423
return [d for d in pkg_resources .working_set
418
424
if local_test (d )
You can’t perform that action at this time.
0 commit comments