Skip to content

Commit 7afc733

Browse files
authored
pep 484: more reexports (#4607)
There are still a couple more, but hopefully this fixes CI. It's a little bit of a chore to track down some of these; it looks like master differs from latest release for a number of them. Co-authored-by: hauntsaninja <>
1 parent e0a3644 commit 7afc733

File tree

9 files changed

+31
-27
lines changed

9 files changed

+31
-27
lines changed

third_party/2and3/boto/compat.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ from typing import Any
44
if sys.version_info >= (3,):
55
from base64 import encodebytes as encodebytes
66
else:
7-
from base64 import encodestring as encodebytes
7+
from base64 import encodestring
8+
9+
encodebytes = encodestring
810

911
expanduser: Any
1012

third_party/2and3/click/types.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import datetime
22
import uuid
33
from typing import IO, Any, Callable, Generic, Iterable, List, Optional, Tuple as _PyTuple, Type, TypeVar, Union
44

5-
from click.core import Context, Parameter, _ConvertibleType, _ParamType as ParamType
5+
from click.core import Context, Parameter, _ConvertibleType, _ParamType
6+
7+
ParamType = _ParamType
68

79
class BoolParamType(ParamType):
810
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> bool: ...

third_party/2and3/jinja2/_compat.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import sys
22
from typing import Any, Optional
33

44
if sys.version_info[0] >= 3:
5-
from urllib.parse import quote_from_bytes as url_quote
5+
from urllib.parse import quote_from_bytes
6+
7+
url_quote = quote_from_bytes
68
else:
7-
from urllib import quote as url_quote
9+
import urllib
10+
11+
url_quote = urllib.quote
812

913
PY2: Any
1014
PYPY: Any

third_party/2and3/werkzeug/_compat.pyi

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import sys
22
from typing import Any, Optional, Text
33

4-
if sys.version_info < (3,):
5-
import StringIO as BytesIO
4+
if sys.version_info >= (3,):
5+
from io import BytesIO as BytesIO, StringIO as StringIO
6+
7+
NativeStringIO = StringIO
68
else:
7-
from io import StringIO as BytesIO
9+
import cStringIO
10+
from StringIO import StringIO as StringIO
11+
12+
BytesIO = cStringIO.StringIO
13+
NativeStringIO = BytesIO
814

915
PY2: Any
1016
WIN: Any
@@ -27,7 +33,6 @@ def native_string_result(func): ...
2733
def implements_bool(cls): ...
2834

2935
range_type: Any
30-
NativeStringIO: Any
3136

3237
def make_literal_wrapper(reference): ...
3338
def normalize_string_tuple(tup): ...

third_party/3/aiofiles/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from . import _os as os
21
from .threadpool import open as open
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
from hashlib import _Hash as _HashAlg
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
import hashlib
12
from typing import Any
23

34
from jwt.algorithms import Algorithm
45

5-
from . import _HashAlg
6-
76
class ECAlgorithm(Algorithm[Any]):
8-
SHA256: _HashAlg
9-
SHA384: _HashAlg
10-
SHA512: _HashAlg
11-
def __init__(self, hash_alg: _HashAlg) -> None: ...
7+
SHA256: hashlib._Hash
8+
SHA384: hashlib._Hash
9+
SHA512: hashlib._Hash
10+
def __init__(self, hash_alg: hashlib._Hash) -> None: ...
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
import hashlib
12
from typing import Any
23

34
from jwt.algorithms import Algorithm
45

5-
from . import _HashAlg
6-
76
class RSAAlgorithm(Algorithm[Any]):
8-
SHA256: _HashAlg
9-
SHA384: _HashAlg
10-
SHA512: _HashAlg
11-
def __init__(self, hash_alg: _HashAlg) -> None: ...
7+
SHA256: hashlib._Hash
8+
SHA384: hashlib._Hash
9+
SHA512: hashlib._Hash
10+
def __init__(self, hash_alg: hashlib._Hash) -> None: ...

third_party/3/waitress/compat.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ import sys
22
from io import TextIOWrapper
33
from typing import Any, Optional, Text, Tuple
44

5-
if sys.version_info[0] == 3:
6-
from urllib import parse as urlparse
7-
else:
8-
import urlparse
9-
105
PY2: bool
116
PY3: bool
127
WIN: bool

0 commit comments

Comments
 (0)