-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
pip.patch
2622 lines (2309 loc) · 103 KB
/
pip.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/pipenv/patched/pip/__init__.py b/pipenv/patched/pip/__init__.py
index 9c1d8f9..83ae0f1 100644
--- a/pipenv/patched/pip/__init__.py
+++ b/pipenv/patched/pip/__init__.py
@@ -18,7 +18,7 @@ import re
# to add socks as yet another dependency for pip, nor do I want to allow-stder
# in the DEP-8 tests, so just suppress the warning. pdb tells me this has to
# be done before the import of pip.vcs.
-from pip._vendor.urllib3.exceptions import DependencyWarning
+from pip9._vendor.urllib3.exceptions import DependencyWarning
warnings.filterwarnings("ignore", category=DependencyWarning) # noqa
# We want to inject the use of SecureTransport as early as possible so that any
@@ -33,29 +33,29 @@ else:
if (sys.platform == "darwin" and
getattr(ssl, "OPENSSL_VERSION_NUMBER", 0) < 0x1000100f): # OpenSSL 1.0.1
try:
- from pip._vendor.urllib3.contrib import securetransport
+ from pip9._vendor.urllib3.contrib import securetransport
except (ImportError, OSError):
pass
else:
securetransport.inject_into_urllib3()
-from pip.exceptions import InstallationError, CommandError, PipError
-from pip.utils import get_installed_distributions, get_prog
-from pip.utils import deprecation, dist_is_editable
-from pip.vcs import git, mercurial, subversion, bazaar # noqa
-from pip.baseparser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
-from pip.commands import get_summaries, get_similar_commands
-from pip.commands import commands_dict
-from pip._vendor.urllib3.exceptions import InsecureRequestWarning
+from pip9.exceptions import InstallationError, CommandError, PipError
+from pip9.utils import get_installed_distributions, get_prog
+from pip9.utils import deprecation, dist_is_editable
+from pip9.vcs import git, mercurial, subversion, bazaar # noqa
+from pip9.baseparser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
+from pip9.commands import get_summaries, get_similar_commands
+from pip9.commands import commands_dict
+from pip9._vendor.urllib3.exceptions import InsecureRequestWarning
# assignment for flake8 to be happy
# This fixes a peculiarity when importing via __import__ - as we are
-# initialising the pip module, "from pip import cmdoptions" is recursive
+# initialising the pip module, "from pip9.import cmdoptions" is recursive
# and appears not to work properly in that situation.
-import pip.cmdoptions
-cmdoptions = pip.cmdoptions
+import pip9.cmdoptions
+cmdoptions = pip9.cmdoptions
# The version as used in the setup.py and the docs conf.py
__version__ = "9.0.3"
@@ -238,7 +238,7 @@ def main(args=None):
sys.exit(1)
# Needed for locale.getpreferredencoding(False) to work
- # in pip.utils.encoding.auto_decode
+ # in pip9.utils.encoding.auto_decode
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error as e:
@@ -266,7 +266,7 @@ class FrozenRequirement(object):
def from_dist(cls, dist, dependency_links):
location = os.path.normcase(os.path.abspath(dist.location))
comments = []
- from pip.vcs import vcs, get_src_requirement
+ from pip9.vcs import vcs, get_src_requirement
if dist_is_editable(dist) and vcs.get_backend_name(location):
editable = True
try:
diff --git a/pipenv/patched/pip/__main__.py b/pipenv/patched/pip/__main__.py
index 5556539..9849a65 100644
--- a/pipenv/patched/pip/__main__.py
+++ b/pipenv/patched/pip/__main__.py
@@ -9,11 +9,11 @@ if __package__ == '':
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off '/pip'
# Resulting path is the name of the wheel itself
- # Add that to sys.path so we can import pip
+ # Add that to sys.path so we can import pip9
path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path)
-import pip # noqa
+import pip9 # noqa
if __name__ == '__main__':
- sys.exit(pip.main())
+ sys.exit(pip9.main())
diff --git a/pipenv/patched/pip/_vendor/__init__.py b/pipenv/patched/pip/_vendor/__init__.py
index bee5f5e..c5ccaf0 100644
--- a/pipenv/patched/pip/_vendor/__init__.py
+++ b/pipenv/patched/pip/_vendor/__init__.py
@@ -1,8 +1,8 @@
"""
-pip._vendor is for vendoring dependencies of pip to prevent needing pip to
+pip9._vendor is for vendoring dependencies of pip to prevent needing pip to
depend on something external.
-Files inside of pip._vendor should be considered immutable and should only be
+Files inside of pip9._vendor should be considered immutable and should only be
updated to versions from upstream.
"""
from __future__ import absolute_import
@@ -13,7 +13,7 @@ import sys
# Downstream redistributors which have debundled our dependencies should also
# patch this value to be true. This will trigger the additional patching
-# to cause things like "six" to be available as pip.
+# to cause things like "six" to be available as pip9.
DEBUNDLED = False
# By default, look in this directory for a bunch of .whl files which we will
@@ -36,7 +36,7 @@ def vendored(modulename):
__import__(modulename, globals(), locals(), level=0)
except ImportError:
# We can just silently allow import failures to pass here. If we
- # got to this point it means that ``import pip._vendor.whatever``
+ # got to this point it means that ``import pip9._vendor.whatever``
# failed and so did ``import whatever``. Since we're importing this
# upfront in an attempt to alias imports, not erroring here will
# just mean we get a regular import error whenever pip *actually*
diff --git a/pipenv/patched/pip/_vendor/cachecontrol/_cmd.py b/pipenv/patched/pip/_vendor/cachecontrol/_cmd.py
index afdcc88..c338f4c 100644
--- a/pipenv/patched/pip/_vendor/cachecontrol/_cmd.py
+++ b/pipenv/patched/pip/_vendor/cachecontrol/_cmd.py
@@ -1,10 +1,10 @@
import logging
-from pip._vendor import requests
+from pip9._vendor import requests
-from pip._vendor.cachecontrol.adapter import CacheControlAdapter
-from pip._vendor.cachecontrol.cache import DictCache
-from pip._vendor.cachecontrol.controller import logger
+from pip9._vendor.cachecontrol.adapter import CacheControlAdapter
+from pip9._vendor.cachecontrol.cache import DictCache
+from pip9._vendor.cachecontrol.controller import logger
from argparse import ArgumentParser
diff --git a/pipenv/patched/pip/_vendor/cachecontrol/adapter.py b/pipenv/patched/pip/_vendor/cachecontrol/adapter.py
index 2348856..b5525f0 100644
--- a/pipenv/patched/pip/_vendor/cachecontrol/adapter.py
+++ b/pipenv/patched/pip/_vendor/cachecontrol/adapter.py
@@ -1,7 +1,7 @@
import types
import functools
-from pip._vendor.requests.adapters import HTTPAdapter
+from pip9._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
diff --git a/pipenv/patched/pip/_vendor/cachecontrol/caches/file_cache.py b/pipenv/patched/pip/_vendor/cachecontrol/caches/file_cache.py
index b77728f..443887c 100644
--- a/pipenv/patched/pip/_vendor/cachecontrol/caches/file_cache.py
+++ b/pipenv/patched/pip/_vendor/cachecontrol/caches/file_cache.py
@@ -1,8 +1,8 @@
import hashlib
import os
-from pip._vendor.lockfile import LockFile
-from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
+from pip9._vendor.lockfile import LockFile
+from pip9._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
diff --git a/pipenv/patched/pip/_vendor/cachecontrol/compat.py b/pipenv/patched/pip/_vendor/cachecontrol/compat.py
index 018e6ac..3c0ffa8 100644
--- a/pipenv/patched/pip/_vendor/cachecontrol/compat.py
+++ b/pipenv/patched/pip/_vendor/cachecontrol/compat.py
@@ -10,8 +10,8 @@ except ImportError:
import pickle
-from pip._vendor.urllib3.response import HTTPResponse
-from pip._vendor.urllib3.util import is_fp_closed
+from pip9._vendor.urllib3.response import HTTPResponse
+from pip9._vendor.urllib3.util import is_fp_closed
# Replicate some six behaviour
try:
diff --git a/pipenv/patched/pip/_vendor/cachecontrol/controller.py b/pipenv/patched/pip/_vendor/cachecontrol/controller.py
index 5eb961f..137436a 100644
--- a/pipenv/patched/pip/_vendor/cachecontrol/controller.py
+++ b/pipenv/patched/pip/_vendor/cachecontrol/controller.py
@@ -7,7 +7,7 @@ import calendar
import time
from email.utils import parsedate_tz
-from pip._vendor.requests.structures import CaseInsensitiveDict
+from pip9._vendor.requests.structures import CaseInsensitiveDict
from .cache import DictCache
from .serialize import Serializer
diff --git a/pipenv/patched/pip/_vendor/cachecontrol/serialize.py b/pipenv/patched/pip/_vendor/cachecontrol/serialize.py
index 8f9c589..41f4d9a 100644
--- a/pipenv/patched/pip/_vendor/cachecontrol/serialize.py
+++ b/pipenv/patched/pip/_vendor/cachecontrol/serialize.py
@@ -3,7 +3,7 @@ import io
import json
import zlib
-from pip._vendor.requests.structures import CaseInsensitiveDict
+from pip9._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
diff --git a/pipenv/patched/pip/_vendor/html5lib/_inputstream.py b/pipenv/patched/pip/_vendor/html5lib/_inputstream.py
index 7c5639f..249b0c5 100644
--- a/pipenv/patched/pip/_vendor/html5lib/_inputstream.py
+++ b/pipenv/patched/pip/_vendor/html5lib/_inputstream.py
@@ -1,12 +1,12 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type, binary_type
-from pip._vendor.six.moves import http_client, urllib
+from pip9._vendor.six import text_type, binary_type
+from pip9._vendor.six.moves import http_client, urllib
import codecs
import re
-from pip._vendor import webencodings
+from pip9._vendor import webencodings
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import ReparseException
diff --git a/pipenv/patched/pip/_vendor/html5lib/_tokenizer.py b/pipenv/patched/pip/_vendor/html5lib/_tokenizer.py
index 178f6e7..d472625 100644
--- a/pipenv/patched/pip/_vendor/html5lib/_tokenizer.py
+++ b/pipenv/patched/pip/_vendor/html5lib/_tokenizer.py
@@ -1,6 +1,6 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import unichr as chr
+from pip9._vendor.six import unichr as chr
from collections import deque
diff --git a/pipenv/patched/pip/_vendor/html5lib/_trie/datrie.py b/pipenv/patched/pip/_vendor/html5lib/_trie/datrie.py
index e2e5f86..2050ac4 100644
--- a/pipenv/patched/pip/_vendor/html5lib/_trie/datrie.py
+++ b/pipenv/patched/pip/_vendor/html5lib/_trie/datrie.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
from ._base import Trie as ABCTrie
diff --git a/pipenv/patched/pip/_vendor/html5lib/_trie/py.py b/pipenv/patched/pip/_vendor/html5lib/_trie/py.py
index c178b21..226e903 100644
--- a/pipenv/patched/pip/_vendor/html5lib/_trie/py.py
+++ b/pipenv/patched/pip/_vendor/html5lib/_trie/py.py
@@ -1,5 +1,5 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
from bisect import bisect_left
diff --git a/pipenv/patched/pip/_vendor/html5lib/_utils.py b/pipenv/patched/pip/_vendor/html5lib/_utils.py
index 55d6747..0610419 100644
--- a/pipenv/patched/pip/_vendor/html5lib/_utils.py
+++ b/pipenv/patched/pip/_vendor/html5lib/_utils.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, division, unicode_literals
import sys
from types import ModuleType
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
try:
import xml.etree.cElementTree as default_etree
diff --git a/pipenv/patched/pip/_vendor/html5lib/filters/lint.py b/pipenv/patched/pip/_vendor/html5lib/filters/lint.py
index 3b892c8..09a2702 100644
--- a/pipenv/patched/pip/_vendor/html5lib/filters/lint.py
+++ b/pipenv/patched/pip/_vendor/html5lib/filters/lint.py
@@ -1,6 +1,6 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
from . import base
from ..constants import namespaces, voidElements
diff --git a/pipenv/patched/pip/_vendor/html5lib/filters/sanitizer.py b/pipenv/patched/pip/_vendor/html5lib/filters/sanitizer.py
index 026748d..e70bfba 100644
--- a/pipenv/patched/pip/_vendor/html5lib/filters/sanitizer.py
+++ b/pipenv/patched/pip/_vendor/html5lib/filters/sanitizer.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
-from pip._vendor.six.moves import urllib_parse as urlparse
+from pip9._vendor.six.moves import urllib_parse as urlparse
from . import base
from ..constants import namespaces, prefixes
diff --git a/pipenv/patched/pip/_vendor/html5lib/html5parser.py b/pipenv/patched/pip/_vendor/html5lib/html5parser.py
index f7043cb..dea0295 100644
--- a/pipenv/patched/pip/_vendor/html5lib/html5parser.py
+++ b/pipenv/patched/pip/_vendor/html5lib/html5parser.py
@@ -1,12 +1,12 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import with_metaclass, viewkeys, PY3
+from pip9._vendor.six import with_metaclass, viewkeys, PY3
import types
try:
from collections import OrderedDict
except ImportError:
- from pip._vendor.ordereddict import OrderedDict
+ from pip9._vendor.ordereddict import OrderedDict
from . import _inputstream
from . import _tokenizer
diff --git a/pipenv/patched/pip/_vendor/html5lib/serializer.py b/pipenv/patched/pip/_vendor/html5lib/serializer.py
index 2fb3481..f7203e2 100644
--- a/pipenv/patched/pip/_vendor/html5lib/serializer.py
+++ b/pipenv/patched/pip/_vendor/html5lib/serializer.py
@@ -1,5 +1,5 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
import re
diff --git a/pipenv/patched/pip/_vendor/html5lib/treebuilders/base.py b/pipenv/patched/pip/_vendor/html5lib/treebuilders/base.py
index 9798f7c..f0539cd 100644
--- a/pipenv/patched/pip/_vendor/html5lib/treebuilders/base.py
+++ b/pipenv/patched/pip/_vendor/html5lib/treebuilders/base.py
@@ -1,5 +1,5 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
diff --git a/pipenv/patched/pip/_vendor/html5lib/treebuilders/etree.py b/pipenv/patched/pip/_vendor/html5lib/treebuilders/etree.py
index 0dedf44..ba5237b 100644
--- a/pipenv/patched/pip/_vendor/html5lib/treebuilders/etree.py
+++ b/pipenv/patched/pip/_vendor/html5lib/treebuilders/etree.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import, division, unicode_literals
# pylint:disable=protected-access
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
import re
diff --git a/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree.py b/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree.py
index bcf17d1..197c8e8 100644
--- a/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree.py
+++ b/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree.py
@@ -10,7 +10,7 @@ except ImportError:
import re
-from pip._vendor.six import string_types
+from pip9._vendor.six import string_types
from . import base
from .._utils import moduleFactoryFactory
diff --git a/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree_lxml.py b/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree_lxml.py
index e81ddf3..4de0dd0 100644
--- a/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree_lxml.py
+++ b/pipenv/patched/pip/_vendor/html5lib/treewalkers/etree_lxml.py
@@ -1,5 +1,5 @@
from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type
+from pip9._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
diff --git a/pipenv/patched/pip/_vendor/packaging/markers.py b/pipenv/patched/pip/_vendor/packaging/markers.py
index f9ca1ff..d2381c0 100644
--- a/pipenv/patched/pip/_vendor/packaging/markers.py
+++ b/pipenv/patched/pip/_vendor/packaging/markers.py
@@ -8,11 +8,11 @@ import os
import platform
import sys
-from pip._vendor.pyparsing import (
+from pip9._vendor.pyparsing import (
ParseException, ParseResults, stringStart, stringEnd,
)
-from pip._vendor.pyparsing import ZeroOrMore, Group, Forward, QuotedString
-from pip._vendor.pyparsing import Literal as L # noqa
+from pip9._vendor.pyparsing import ZeroOrMore, Group, Forward, QuotedString
+from pip9._vendor.pyparsing import Literal as L # noqa
from ._compat import string_types
from .specifiers import Specifier, InvalidSpecifier
diff --git a/pipenv/patched/pip/_vendor/packaging/requirements.py b/pipenv/patched/pip/_vendor/packaging/requirements.py
index 49a4385..46381d4 100644
--- a/pipenv/patched/pip/_vendor/packaging/requirements.py
+++ b/pipenv/patched/pip/_vendor/packaging/requirements.py
@@ -6,12 +6,12 @@ from __future__ import absolute_import, division, print_function
import string
import re
-from pip._vendor.pyparsing import (
+from pip9._vendor.pyparsing import (
stringStart, stringEnd, originalTextFor, ParseException
)
-from pip._vendor.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
-from pip._vendor.pyparsing import Literal as L # noqa
-from pip._vendor.six.moves.urllib import parse as urlparse
+from pip9._vendor.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
+from pip9._vendor.pyparsing import Literal as L # noqa
+from pip9._vendor.six.moves.urllib import parse as urlparse
from .markers import MARKER_EXPR, Marker
from .specifiers import LegacySpecifier, Specifier, SpecifierSet
diff --git a/pipenv/patched/pip/_vendor/pkg_resources/__init__.py b/pipenv/patched/pip/_vendor/pkg_resources/__init__.py
index b8e598b..7b7da00 100644
--- a/pipenv/patched/pip/_vendor/pkg_resources/__init__.py
+++ b/pipenv/patched/pip/_vendor/pkg_resources/__init__.py
@@ -45,8 +45,8 @@ except ImportError:
# Python 3.2 compatibility
import imp as _imp
-from pip._vendor import six
-from pip._vendor.six.moves import urllib, map, filter
+from pip9._vendor import six
+from pip9._vendor.six.moves import urllib, map, filter
# capture these to bypass sandboxing
from os import utime
@@ -67,20 +67,15 @@ try:
except ImportError:
importlib_machinery = None
-from pip._vendor import appdirs
-from pip._vendor import packaging
-__import__('pip._vendor.packaging.version')
-__import__('pip._vendor.packaging.specifiers')
-__import__('pip._vendor.packaging.requirements')
-__import__('pip._vendor.packaging.markers')
-
+from pip9._vendor import appdirs
+from pip9._vendor import packaging
+__import__('pip9._vendor.packaging.version')
+__import__('pip9._vendor.packaging.specifiers')
+__import__('pip9._vendor.packaging.requirements')
+__import__('pip9._vendor.packaging.markers')
if (3, 0) < sys.version_info < (3, 3):
- msg = (
- "Support for Python 3.0-3.2 has been dropped. Future versions "
- "will fail here."
- )
- warnings.warn(msg)
+ raise RuntimeError("Python 3.3 or later is required")
# declare some globals that will be defined later to
# satisfy the linters.
@@ -791,7 +786,7 @@ class WorkingSet(object):
self._added_new(dist)
def resolve(self, requirements, env=None, installer=None,
- replace_conflicting=False):
+ replace_conflicting=False, extras=None):
"""List all distributions needed to (recursively) meet `requirements`
`requirements` must be a sequence of ``Requirement`` objects. `env`,
@@ -807,6 +802,12 @@ class WorkingSet(object):
the wrong version. Otherwise, if an `installer` is supplied it will be
invoked to obtain the correct version of the requirement and activate
it.
+
+ `extras` is a list of the extras to be used with these requirements.
+ This is important because extra requirements may look like `my_req;
+ extra = "my_extra"`, which would otherwise be interpreted as a purely
+ optional requirement. Instead, we want to be able to assert that these
+ requirements are truly required.
"""
# set up the stack
@@ -830,7 +831,7 @@ class WorkingSet(object):
# Ignore cyclic or redundant dependencies
continue
- if not req_extras.markers_pass(req):
+ if not req_extras.markers_pass(req, extras):
continue
dist = best.get(req.key)
@@ -1009,7 +1010,7 @@ class _ReqExtras(dict):
Map each requirement to the extras that demanded it.
"""
- def markers_pass(self, req):
+ def markers_pass(self, req, extras=None):
"""
Evaluate markers for req against each extra that
demanded it.
@@ -1019,7 +1020,7 @@ class _ReqExtras(dict):
"""
extra_evals = (
req.marker.evaluate({'extra': extra})
- for extra in self.get(req, ()) + (None,)
+ for extra in self.get(req, ()) + (extras or (None,))
)
return not req.marker or any(extra_evals)
@@ -1956,6 +1957,12 @@ def find_eggs_in_zip(importer, path_item, only=False):
subpath = os.path.join(path_item, subitem)
for dist in find_eggs_in_zip(zipimport.zipimporter(subpath), subpath):
yield dist
+ elif subitem.lower().endswith('.dist-info'):
+ subpath = os.path.join(path_item, subitem)
+ submeta = EggMetadata(zipimport.zipimporter(subpath))
+ submeta.egg_info = subpath
+ yield Distribution.from_location(path_item, subitem, submeta)
+
register_finder(zipimport.zipimporter, find_eggs_in_zip)
@@ -2118,6 +2125,10 @@ def _rebuild_mod_path(orig_path, package_name, module):
parts = path_parts[:-module_parts]
return safe_sys_path_index(_normalize_cached(os.sep.join(parts)))
+ if not isinstance(orig_path, list):
+ # Is this behavior useful when module.__path__ is not a list?
+ return
+
orig_path.sort(key=position_in_sys_path)
module.__path__[:] = [_normalize_cached(p) for p in orig_path]
@@ -2304,8 +2315,14 @@ class EntryPoint(object):
def require(self, env=None, installer=None):
if self.extras and not self.dist:
raise UnknownExtra("Can't require() without a distribution", self)
+
+ # Get the requirements for this entry point with all its extras and
+ # then resolve them. We have to pass `extras` along when resolving so
+ # that the working set knows what extras we want. Otherwise, for
+ # dist-info distributions, the working set will assume that the
+ # requirements for that extra are purely optional and skip over them.
reqs = self.dist.requires(self.extras)
- items = working_set.resolve(reqs, env, installer)
+ items = working_set.resolve(reqs, env, installer, extras=self.extras)
list(map(working_set.add, items))
pattern = re.compile(
@@ -3010,9 +3027,11 @@ def _initialize(g=globals()):
"Set up global resource manager (deliberately not state-saved)"
manager = ResourceManager()
g['_manager'] = manager
- for name in dir(manager):
- if not name.startswith('_'):
- g[name] = getattr(manager, name)
+ g.update(
+ (name, getattr(manager, name))
+ for name in dir(manager)
+ if not name.startswith('_')
+ )
@_call_aside
@@ -3041,10 +3060,10 @@ def _initialize_master_working_set():
# ensure that all distributions added to the working set in the future
# (e.g. by calling ``require()``) will get activated as well,
# with higher priority (replace=True).
- dist = None # ensure dist is defined for del dist below
- for dist in working_set:
+ tuple(
dist.activate(replace=False)
- del dist
+ for dist in working_set
+ )
add_activation_listener(lambda dist: dist.activate(replace=True), existing=False)
working_set.entries = []
# match order
diff --git a/pipenv/patched/pip/_vendor/re-vendor.py b/pipenv/patched/pip/_vendor/re-vendor.py
index 0a52123..5841a2f 100644
--- a/pipenv/patched/pip/_vendor/re-vendor.py
+++ b/pipenv/patched/pip/_vendor/re-vendor.py
@@ -1,6 +1,6 @@
import os
import sys
-import pip
+import pip9
import glob
import shutil
@@ -19,7 +19,7 @@ def clean():
os.unlink(os.path.join(here, 'six.py'))
def vendor():
- pip.main(['install', '-t', here, '-r', 'vendor.txt'])
+ pip9.main(['install', '-t', here, '-r', 'vendor.txt'])
for dirname in glob.glob('*.egg-info'):
shutil.rmtree(dirname)
diff --git a/pipenv/patched/pip/_vendor/retrying.py b/pipenv/patched/pip/_vendor/retrying.py
index 6d1e627..dd3b720 100644
--- a/pipenv/patched/pip/_vendor/retrying.py
+++ b/pipenv/patched/pip/_vendor/retrying.py
@@ -13,7 +13,7 @@
## limitations under the License.
import random
-from pip._vendor import six
+from pip9._vendor import six
import sys
import time
import traceback
diff --git a/pipenv/patched/pip/basecommand.py b/pipenv/patched/pip/basecommand.py
index 54c6706..8e11f17 100644
--- a/pipenv/patched/pip/basecommand.py
+++ b/pipenv/patched/pip/basecommand.py
@@ -7,23 +7,23 @@ import sys
import optparse
import warnings
-from pip import cmdoptions
-from pip.index import PackageFinder
-from pip.locations import running_under_virtualenv
-from pip.download import PipSession
-from pip.exceptions import (BadCommand, InstallationError, UninstallationError,
+from pip9 import cmdoptions
+from pip9.index import PackageFinder
+from pip9.locations import running_under_virtualenv
+from pip9.download import pip9Session
+from pip9.exceptions import (BadCommand, InstallationError, UninstallationError,
CommandError, PreviousBuildDirError)
-from pip.compat import logging_dictConfig
-from pip.baseparser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
-from pip.req import InstallRequirement, parse_requirements
-from pip.status_codes import (
+from pip9.compat import logging_dictConfig
+from pip9.baseparser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
+from pip9.req import InstallRequirement, parse_requirements
+from pip9.status_codes import (
SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND,
PREVIOUS_BUILD_DIR_ERROR,
)
-from pip.utils import deprecation, get_prog, normalize_path
-from pip.utils.logging import IndentingFormatter
-from pip.utils.outdated import pip_version_check
+from pip9.utils import deprecation, get_prog, normalize_path
+from pip9.utils.logging import IndentingFormatter
+from pip9.utils.outdated import pip9_version_check
__all__ = ['Command']
@@ -128,7 +128,7 @@ class Command(object):
"disable_existing_loggers": False,
"filters": {
"exclude_warnings": {
- "()": "pip.utils.logging.MaxLevelFilter",
+ "()": "pip9.utils.logging.MaxLevelFilter",
"level": logging.WARNING,
},
},
@@ -141,20 +141,20 @@ class Command(object):
"handlers": {
"console": {
"level": level,
- "class": "pip.utils.logging.ColorizedStreamHandler",
+ "class": "pip9.utils.logging.ColorizedStreamHandler",
"stream": self.log_streams[0],
"filters": ["exclude_warnings"],
"formatter": "indent",
},
"console_errors": {
"level": "WARNING",
- "class": "pip.utils.logging.ColorizedStreamHandler",
+ "class": "pip9.utils.logging.ColorizedStreamHandler",
"stream": self.log_streams[1],
"formatter": "indent",
},
"user_log": {
"level": "DEBUG",
- "class": "pip.utils.logging.BetterRotatingFileHandler",
+ "class": "pip9.utils.logging.BetterRotatingFileHandler",
"filename": options.log or "/dev/null",
"delay": True,
"formatter": "indent",
@@ -169,7 +169,7 @@ class Command(object):
])),
},
# Disable any logging besides WARNING unless we have DEBUG level
- # logging enabled. These use both pip._vendor and the bare names
+ # logging enabled. These use both pip9._vendor and the bare names
# for the case where someone unbundles our libraries.
"loggers": dict(
(
@@ -182,7 +182,7 @@ class Command(object):
),
},
)
- for name in ["pip._vendor", "distlib", "requests", "urllib3"]
+ for name in ["pip9._vendor", "distlib", "requests", "urllib3"]
),
})
diff --git a/pipenv/patched/pip/baseparser.py b/pipenv/patched/pip/baseparser.py
index 2dd4533..dc28d4c 100644
--- a/pipenv/patched/pip/baseparser.py
+++ b/pipenv/patched/pip/baseparser.py
@@ -8,13 +8,13 @@ import re
import textwrap
from distutils.util import strtobool
-from pip._vendor.six import string_types
-from pip._vendor.six.moves import configparser
-from pip.locations import (
+from pip9._vendor.six import string_types
+from pip9._vendor.six.moves import configparser
+from pip9.locations import (
legacy_config_file, config_basename, running_under_virtualenv,
site_config_files
)
-from pip.utils import appdirs, get_terminal_size
+from pip9.utils import appdirs, get_terminal_size
_environ_prefix_re = re.compile(r"^PIP_", re.I)
diff --git a/pipenv/patched/pip/cmdoptions.py b/pipenv/patched/pip/cmdoptions.py
index f71488c..fd1864e 100644
--- a/pipenv/patched/pip/cmdoptions.py
+++ b/pipenv/patched/pip/cmdoptions.py
@@ -13,12 +13,12 @@ from functools import partial
from optparse import OptionGroup, SUPPRESS_HELP, Option
import warnings
-from pip.index import (
+from pip9.index import (
FormatControl, fmt_ctl_handle_mutual_exclude, fmt_ctl_no_binary,
fmt_ctl_no_use_wheel)
-from pip.models import PyPI
-from pip.locations import USER_CACHE_DIR, src_prefix
-from pip.utils.hashes import STRONG_HASHES
+from pip9.models import PyPI
+from pip9.locations import USER_CACHE_DIR, src_prefix
+from pip9.utils.hashes import STRONG_HASHES
def make_option_group(group, parser):
diff --git a/pipenv/patched/pip/commands/__init__.py b/pipenv/patched/pip/commands/__init__.py
index 62c64eb..646c8a1 100644
--- a/pipenv/patched/pip/commands/__init__.py
+++ b/pipenv/patched/pip/commands/__init__.py
@@ -3,18 +3,18 @@ Package containing all pip commands
"""
from __future__ import absolute_import
-from pip.commands.completion import CompletionCommand
-from pip.commands.download import DownloadCommand
-from pip.commands.freeze import FreezeCommand
-from pip.commands.hash import HashCommand
-from pip.commands.help import HelpCommand
-from pip.commands.list import ListCommand
-from pip.commands.check import CheckCommand
-from pip.commands.search import SearchCommand
-from pip.commands.show import ShowCommand
-from pip.commands.install import InstallCommand
-from pip.commands.uninstall import UninstallCommand
-from pip.commands.wheel import WheelCommand
+from pip9.commands.completion import CompletionCommand
+from pip9.commands.download import DownloadCommand
+from pip9.commands.freeze import FreezeCommand
+from pip9.commands.hash import HashCommand
+from pip9.commands.help import HelpCommand
+from pip9.commands.list import ListCommand
+from pip9.commands.check import CheckCommand
+from pip9.commands.search import SearchCommand
+from pip9.commands.show import ShowCommand
+from pip9.commands.install import InstallCommand
+from pip9.commands.uninstall import UninstallCommand
+from pip9.commands.wheel import WheelCommand
commands_dict = {
diff --git a/pipenv/patched/pip/commands/check.py b/pipenv/patched/pip/commands/check.py
index 70458ad..751878a 100644
--- a/pipenv/patched/pip/commands/check.py
+++ b/pipenv/patched/pip/commands/check.py
@@ -1,8 +1,8 @@
import logging
-from pip.basecommand import Command
-from pip.operations.check import check_requirements
-from pip.utils import get_installed_distributions
+from pip9.basecommand import Command
+from pip9.operations.check import check_requirements
+from pip9.utils import get_installed_distributions
logger = logging.getLogger(__name__)
diff --git a/pipenv/patched/pip/commands/completion.py b/pipenv/patched/pip/commands/completion.py
index 66e41a6..4aaec4a 100644
--- a/pipenv/patched/pip/commands/completion.py
+++ b/pipenv/patched/pip/commands/completion.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
import sys
-from pip.basecommand import Command
+from pip9.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
diff --git a/pipenv/patched/pip/commands/download.py b/pipenv/patched/pip/commands/download.py
index 4bc0640..f7cfe95 100644
--- a/pipenv/patched/pip/commands/download.py
+++ b/pipenv/patched/pip/commands/download.py
@@ -3,14 +3,14 @@ from __future__ import absolute_import
import logging
import os
-from pip.exceptions import CommandError
-from pip.index import FormatControl
-from pip.req import RequirementSet
-from pip.basecommand import RequirementCommand
-from pip import cmdoptions
-from pip.utils import ensure_dir, normalize_path
-from pip.utils.build import BuildDirectory
-from pip.utils.filesystem import check_path_owner
+from pip9.exceptions import CommandError
+from pip9.index import FormatControl
+from pip9.req import RequirementSet
+from pip9.basecommand import RequirementCommand
+from pip9 import cmdoptions
+from pip9.utils import ensure_dir, normalize_path
+from pip9.utils.build import BuildDirectory
+from pip9.utils.filesystem import check_path_owner
logger = logging.getLogger(__name__)
diff --git a/pipenv/patched/pip/commands/freeze.py b/pipenv/patched/pip/commands/freeze.py
index c198796..5a6deb9 100644
--- a/pipenv/patched/pip/commands/freeze.py
+++ b/pipenv/patched/pip/commands/freeze.py
@@ -2,11 +2,11 @@ from __future__ import absolute_import
import sys
-import pip
-from pip.compat import stdlib_pkgs
-from pip.basecommand import Command
-from pip.operations.freeze import freeze
-from pip.wheel import WheelCache
+import pip9
+from pip9.compat import stdlib_pkgs
+from pip9.basecommand import Command
+from pip9.operations.freeze import freeze
+from pip9.wheel import WheelCache
DEV_PKGS = ('pip', 'setuptools', 'distribute', 'wheel')
@@ -67,7 +67,7 @@ class FreezeCommand(Command):
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
- format_control = pip.index.FormatControl(set(), set())
+ format_control = pip9.index.FormatControl(set(), set())
wheel_cache = WheelCache(options.cache_dir, format_control)
skip = set(stdlib_pkgs)
if not options.freeze_all:
diff --git a/pipenv/patched/pip/commands/hash.py b/pipenv/patched/pip/commands/hash.py
index 27cca0b..b3eb173 100644
--- a/pipenv/patched/pip/commands/hash.py
+++ b/pipenv/patched/pip/commands/hash.py
@@ -4,10 +4,10 @@ import hashlib
import logging
import sys
-from pip.basecommand import Command
-from pip.status_codes import ERROR
-from pip.utils import read_chunks
-from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
+from pip9.basecommand import Command
+from pip9.status_codes import ERROR
+from pip9.utils import read_chunks
+from pip9.utils.hashes import FAVORITE_HASH, STRONG_HASHES
logger = logging.getLogger(__name__)
diff --git a/pipenv/patched/pip/commands/help.py b/pipenv/patched/pip/commands/help.py
index 11722f1..0c6bf17 100644
--- a/pipenv/patched/pip/commands/help.py
+++ b/pipenv/patched/pip/commands/help.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
-from pip.basecommand import Command, SUCCESS
-from pip.exceptions import CommandError
+from pip9.basecommand import Command, SUCCESS
+from pip9.exceptions import CommandError
class HelpCommand(Command):
@@ -12,10 +12,10 @@ class HelpCommand(Command):
summary = 'Show help for commands.'
def run(self, options, args):
- from pip.commands import commands_dict, get_similar_commands
+ from pip9.commands import commands_dict, get_similar_commands
try:
- # 'pip help' with no args is handled by pip.__init__.parseopt()
+ # 'pip help' with no args is handled by pip9.__init__.parseopt()
cmd_name = args[0] # the command we need help for
except IndexError:
return SUCCESS
diff --git a/pipenv/patched/pip/commands/install.py b/pipenv/patched/pip/commands/install.py
index 227c526..f1bd795 100644
--- a/pipenv/patched/pip/commands/install.py
+++ b/pipenv/patched/pip/commands/install.py
@@ -11,18 +11,18 @@ try:
except ImportError:
wheel = None
-from pip.req import RequirementSet
-from pip.basecommand import RequirementCommand
-from pip.locations import virtualenv_no_global, distutils_scheme
-from pip.exceptions import (
+from pip9.req import RequirementSet
+from pip9.basecommand import RequirementCommand
+from pip9.locations import virtualenv_no_global, distutils_scheme
+from pip9.exceptions import (
InstallationError, CommandError, PreviousBuildDirError,
)
-from pip import cmdoptions
-from pip.utils import ensure_dir, get_installed_version
-from pip.utils.build import BuildDirectory
-from pip.utils.deprecation import RemovedInPip10Warning
-from pip.utils.filesystem import check_path_owner
-from pip.wheel import WheelCache, WheelBuilder
+from pip9 import cmdoptions
+from pip9.utils import ensure_dir, get_installed_version
+from pip9.utils.build import BuildDirectory
+from pip9.utils.deprecation import RemovedInPip10Warning
+from pip9.utils.filesystem import check_path_owner
+from pip9.wheel import WheelCache, WheelBuilder
logger = logging.getLogger(__name__)
diff --git a/pipenv/patched/pip/commands/list.py b/pipenv/patched/pip/commands/list.py
index 6f6995d..9f36140 100644
--- a/pipenv/patched/pip/commands/list.py
+++ b/pipenv/patched/pip/commands/list.py
@@ -8,15 +8,15 @@ try:
except ImportError:
from itertools import izip_longest as zip_longest
-from pip._vendor import six
+from pip9._vendor import six
-from pip.basecommand import Command
-from pip.exceptions import CommandError
-from pip.index import PackageFinder
-from pip.utils import (
+from pip9.basecommand import Command
+from pip9.exceptions import CommandError
+from pip9.index import PackageFinder
+from pip9.utils import (
get_installed_distributions, dist_is_editable)
-from pip.utils.deprecation import RemovedInPip10Warning
-from pip.cmdoptions import make_option_group, index_group
+from pip9.utils.deprecation import RemovedInPip10Warning
+from pip9.cmdoptions import make_option_group, index_group
logger = logging.getLogger(__name__)
@@ -138,7 +138,7 @@ class ListCommand(Command):
warnings.warn(
"The default format will switch to columns in the future. "
"You can use --format=(legacy|columns) (or define a "
- "format=(legacy|columns) in your pip.conf under the [list] "
+ "format=(legacy|columns) in your pip9.conf under the [list] "
"section) to disable this warning.",
RemovedInPip10Warning,
)
diff --git a/pipenv/patched/pip/commands/search.py b/pipenv/patched/pip/commands/search.py
index bd2ea8a..30fa54c 100644
--- a/pipenv/patched/pip/commands/search.py
+++ b/pipenv/patched/pip/commands/search.py
@@ -4,17 +4,17 @@ import logging
import sys
import textwrap
-from pip.basecommand import Command, SUCCESS
-from pip.compat import OrderedDict