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
@@ -31,7 +23,7 @@ def stub_distribution_name(module: str) -> str | None:
3123# Stubs for these third-party packages used to be shipped with mypy.
3224#
3325# Map package name to PyPI stub distribution name.
34- legacy_bundled_packages : dict [str , str ] = {
26+ _legacy_bundled_packages : dict [str , str ] = {
3527 "aiofiles" : "types-aiofiles" ,
3628 "bleach" : "types-bleach" ,
3729 "cachetools" : "types-cachetools" ,
@@ -309,6 +301,7 @@ def stub_distribution_name(module: str) -> str | None:
309301 "lxml" : "lxml-stubs" , # https://github.com/lxml/lxml-stubs
310302 "scipy" : "scipy-stubs" , # https://github.com/scipy/scipy-stubs
311303}
304+ non_bundled_packages_flat .update (_legacy_bundled_packages )
312305
313306
314307non_bundled_packages_namespace : dict [str , dict [str , str ]] = {
0 commit comments