1
- from typing import Optional
2
-
3
-
4
- class StubInfo :
5
- def __init__ (self , name : str , py_version : Optional [int ] = None ) -> None :
6
- self .name = name
7
- # If None, compatible with py2+py3, if 2/3, only compatible with py2/py3
8
- self .py_version = py_version
9
-
10
-
11
- def is_legacy_bundled_package (prefix : str , py_version : int ) -> bool :
12
- if prefix not in legacy_bundled_packages :
13
- return False
14
- package_ver = legacy_bundled_packages [prefix ].py_version
15
- return package_ver is None or package_ver == py_version
1
+ def is_legacy_bundled_package (prefix : str ) -> bool :
2
+ return prefix in legacy_bundled_packages
16
3
17
4
18
5
# Stubs for these third-party packages used to be shipped with mypy.
@@ -21,56 +8,56 @@ def is_legacy_bundled_package(prefix: str, py_version: int) -> bool:
21
8
#
22
9
# Package name can have one or two components ('a' or 'a.b').
23
10
legacy_bundled_packages = {
24
- "aiofiles" : StubInfo ( "types-aiofiles" , py_version = 3 ) ,
25
- "atomicwrites" : StubInfo ( "types-atomicwrites" ) ,
26
- "attr" : StubInfo ( "types-attrs" ) ,
27
- "backports" : StubInfo ( "types-backports" ) ,
28
- "backports_abc" : StubInfo ( "types-backports_abc" ) ,
29
- "bleach" : StubInfo ( "types-bleach" ) ,
30
- "boto" : StubInfo ( "types-boto" ) ,
31
- "cachetools" : StubInfo ( "types-cachetools" ) ,
32
- "chardet" : StubInfo ( "types-chardet" ) ,
33
- "click_spinner" : StubInfo ( "types-click-spinner" ) ,
34
- "contextvars" : StubInfo ( "types-contextvars" , py_version = 3 ) ,
35
- "croniter" : StubInfo ( "types-croniter" ) ,
36
- "dataclasses" : StubInfo ( "types-dataclasses" , py_version = 3 ) ,
37
- "dateparser" : StubInfo ( "types-dateparser" ) ,
38
- "datetimerange" : StubInfo ( "types-DateTimeRange" ) ,
39
- "dateutil" : StubInfo ( "types-python-dateutil" ) ,
40
- "decorator" : StubInfo ( "types-decorator" ) ,
41
- "deprecated" : StubInfo ( "types-Deprecated" ) ,
42
- "docutils" : StubInfo ( "types-docutils" , py_version = 3 ) ,
43
- "emoji" : StubInfo ( "types-emoji" ) ,
44
- "first" : StubInfo ( "types-first" ) ,
45
- "geoip2" : StubInfo ( "types-geoip2" ) ,
46
- "gflags" : StubInfo ( "types-python-gflags" ) ,
47
- "google.protobuf" : StubInfo ( "types-protobuf" ) ,
48
- "markdown" : StubInfo ( "types-Markdown" ) ,
49
- "maxminddb" : StubInfo ( "types-maxminddb" ) ,
50
- "mock" : StubInfo ( "types-mock" ) ,
51
- "OpenSSL" : StubInfo ( "types-pyOpenSSL" ) ,
52
- "paramiko" : StubInfo ( "types-paramiko" ) ,
53
- "pkg_resources" : StubInfo ( "types-setuptools" , py_version = 3 ) ,
54
- "polib" : StubInfo ( "types-polib" ) ,
55
- "pycurl" : StubInfo ( "types-pycurl" ) ,
56
- "pymysql" : StubInfo ( "types-PyMySQL" ) ,
57
- "pyrfc3339" : StubInfo ( "types-pyRFC3339" , py_version = 3 ) ,
58
- "python2" : StubInfo ( "types-six" ) ,
59
- "pytz" : StubInfo ( "types-pytz" ) ,
60
- "pyVmomi" : StubInfo ( "types-pyvmomi" ) ,
61
- "redis" : StubInfo ( "types-redis" ) ,
62
- "requests" : StubInfo ( "types-requests" ) ,
63
- "retry" : StubInfo ( "types-retry" ) ,
64
- "simplejson" : StubInfo ( "types-simplejson" ) ,
65
- "singledispatch" : StubInfo ( "types-singledispatch" ) ,
66
- "six" : StubInfo ( "types-six" ) ,
67
- "slugify" : StubInfo ( "types-python-slugify" ) ,
68
- "tabulate" : StubInfo ( "types-tabulate" ) ,
69
- "termcolor" : StubInfo ( "types-termcolor" ) ,
70
- "toml" : StubInfo ( "types-toml" ) ,
71
- "typed_ast" : StubInfo ( "types-typed-ast" , py_version = 3 ) ,
72
- "tzlocal" : StubInfo ( "types-tzlocal" ) ,
73
- "ujson" : StubInfo ( "types-ujson" ) ,
74
- "waitress" : StubInfo ( "types-waitress" , py_version = 3 ) ,
75
- "yaml" : StubInfo ( "types-PyYAML" ) ,
11
+ "aiofiles" : "types-aiofiles" ,
12
+ "atomicwrites" : "types-atomicwrites" ,
13
+ "attr" : "types-attrs" ,
14
+ "backports" : "types-backports" ,
15
+ "backports_abc" : "types-backports_abc" ,
16
+ "bleach" : "types-bleach" ,
17
+ "boto" : "types-boto" ,
18
+ "cachetools" : "types-cachetools" ,
19
+ "chardet" : "types-chardet" ,
20
+ "click_spinner" : "types-click-spinner" ,
21
+ "contextvars" : "types-contextvars" ,
22
+ "croniter" : "types-croniter" ,
23
+ "dataclasses" : "types-dataclasses" ,
24
+ "dateparser" : "types-dateparser" ,
25
+ "datetimerange" : "types-DateTimeRange" ,
26
+ "dateutil" : "types-python-dateutil" ,
27
+ "decorator" : "types-decorator" ,
28
+ "deprecated" : "types-Deprecated" ,
29
+ "docutils" : "types-docutils" ,
30
+ "emoji" : "types-emoji" ,
31
+ "first" : "types-first" ,
32
+ "geoip2" : "types-geoip2" ,
33
+ "gflags" : "types-python-gflags" ,
34
+ "google.protobuf" : "types-protobuf" ,
35
+ "markdown" : "types-Markdown" ,
36
+ "maxminddb" : "types-maxminddb" ,
37
+ "mock" : "types-mock" ,
38
+ "OpenSSL" : "types-pyOpenSSL" ,
39
+ "paramiko" : "types-paramiko" ,
40
+ "pkg_resources" : "types-setuptools" ,
41
+ "polib" : "types-polib" ,
42
+ "pycurl" : "types-pycurl" ,
43
+ "pymysql" : "types-PyMySQL" ,
44
+ "pyrfc3339" : "types-pyRFC3339" ,
45
+ "python2" : "types-six" ,
46
+ "pytz" : "types-pytz" ,
47
+ "pyVmomi" : "types-pyvmomi" ,
48
+ "redis" : "types-redis" ,
49
+ "requests" : "types-requests" ,
50
+ "retry" : "types-retry" ,
51
+ "simplejson" : "types-simplejson" ,
52
+ "singledispatch" : "types-singledispatch" ,
53
+ "six" : "types-six" ,
54
+ "slugify" : "types-python-slugify" ,
55
+ "tabulate" : "types-tabulate" ,
56
+ "termcolor" : "types-termcolor" ,
57
+ "toml" : "types-toml" ,
58
+ "typed_ast" : "types-typed-ast" ,
59
+ "tzlocal" : "types-tzlocal" ,
60
+ "ujson" : "types-ujson" ,
61
+ "waitress" : "types-waitress" ,
62
+ "yaml" : "types-PyYAML" ,
76
63
}
0 commit comments