Skip to content

Commit c103685

Browse files
committed
added more default modules
1 parent 58bbd5f commit c103685

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

src/python/pants/backend/python/dependency_inference/default_module_mapping.py

+28-11
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def two_groups_hyphens_two_replacements_with_suffix(
8484
google-cloud-foo will be used.
8585
"""
8686
DEFAULT_MODULE_PATTERN_MAPPING: Dict[re.Pattern, Iterable] = {
87+
re.compile(r"""^airflow-providers-(.+)"""): [all_hyphen_to_dot],
88+
re.compile(r"""^apache-(airflow-providers-.+)"""): [first_group_hyphen_to_dot],
8789
re.compile(r"""^azure-.+"""): [all_hyphen_to_dot],
8890
re.compile(r"""^django-((.+(-.+)?))"""): [first_group_hyphen_to_underscore],
8991
# See https://github.com/googleapis/google-cloud-python#libraries for all Google cloud
@@ -113,23 +115,33 @@ def two_groups_hyphens_two_replacements_with_suffix(
113115
"beautifulsoup4": ("bs4",),
114116
"bitvector": ("BitVector",),
115117
"cattrs": ("cattr", "cattrs"),
116-
"django-filter": ("django_filters",),
117-
"django-postgres-extra": ("psqlextra",),
118118
"django-cors-headers": ("corsheaders",),
119119
"django-countries": ("django_countries",),
120+
"django-filter": ("django_filters",),
120121
"django-fsm": ("django_fsm",),
122+
"django-migration-linter": ("django_migration_linter",),
123+
"django-object-actions": ("django_object_actions",),
124+
"django-postgres-extra": ("psqlextra",),
121125
"django-redis": ("django_redis",),
126+
"django-scim2": ("django_scim",),
122127
"djangorestframework": ("rest_framework",),
128+
"djangorestframework-api-key": ("rest_framework_api_key",),
123129
"djangorestframework-dataclasses": ("rest_framework_dataclasses",),
130+
"djangorestframework-queryfields": ("drf_queryfields",),
124131
"djangorestframework-simplejwt": ("rest_framework_simplejwt",),
125132
"elastic-apm": ("elasticapm",),
126133
"enum34": ("enum",),
127134
"factory-boy": ("factory",),
128135
"fluent-logger": ("fluent",),
129136
"gitpython": ("git",),
137+
"google-api-core": ("google",),
138+
"google-api-python-client": ("googleapiclient",),
139+
"google-auth": ("google.auth", "google.oauth2"),
130140
"graphql-core": ("graphql",),
131141
"grpcio": ("grpc",),
132142
"grpcio-health-checking": ("grpc_health",),
143+
"grpcio-reflection": ("grpc_reflection",),
144+
"honeycomb-beeline": ("beeline",),
133145
"honeycomb-opentelemetry": ("honeycomb.opentelemetry",),
134146
"ipython": ("IPython",),
135147
"jack-client": ("jack",),
@@ -139,13 +151,14 @@ def two_groups_hyphens_two_replacements_with_suffix(
139151
"mail-parser": ("mailparser",),
140152
"mysql-connector-python": ("mysql.connector",),
141153
"opencv-python": ("cv2",),
154+
"opencv-python-headless": ("cv2",),
142155
"opensearch-py": ("opensearchpy",),
143156
# opentelemetry
144157
"opentelemetry-api": ("opentelemetry",),
145-
"opentelemetry-instrumentation-kafka-python": ("opentelemetry.instrumentation.kafka",),
146158
"opentelemetry-exporter-otlp": ("opentelemetry.exporter",),
147159
"opentelemetry-exporter-otlp-proto-grpc": ("opentelemetry.exporter.otlp.proto.grpc",),
148160
"opentelemetry-exporter-otlp-proto-http": ("opentelemetry.exporter.otlp.proto.http",),
161+
"opentelemetry-instrumentation-kafka-python": ("opentelemetry.instrumentation.kafka",),
149162
"opentelemetry-sdk": ("opentelemetry.sdk",),
150163
"opentelemetry-test-utils": ("opentelemetry.test",),
151164
"paho-mqtt": ("paho",),
@@ -156,52 +169,56 @@ def two_groups_hyphens_two_replacements_with_suffix(
156169
"protobuf": ("google.protobuf",),
157170
"psycopg2-binary": ("psycopg2",),
158171
"pycrypto": ("Crypto",),
159-
"pykube-ng": ("pykube",),
160-
"pyhamcrest": ("hamcrest",),
161172
"pygithub": ("github",),
162173
"pygobject": ("gi",),
174+
"pyhamcrest": ("hamcrest",),
163175
"pyjwt": ("jwt",),
176+
"pykube-ng": ("pykube",),
177+
"pymongo": ("bson", "gridfs", "pymongo"),
178+
"pymupdf": ("fitz",),
164179
"pyopenssl": ("OpenSSL",),
165180
"pypdf2": ("PyPDF2",),
166181
"pypi-kenlm": ("kenlm",),
167182
"pysocks": ("socks",),
168183
"pytest": ("pytest", "_pytest"),
169-
"pyyaml": ("yaml",),
170-
"pymongo": ("bson", "gridfs", "pymongo"),
171-
"pymupdf": ("fitz",),
172184
"pytest-runner": ("ptr",),
173185
"python-json-logger": ("pythonjsonlogger",),
174186
"python-levenshtein": ("Levenshtein",),
175187
"python-lsp-jsonrpc": ("pylsp_jsonrpc",),
176188
"pywinrm": ("winrm",),
189+
"pyyaml": ("yaml",),
177190
"randomwords": ("random_words",),
178191
"scikit-image": ("skimage",),
179192
"scikit-learn": ("sklearn",),
180193
"scikit-video": ("skvideo",),
181-
"sseclient-py": ("sseclient",),
182194
"setuptools": ("easy_install", "pkg_resources", "setuptools"),
183195
"snowflake-connector-python": ("snowflake.connector",),
184196
"snowflake-snowpark-python": ("snowflake.snowpark",),
185197
"snowflake-sqlalchemy": ("snowflake.sqlalchemy",),
198+
"sseclient-py": ("sseclient",),
186199
"strawberry-graphql": ("strawberry",),
187200
"streamlit-aggrid": ("st_aggrid",),
188201
"unleashclient": ("UnleashClient",),
189202
"websocket-client": ("websocket",),
190203
}
191204

192-
DEFAULT_TYPE_STUB_MODULE_PATTERN_MAPPING: Dict[re.Pattern, Iterable] = {}
205+
DEFAULT_TYPE_STUB_MODULE_PATTERN_MAPPING: Dict[re.Pattern, Iterable] = {
206+
re.compile(r"""^mypy-boto3-.+"""): [all_hyphen_to_underscore],
207+
}
193208

194209
DEFAULT_TYPE_STUB_MODULE_MAPPING = {
210+
"boto3-stubs-lite": ("boto3",),
195211
"djangorestframework-types": ("rest_framework",),
212+
"google-api-python-client-stubs": ("googleapiclient",),
196213
"lark-stubs": ("lark",),
197214
"types-beautifulsoup4": ("bs4",),
198215
"types-enum34": ("enum34",),
199216
"types-pillow": ("PIL",),
200217
"types-protobuf": ("google.protobuf",),
201218
"types-pycrypto": ("Crypto",),
202219
"types-pyopenssl": ("OpenSSL",),
203-
"types-pyyaml": ("yaml",),
204220
"types-python-dateutil": ("dateutil",),
221+
"types-pyyaml": ("yaml",),
205222
"types-setuptools": ("easy_install", "pkg_resources", "setuptools"),
206223
}
207224

0 commit comments

Comments
 (0)