11from __future__ import annotations
22
33
4- def is_module_from_legacy_bundled_package (module : str ) -> bool :
5- top_level = module .split ("." , 1 )[0 ]
6- return top_level in legacy_bundled_packages
7-
8-
94def stub_distribution_name (module : str ) -> str | None :
105 top_level = module .split ("." , 1 )[0 ]
116
12- dist = legacy_bundled_packages .get (top_level )
13- if dist :
14- return dist
157 dist = non_bundled_packages_flat .get (top_level )
168 if dist :
179 return dist
@@ -27,54 +19,6 @@ def stub_distribution_name(module: str) -> str | None:
2719
2820 return None
2921
30-
31- # Stubs for these third-party packages used to be shipped with mypy.
32- #
33- # Map package name to PyPI stub distribution name.
34- legacy_bundled_packages : dict [str , str ] = {
35- "aiofiles" : "types-aiofiles" ,
36- "bleach" : "types-bleach" ,
37- "boto" : "types-boto" ,
38- "cachetools" : "types-cachetools" ,
39- "click_spinner" : "types-click-spinner" ,
40- "contextvars" : "types-contextvars" ,
41- "croniter" : "types-croniter" ,
42- "dataclasses" : "types-dataclasses" ,
43- "dateparser" : "types-dateparser" ,
44- "dateutil" : "types-python-dateutil" ,
45- "decorator" : "types-decorator" ,
46- "deprecated" : "types-Deprecated" ,
47- "docutils" : "types-docutils" ,
48- "first" : "types-first" ,
49- "gflags" : "types-python-gflags" ,
50- "markdown" : "types-Markdown" ,
51- "mock" : "types-mock" ,
52- "OpenSSL" : "types-pyOpenSSL" ,
53- "paramiko" : "types-paramiko" ,
54- "pkg_resources" : "types-setuptools" ,
55- "polib" : "types-polib" ,
56- "pycurl" : "types-pycurl" ,
57- "pymysql" : "types-PyMySQL" ,
58- "pyrfc3339" : "types-pyRFC3339" ,
59- "python2" : "types-six" ,
60- "pytz" : "types-pytz" ,
61- "pyVmomi" : "types-pyvmomi" ,
62- "redis" : "types-redis" ,
63- "requests" : "types-requests" ,
64- "retry" : "types-retry" ,
65- "simplejson" : "types-simplejson" ,
66- "singledispatch" : "types-singledispatch" ,
67- "six" : "types-six" ,
68- "slugify" : "types-python-slugify" ,
69- "tabulate" : "types-tabulate" ,
70- "toml" : "types-toml" ,
71- "typed_ast" : "types-typed-ast" ,
72- "tzlocal" : "types-tzlocal" ,
73- "ujson" : "types-ujson" ,
74- "waitress" : "types-waitress" ,
75- "yaml" : "types-PyYAML" ,
76- }
77-
7822# Map package name to PyPI stub distribution name from typeshed.
7923# Stubs for these packages were never bundled with mypy. Don't
8024# include packages that have a release that includes PEP 561 type
@@ -87,44 +31,58 @@ def stub_distribution_name(module: str) -> str | None:
8731non_bundled_packages_flat : dict [str , str ] = {
8832 "_cffi_backend" : "types-cffi" ,
8933 "_win32typing" : "types-pywin32" ,
34+ "aiofiles" : "types-aiofiles" ,
9035 "antlr4" : "types-antlr4-python3-runtime" ,
9136 "assertpy" : "types-assertpy" ,
9237 "atheris" : "types-atheris" ,
9338 "authlib" : "types-Authlib" ,
9439 "aws_xray_sdk" : "types-aws-xray-sdk" ,
9540 "babel" : "types-babel" ,
41+ "bleach" : "types-bleach" ,
9642 "boltons" : "types-boltons" ,
43+ "boto" : "types-boto" ,
9744 "braintree" : "types-braintree" ,
9845 "bs4" : "types-beautifulsoup4" ,
9946 "bugbear" : "types-flake8-bugbear" ,
47+ "cachetools" : "types-cachetools" ,
10048 "caldav" : "types-caldav" ,
10149 "capturer" : "types-capturer" ,
10250 "cffi" : "types-cffi" ,
10351 "chevron" : "types-chevron" ,
10452 "click_default_group" : "types-click-default-group" ,
10553 "click_log" : "types-click-log" ,
54+ "click_spinner" : "types-click-spinner" ,
10655 "click_web" : "types-click-web" ,
10756 "colorama" : "types-colorama" ,
10857 "commctrl" : "types-pywin32" ,
10958 "commonmark" : "types-commonmark" ,
11059 "consolemenu" : "types-console-menu" ,
60+ "contextvars" : "types-contextvars" ,
11161 "corus" : "types-corus" ,
62+ "croniter" : "types-croniter" ,
11263 "cronlog" : "types-python-crontab" ,
11364 "crontab" : "types-python-crontab" ,
11465 "crontabs" : "types-python-crontab" ,
11566 "d3dshot" : "types-D3DShot" ,
67+ "dataclasses" : "types-dataclasses" ,
11668 "datemath" : "types-python-datemath" ,
11769 "dateparser_data" : "types-dateparser" ,
70+ "dateparser" : "types-dateparser" ,
71+ "dateutil" : "types-python-dateutil" ,
11872 "dde" : "types-pywin32" ,
73+ "decorator" : "types-decorator" ,
11974 "defusedxml" : "types-defusedxml" ,
75+ "deprecated" : "types-Deprecated" ,
12076 "docker" : "types-docker" ,
12177 "dockerfile_parse" : "types-dockerfile-parse" ,
12278 "docopt" : "types-docopt" ,
79+ "docutils" : "types-docutils" ,
12380 "editdistance" : "types-editdistance" ,
12481 "entrypoints" : "types-entrypoints" ,
12582 "exifread" : "types-ExifRead" ,
12683 "fanstatic" : "types-fanstatic" ,
12784 "farmhash" : "types-pyfarmhash" ,
85+ "first" : "types-first" ,
12886 "flake8_2020" : "types-flake8-2020" ,
12987 "flake8_builtins" : "types-flake8-builtins" ,
13088 "flake8_docstrings" : "types-flake8-docstrings" ,
@@ -139,6 +97,7 @@ def stub_distribution_name(module: str) -> str | None:
13997 "fpdf" : "types-fpdf2" ,
14098 "gdb" : "types-gdb" ,
14199 "gevent" : "types-gevent" ,
100+ "gflags" : "types-python-gflags" ,
142101 "greenlet" : "types-greenlet" ,
143102 "hdbcli" : "types-hdbcli" ,
144103 "html5lib" : "types-html5lib" ,
@@ -165,8 +124,10 @@ def stub_distribution_name(module: str) -> str | None:
165124 "lupa" : "types-lupa" ,
166125 "lzstring" : "types-lzstring" ,
167126 "m3u8" : "types-m3u8" ,
127+ "markdown" : "types-Markdown" ,
168128 "mmapfile" : "types-pywin32" ,
169129 "mmsystem" : "types-pywin32" ,
130+ "mock" : "types-mock" ,
170131 "mypy_extensions" : "types-mypy-extensions" ,
171132 "MySQLdb" : "types-mysqlclient" ,
172133 "nanoid" : "types-nanoid" ,
@@ -181,7 +142,9 @@ def stub_distribution_name(module: str) -> str | None:
181142 "odbc" : "types-pywin32" ,
182143 "olefile" : "types-olefile" ,
183144 "openpyxl" : "types-openpyxl" ,
145+ "OpenSSL" : "types-pyOpenSSL" ,
184146 "opentracing" : "types-opentracing" ,
147+ "paramiko" : "types-paramiko" ,
185148 "parsimonious" : "types-parsimonious" ,
186149 "passlib" : "types-passlib" ,
187150 "passpy" : "types-passpy" ,
@@ -190,34 +153,45 @@ def stub_distribution_name(module: str) -> str | None:
190153 "perfmon" : "types-pywin32" ,
191154 "pexpect" : "types-pexpect" ,
192155 "PIL" : "types-Pillow" ,
156+ "pkg_resources" : "types-setuptools" ,
193157 "playhouse" : "types-peewee" ,
194158 "playsound" : "types-playsound" ,
159+ "polib" : "types-polib" ,
195160 "portpicker" : "types-portpicker" ,
196161 "psutil" : "types-psutil" ,
197162 "psycopg2" : "types-psycopg2" ,
198163 "pyasn1" : "types-pyasn1" ,
199164 "pyaudio" : "types-pyaudio" ,
200165 "pyautogui" : "types-PyAutoGUI" ,
201166 "pycocotools" : "types-pycocotools" ,
167+ "pycurl" : "types-pycurl" ,
202168 "pyflakes" : "types-pyflakes" ,
203169 "pygit2" : "types-pygit2" ,
204170 "pygments" : "types-Pygments" ,
205171 "pyi_splash" : "types-pyinstaller" ,
206172 "PyInstaller" : "types-pyinstaller" ,
173+ "pymysql" : "types-PyMySQL" ,
207174 "pynput" : "types-pynput" ,
175+ "pyrfc3339" : "types-pyRFC3339" ,
208176 "pyscreeze" : "types-PyScreeze" ,
209177 "pysftp" : "types-pysftp" ,
210178 "pytest_lazyfixture" : "types-pytest-lazy-fixture" ,
211179 "python_http_client" : "types-python-http-client" ,
180+ "python2" : "types-six" ,
212181 "pythoncom" : "types-pywin32" ,
213182 "pythonwin" : "types-pywin32" ,
183+ "pytz" : "types-pytz" ,
184+ "pyVmomi" : "types-pyvmomi" ,
214185 "pywintypes" : "types-pywin32" ,
215186 "qrbill" : "types-qrbill" ,
216187 "qrcode" : "types-qrcode" ,
188+ "redis" : "types-redis" ,
217189 "regex" : "types-regex" ,
218190 "regutil" : "types-pywin32" ,
219191 "reportlab" : "types-reportlab" ,
220192 "requests_oauthlib" : "types-requests-oauthlib" ,
193+ "requests" : "types-requests" ,
194+ "retry" : "types-retry" ,
221195 "RPi" : "types-RPi.GPIO" ,
222196 "s2clientprotocol" : "types-s2clientprotocol" ,
223197 "sass" : "types-libsass" ,
@@ -228,26 +202,36 @@ def stub_distribution_name(module: str) -> str | None:
228202 "servicemanager" : "types-pywin32" ,
229203 "setuptools" : "types-setuptools" ,
230204 "shapely" : "types-shapely" ,
205+ "simplejson" : "types-simplejson" ,
206+ "singledispatch" : "types-singledispatch" ,
207+ "six" : "types-six" ,
208+ "slugify" : "types-python-slugify" ,
231209 "slumber" : "types-slumber" ,
232210 "sspicon" : "types-pywin32" ,
233211 "stdlib_list" : "types-stdlib-list" ,
234212 "str2bool" : "types-str2bool" ,
235213 "stripe" : "types-stripe" ,
214+ "tabulate" : "types-tabulate" ,
236215 "tensorflow" : "types-tensorflow" ,
237216 "tgcrypto" : "types-TgCrypto" ,
238217 "timer" : "types-pywin32" ,
218+ "toml" : "types-toml" ,
239219 "toposort" : "types-toposort" ,
240220 "tqdm" : "types-tqdm" ,
241221 "translationstring" : "types-translationstring" ,
242222 "tree_sitter_languages" : "types-tree-sitter-languages" ,
243223 "tree_sitter" : "types-tree-sitter" ,
244224 "ttkthemes" : "types-ttkthemes" ,
225+ "typed_ast" : "types-typed-ast" ,
226+ "tzlocal" : "types-tzlocal" ,
227+ "ujson" : "types-ujson" ,
245228 "unidiff" : "types-unidiff" ,
246229 "untangle" : "types-untangle" ,
247230 "usersettings" : "types-usersettings" ,
248231 "uwsgi" : "types-uWSGI" ,
249232 "uwsgidecorators" : "types-uWSGI" ,
250233 "vobject" : "types-vobject" ,
234+ "waitress" : "types-waitress" ,
251235 "webob" : "types-WebOb" ,
252236 "whatthepatch" : "types-whatthepatch" ,
253237 "win2kras" : "types-pywin32" ,
@@ -305,6 +289,7 @@ def stub_distribution_name(module: str) -> str | None:
305289 "xdgenvpy" : "types-xdgenvpy" ,
306290 "Xlib" : "types-python-xlib" ,
307291 "xmltodict" : "types-xmltodict" ,
292+ "yaml" : "types-PyYAML" ,
308293 "zstd" : "types-zstd" ,
309294 "zxcvbn" : "types-zxcvbn" ,
310295 # Stub packages that are not from typeshed
0 commit comments