Skip to content

Commit 88eb4f0

Browse files
authored
Merge pull request #9813 from sbidoul/update-vendored-20210417-sbi
Update vendored dependencies
2 parents 8fc65ea + d69a2d7 commit 88eb4f0

30 files changed

+6116
-6420
lines changed

news/idna.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade idna to 3.1

news/pep517.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade pep517 to 0.10.0

news/tenacity.vendor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Switch from retrying to tenacity
1+
Upgrade tenacity to 7.0.0

src/pip/_vendor/idna/LICENSE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2013-2021, Kim Davies
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

src/pip/_vendor/idna/LICENSE.rst

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/pip/_vendor/idna/codec.py

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import codecs
33
import re
44

5-
_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')
5+
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
66

77
class Codec(codecs.Codec):
88

99
def encode(self, data, errors='strict'):
1010

1111
if errors != 'strict':
12-
raise IDNAError("Unsupported error handling \"{0}\"".format(errors))
12+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
1313

1414
if not data:
1515
return "", 0
@@ -19,23 +19,23 @@ def encode(self, data, errors='strict'):
1919
def decode(self, data, errors='strict'):
2020

2121
if errors != 'strict':
22-
raise IDNAError("Unsupported error handling \"{0}\"".format(errors))
22+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
2323

2424
if not data:
25-
return u"", 0
25+
return '', 0
2626

2727
return decode(data), len(data)
2828

2929
class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
3030
def _buffer_encode(self, data, errors, final):
3131
if errors != 'strict':
32-
raise IDNAError("Unsupported error handling \"{0}\"".format(errors))
32+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
3333

3434
if not data:
35-
return ("", 0)
35+
return ('', 0)
3636

3737
labels = _unicode_dots_re.split(data)
38-
trailing_dot = u''
38+
trailing_dot = ''
3939
if labels:
4040
if not labels[-1]:
4141
trailing_dot = '.'
@@ -55,37 +55,29 @@ def _buffer_encode(self, data, errors, final):
5555
size += len(label)
5656

5757
# Join with U+002E
58-
result = ".".join(result) + trailing_dot
58+
result = '.'.join(result) + trailing_dot
5959
size += len(trailing_dot)
6060
return (result, size)
6161

6262
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
6363
def _buffer_decode(self, data, errors, final):
6464
if errors != 'strict':
65-
raise IDNAError("Unsupported error handling \"{0}\"".format(errors))
65+
raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
6666

6767
if not data:
68-
return (u"", 0)
69-
70-
# IDNA allows decoding to operate on Unicode strings, too.
71-
if isinstance(data, unicode):
72-
labels = _unicode_dots_re.split(data)
73-
else:
74-
# Must be ASCII string
75-
data = str(data)
76-
unicode(data, "ascii")
77-
labels = data.split(".")
78-
79-
trailing_dot = u''
68+
return ('', 0)
69+
70+
labels = _unicode_dots_re.split(data)
71+
trailing_dot = ''
8072
if labels:
8173
if not labels[-1]:
82-
trailing_dot = u'.'
74+
trailing_dot = '.'
8375
del labels[-1]
8476
elif not final:
8577
# Keep potentially unfinished label until the next call
8678
del labels[-1]
8779
if labels:
88-
trailing_dot = u'.'
80+
trailing_dot = '.'
8981

9082
result = []
9183
size = 0
@@ -95,7 +87,7 @@ def _buffer_decode(self, data, errors, final):
9587
size += 1
9688
size += len(label)
9789

98-
result = u".".join(result) + trailing_dot
90+
result = '.'.join(result) + trailing_dot
9991
size += len(trailing_dot)
10092
return (result, size)
10193

src/pip/_vendor/idna/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ def ToUnicode(label):
88
return decode(label)
99

1010
def nameprep(s):
11-
raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol")
11+
raise NotImplementedError('IDNA 2008 does not utilise nameprep protocol')
1212

src/pip/_vendor/idna/core.py

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77

88
_virama_combining_class = 9
99
_alabel_prefix = b'xn--'
10-
_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')
11-
12-
if sys.version_info[0] >= 3:
13-
unicode = str
14-
unichr = chr
10+
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
1511

1612
class IDNAError(UnicodeError):
1713
""" Base exception for all IDNA-encoding related problems """
@@ -34,10 +30,10 @@ class InvalidCodepointContext(IDNAError):
3430

3531

3632
def _combining_class(cp):
37-
v = unicodedata.combining(unichr(cp))
33+
v = unicodedata.combining(chr(cp))
3834
if v == 0:
39-
if not unicodedata.name(unichr(cp)):
40-
raise ValueError("Unknown character in unicodedata")
35+
if not unicodedata.name(chr(cp)):
36+
raise ValueError('Unknown character in unicodedata')
4137
return v
4238

4339
def _is_script(cp, script):
@@ -47,7 +43,7 @@ def _punycode(s):
4743
return s.encode('punycode')
4844

4945
def _unot(s):
50-
return 'U+{0:04X}'.format(s)
46+
return 'U+{:04X}'.format(s)
5147

5248

5349
def valid_label_length(label):
@@ -72,7 +68,7 @@ def check_bidi(label, check_ltr=False):
7268
direction = unicodedata.bidirectional(cp)
7369
if direction == '':
7470
# String likely comes from a newer version of Unicode
75-
raise IDNABidiError('Unknown directionality in label {0} at position {1}'.format(repr(label), idx))
71+
raise IDNABidiError('Unknown directionality in label {} at position {}'.format(repr(label), idx))
7672
if direction in ['R', 'AL', 'AN']:
7773
bidi_label = True
7874
if not bidi_label and not check_ltr:
@@ -85,7 +81,7 @@ def check_bidi(label, check_ltr=False):
8581
elif direction == 'L':
8682
rtl = False
8783
else:
88-
raise IDNABidiError('First codepoint in label {0} must be directionality L, R or AL'.format(repr(label)))
84+
raise IDNABidiError('First codepoint in label {} must be directionality L, R or AL'.format(repr(label)))
8985

9086
valid_ending = False
9187
number_type = False
@@ -95,7 +91,7 @@ def check_bidi(label, check_ltr=False):
9591
if rtl:
9692
# Bidi rule 2
9793
if not direction in ['R', 'AL', 'AN', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM']:
98-
raise IDNABidiError('Invalid direction for codepoint at position {0} in a right-to-left label'.format(idx))
94+
raise IDNABidiError('Invalid direction for codepoint at position {} in a right-to-left label'.format(idx))
9995
# Bidi rule 3
10096
if direction in ['R', 'AL', 'EN', 'AN']:
10197
valid_ending = True
@@ -111,7 +107,7 @@ def check_bidi(label, check_ltr=False):
111107
else:
112108
# Bidi rule 5
113109
if not direction in ['L', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM']:
114-
raise IDNABidiError('Invalid direction for codepoint at position {0} in a left-to-right label'.format(idx))
110+
raise IDNABidiError('Invalid direction for codepoint at position {} in a left-to-right label'.format(idx))
115111
# Bidi rule 6
116112
if direction in ['L', 'EN']:
117113
valid_ending = True
@@ -212,7 +208,7 @@ def valid_contexto(label, pos, exception=False):
212208

213209
elif cp_value == 0x30fb:
214210
for cp in label:
215-
if cp == u'\u30fb':
211+
if cp == '\u30fb':
216212
continue
217213
if _is_script(cp, 'Hiragana') or _is_script(cp, 'Katakana') or _is_script(cp, 'Han'):
218214
return True
@@ -249,16 +245,16 @@ def check_label(label):
249245
elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTJ']):
250246
try:
251247
if not valid_contextj(label, pos):
252-
raise InvalidCodepointContext('Joiner {0} not allowed at position {1} in {2}'.format(
248+
raise InvalidCodepointContext('Joiner {} not allowed at position {} in {}'.format(
253249
_unot(cp_value), pos+1, repr(label)))
254250
except ValueError:
255-
raise IDNAError('Unknown codepoint adjacent to joiner {0} at position {1} in {2}'.format(
251+
raise IDNAError('Unknown codepoint adjacent to joiner {} at position {} in {}'.format(
256252
_unot(cp_value), pos+1, repr(label)))
257253
elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTO']):
258254
if not valid_contexto(label, pos):
259-
raise InvalidCodepointContext('Codepoint {0} not allowed at position {1} in {2}'.format(_unot(cp_value), pos+1, repr(label)))
255+
raise InvalidCodepointContext('Codepoint {} not allowed at position {} in {}'.format(_unot(cp_value), pos+1, repr(label)))
260256
else:
261-
raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
257+
raise InvalidCodepoint('Codepoint {} at position {} of {} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
262258

263259
check_bidi(label)
264260

@@ -277,7 +273,7 @@ def alabel(label):
277273
if not label:
278274
raise IDNAError('No Input')
279275

280-
label = unicode(label)
276+
label = str(label)
281277
check_label(label)
282278
label = _punycode(label)
283279
label = _alabel_prefix + label
@@ -316,35 +312,35 @@ def ulabel(label):
316312
def uts46_remap(domain, std3_rules=True, transitional=False):
317313
"""Re-map the characters in the string according to UTS46 processing."""
318314
from .uts46data import uts46data
319-
output = u""
315+
output = ''
320316
try:
321317
for pos, char in enumerate(domain):
322318
code_point = ord(char)
323319
uts46row = uts46data[code_point if code_point < 256 else
324-
bisect.bisect_left(uts46data, (code_point, "Z")) - 1]
320+
bisect.bisect_left(uts46data, (code_point, 'Z')) - 1]
325321
status = uts46row[1]
326322
replacement = uts46row[2] if len(uts46row) == 3 else None
327-
if (status == "V" or
328-
(status == "D" and not transitional) or
329-
(status == "3" and not std3_rules and replacement is None)):
323+
if (status == 'V' or
324+
(status == 'D' and not transitional) or
325+
(status == '3' and not std3_rules and replacement is None)):
330326
output += char
331-
elif replacement is not None and (status == "M" or
332-
(status == "3" and not std3_rules) or
333-
(status == "D" and transitional)):
327+
elif replacement is not None and (status == 'M' or
328+
(status == '3' and not std3_rules) or
329+
(status == 'D' and transitional)):
334330
output += replacement
335-
elif status != "I":
331+
elif status != 'I':
336332
raise IndexError()
337-
return unicodedata.normalize("NFC", output)
333+
return unicodedata.normalize('NFC', output)
338334
except IndexError:
339335
raise InvalidCodepoint(
340-
"Codepoint {0} not allowed at position {1} in {2}".format(
336+
'Codepoint {} not allowed at position {} in {}'.format(
341337
_unot(code_point), pos + 1, repr(domain)))
342338

343339

344340
def encode(s, strict=False, uts46=False, std3_rules=False, transitional=False):
345341

346342
if isinstance(s, (bytes, bytearray)):
347-
s = s.decode("ascii")
343+
s = s.decode('ascii')
348344
if uts46:
349345
s = uts46_remap(s, std3_rules, transitional)
350346
trailing_dot = False
@@ -375,15 +371,15 @@ def encode(s, strict=False, uts46=False, std3_rules=False, transitional=False):
375371
def decode(s, strict=False, uts46=False, std3_rules=False):
376372

377373
if isinstance(s, (bytes, bytearray)):
378-
s = s.decode("ascii")
374+
s = s.decode('ascii')
379375
if uts46:
380376
s = uts46_remap(s, std3_rules, False)
381377
trailing_dot = False
382378
result = []
383379
if not strict:
384380
labels = _unicode_dots_re.split(s)
385381
else:
386-
labels = s.split(u'.')
382+
labels = s.split('.')
387383
if not labels or labels == ['']:
388384
raise IDNAError('Empty domain')
389385
if not labels[-1]:
@@ -396,5 +392,5 @@ def decode(s, strict=False, uts46=False, std3_rules=False):
396392
else:
397393
raise IDNAError('Empty label')
398394
if trailing_dot:
399-
result.append(u'')
400-
return u'.'.join(result)
395+
result.append('')
396+
return '.'.join(result)

src/pip/_vendor/idna/idnadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is automatically generated by tools/idna-data
22

3-
__version__ = "13.0.0"
3+
__version__ = '13.0.0'
44
scripts = {
55
'Greek': (
66
0x37000000374,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '2.10'
1+
__version__ = '3.1'
22

0 commit comments

Comments
 (0)