1616
1717from mypy .modulefinder import StdlibVersions
1818
19- POPULAR_THIRD_PARTY_MODULES : Final [frozenset [str ]] = frozenset ({
20- # Cloud
21- "boto3" ,
22- "botocore" ,
23- "aiobotocore" ,
24- "s3transfer" ,
25- "s3fs" ,
26- "awscli" ,
27-
28- # HTTP / Networking
29- "urllib3" ,
30- "requests" ,
31- "certifi" ,
32- "idna" ,
33- "charset_normalizer" ,
34- "httpx" ,
35- "httpcore" ,
36- "aiohttp" ,
37- "yarl" ,
38- "multidict" ,
39- "requests_oauthlib" ,
40- "oauthlib" ,
41- "h11" ,
42-
43- # Typing / Extensions
44- "typing_extensions" ,
45- "annotated_types" ,
46- "typing_inspection" ,
47-
48- # Core Utilities
49- "setuptools" ,
50- "packaging" ,
51- "pip" ,
52- "wheel" ,
53- "virtualenv" ,
54- "platformdirs" ,
55- "filelock" ,
56- "zipp" ,
57- "importlib_metadata" ,
58-
59- # Data Science / Numerical
60- "numpy" ,
61- "pandas" ,
62- "scipy" ,
63- "pyarrow" ,
64-
65- # Serialization / Config
66- "yaml" ,
67- "pydantic" ,
68- "pydantic_core" ,
69- "attrs" ,
70- "tomli" ,
71- "jsonschema" ,
72- "jsonschema_specifications" ,
73- "jmespath" ,
74-
75- # Cryptography / Security
76- "cryptography" ,
77- "cffi" ,
78- "pycparser" ,
79- "rsa" ,
80- "pyjwt" ,
81- "pyasn1" ,
82- "pyasn1_modules" ,
83-
84- # Date / Time
85- "dateutil" ,
86- "pytz" ,
87- "tzdata" ,
88-
89- # Google / gRPC
90- "google" ,
91- "grpc" ,
92- "grpc_status" ,
93- "grpc_tools" ,
94- "protobuf" ,
95- "googleapis_common_protos" ,
96-
97- # Testing
98- "pytest" ,
99- "pluggy" ,
100- "iniconfig" ,
101-
102- # CLI / Terminal
103- "click" ,
104- "colorama" ,
105- "rich" ,
106- "tqdm" ,
107-
108- # Web Frameworks
109- "starlette" ,
110-
111- # Templates / Markup
112- "jinja2" ,
113- "markupsafe" ,
114- "pygments" ,
115- "markdown_it" ,
116- "mdurl" ,
117-
118- # Async
119- "anyio" ,
120- "greenlet" ,
121- "aiosignal" ,
122- "aiohappyeyeballs" ,
123- "frozenlist" ,
124-
125- # Database
126- "sqlalchemy" ,
127-
128- # Parsing / XML
129- "pyparsing" ,
130- "et_xmlfile" ,
131-
132- # OpenTelemetry
133- "opentelemetry" ,
134-
135- # Other Popular Modules
136- "six" ,
137- "fsspec" ,
138- "wrapt" ,
139- "propcache" ,
140- "rpds" ,
141- "pathspec" ,
142- "PIL" ,
143- "psutil" ,
144- "referencing" ,
145- "trove_classifiers" ,
146- "openpyxl" ,
147- "dotenv" ,
148- "yandexcloud" ,
149- "cachetools" ,
150- })
19+ POPULAR_THIRD_PARTY_MODULES : Final [frozenset [str ]] = frozenset (
20+ {
21+ # Cloud
22+ "boto3" ,
23+ "botocore" ,
24+ "aiobotocore" ,
25+ "s3transfer" ,
26+ "s3fs" ,
27+ "awscli" ,
28+ # HTTP / Networking
29+ "urllib3" ,
30+ "requests" ,
31+ "certifi" ,
32+ "idna" ,
33+ "charset_normalizer" ,
34+ "httpx" ,
35+ "httpcore" ,
36+ "aiohttp" ,
37+ "yarl" ,
38+ "multidict" ,
39+ "requests_oauthlib" ,
40+ "oauthlib" ,
41+ "h11" ,
42+ # Typing / Extensions
43+ "typing_extensions" ,
44+ "annotated_types" ,
45+ "typing_inspection" ,
46+ # Core Utilities
47+ "setuptools" ,
48+ "packaging" ,
49+ "pip" ,
50+ "wheel" ,
51+ "virtualenv" ,
52+ "platformdirs" ,
53+ "filelock" ,
54+ "zipp" ,
55+ "importlib_metadata" ,
56+ # Data Science / Numerical
57+ "numpy" ,
58+ "pandas" ,
59+ "scipy" ,
60+ "pyarrow" ,
61+ # Serialization / Config
62+ "yaml" ,
63+ "pydantic" ,
64+ "pydantic_core" ,
65+ "attrs" ,
66+ "tomli" ,
67+ "jsonschema" ,
68+ "jsonschema_specifications" ,
69+ "jmespath" ,
70+ # Cryptography / Security
71+ "cryptography" ,
72+ "cffi" ,
73+ "pycparser" ,
74+ "rsa" ,
75+ "pyjwt" ,
76+ "pyasn1" ,
77+ "pyasn1_modules" ,
78+ # Date / Time
79+ "dateutil" ,
80+ "pytz" ,
81+ "tzdata" ,
82+ # Google / gRPC
83+ "google" ,
84+ "grpc" ,
85+ "grpc_status" ,
86+ "grpc_tools" ,
87+ "protobuf" ,
88+ "googleapis_common_protos" ,
89+ # Testing
90+ "pytest" ,
91+ "pluggy" ,
92+ "iniconfig" ,
93+ # CLI / Terminal
94+ "click" ,
95+ "colorama" ,
96+ "rich" ,
97+ "tqdm" ,
98+ # Web Frameworks
99+ "starlette" ,
100+ # Templates / Markup
101+ "jinja2" ,
102+ "markupsafe" ,
103+ "pygments" ,
104+ "markdown_it" ,
105+ "mdurl" ,
106+ # Async
107+ "anyio" ,
108+ "greenlet" ,
109+ "aiosignal" ,
110+ "aiohappyeyeballs" ,
111+ "frozenlist" ,
112+ # Database
113+ "sqlalchemy" ,
114+ # Parsing / XML
115+ "pyparsing" ,
116+ "et_xmlfile" ,
117+ # OpenTelemetry
118+ "opentelemetry" ,
119+ # Other Popular Modules
120+ "six" ,
121+ "fsspec" ,
122+ "wrapt" ,
123+ "propcache" ,
124+ "rpds" ,
125+ "pathspec" ,
126+ "PIL" ,
127+ "psutil" ,
128+ "referencing" ,
129+ "trove_classifiers" ,
130+ "openpyxl" ,
131+ "dotenv" ,
132+ "yandexcloud" ,
133+ "cachetools" ,
134+ }
135+ )
151136
152137
153138_known_modules_cache : frozenset [str ] | None = None
154139
140+
155141def reset_known_modules_cache () -> None :
156142 global _known_modules_cache
157143 _known_modules_cache = None
158144
159145
160146def get_stdlib_modules (
161- stdlib_versions : StdlibVersions ,
162- python_version : tuple [int , int ] | None = None ,
147+ stdlib_versions : StdlibVersions , python_version : tuple [int , int ] | None = None
163148) -> frozenset [str ]:
164149 modules : set [str ] = set ()
165150 for module , (min_ver , max_ver ) in stdlib_versions .items ():
@@ -177,8 +162,7 @@ def get_stdlib_modules(
177162
178163
179164def get_known_modules (
180- stdlib_versions : StdlibVersions | None = None ,
181- python_version : tuple [int , int ] | None = None ,
165+ stdlib_versions : StdlibVersions | None = None , python_version : tuple [int , int ] | None = None
182166) -> frozenset [str ]:
183167 global _known_modules_cache
184168 if _known_modules_cache is not None :
0 commit comments