From dc7d4b6fdf2aca94f46ee21776748103a2ccf697 Mon Sep 17 00:00:00 2001 From: purajit Date: Fri, 16 Feb 2024 00:58:34 -0800 Subject: [PATCH] add more module mappings for popular packages (#20551) Added more default module mappings of popular packages * alphabetized the dictionaries * opentelemetry packages are from [here](https://opentelemetry-python.readthedocs.io/en/latest/api/index.html) --- .../default_module_mapping.py | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py index 56f5d317c09..99185ef0dd5 100644 --- a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py +++ b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py @@ -83,23 +83,33 @@ def two_groups_hyphens_two_replacements_with_suffix( "beautifulsoup4": ("bs4",), "bitvector": ("BitVector",), "cattrs": ("cattr", "cattrs"), - "django-filter": ("django_filters",), - "django-postgres-extra": ("psqlextra",), "django-cors-headers": ("corsheaders",), "django-countries": ("django_countries",), + "django-filter": ("django_filters",), "django-fsm": ("django_fsm",), + "django-object-actions": ("django_object_actions",), + "django-postgres-extra": ("psqlextra",), "django-redis": ("django_redis",), + "django-scim2": ("django_scim",), "djangorestframework": ("rest_framework",), + "djangorestframework-api-key": ("rest_framework_api_key",), "djangorestframework-dataclasses": ("rest_framework_dataclasses",), + "djangorestframework-queryfields": ("drf_queryfields",), "djangorestframework-simplejwt": ("rest_framework_simplejwt",), "elastic-apm": ("elasticapm",), "enum34": ("enum",), "factory-boy": ("factory",), "fluent-logger": ("fluent",), "gitpython": ("git",), + "google-api-python-client": ("googleapiclient",), + "google-auth": ( + "google.auth", + "google.oauth2", + ), "graphql-core": ("graphql",), "grpcio": ("grpc",), "grpcio-health-checking": ("grpc_health",), + "grpcio-reflection": ("grpc_reflection",), "honeycomb-opentelemetry": ("honeycomb.opentelemetry",), "ipython": ("IPython",), "jack-client": ("jack",), @@ -109,14 +119,25 @@ def two_groups_hyphens_two_replacements_with_suffix( "mail-parser": ("mailparser",), "mysql-connector-python": ("mysql.connector",), "opencv-python": ("cv2",), + "opencv-python-headless": ("cv2",), "opensearch-py": ("opensearchpy",), # opentelemetry "opentelemetry-api": ("opentelemetry",), - "opentelemetry-instrumentation-kafka-python": ("opentelemetry.instrumentation.kafka",), "opentelemetry-exporter-otlp": ("opentelemetry.exporter",), "opentelemetry-exporter-otlp-proto-grpc": ("opentelemetry.exporter.otlp.proto.grpc",), "opentelemetry-exporter-otlp-proto-http": ("opentelemetry.exporter.otlp.proto.http",), - "opentelemetry-sdk": ("opentelemetry.sdk",), + "opentelemetry-instrumentation-kafka-python": ("opentelemetry.instrumentation.kafka",), + "opentelemetry-sdk": ( + "opentelemetry._logs", + "opentelemetry.baggage", + "opentelemetry.context", + "opentelemetry.environment_variables", + "opentelemetry.metrics", + "opentelemetry.propagate", + "opentelemetry.propagators", + "opentelemetry.sdk", + "opentelemetry.trace", + ), "opentelemetry-test-utils": ("opentelemetry.test",), "paho-mqtt": ("paho",), "phonenumberslite": ("phonenumbers",), @@ -126,33 +147,33 @@ def two_groups_hyphens_two_replacements_with_suffix( "protobuf": ("google.protobuf",), "psycopg2-binary": ("psycopg2",), "pycrypto": ("Crypto",), - "pykube-ng": ("pykube",), - "pyhamcrest": ("hamcrest",), "pygithub": ("github",), "pygobject": ("gi",), + "pyhamcrest": ("hamcrest",), "pyjwt": ("jwt",), + "pykube-ng": ("pykube",), + "pymongo": ("bson", "gridfs", "pymongo"), + "pymupdf": ("fitz",), "pyopenssl": ("OpenSSL",), "pypdf2": ("PyPDF2",), "pypi-kenlm": ("kenlm",), "pysocks": ("socks",), "pytest": ("pytest", "_pytest"), - "pyyaml": ("yaml",), - "pymongo": ("bson", "gridfs", "pymongo"), - "pymupdf": ("fitz",), "pytest-runner": ("ptr",), "python-json-logger": ("pythonjsonlogger",), "python-levenshtein": ("Levenshtein",), "python-lsp-jsonrpc": ("pylsp_jsonrpc",), "pywinrm": ("winrm",), + "pyyaml": ("yaml",), "randomwords": ("random_words",), "scikit-image": ("skimage",), "scikit-learn": ("sklearn",), "scikit-video": ("skvideo",), - "sseclient-py": ("sseclient",), "setuptools": ("easy_install", "pkg_resources", "setuptools"), "snowflake-connector-python": ("snowflake.connector",), "snowflake-snowpark-python": ("snowflake.snowpark",), "snowflake-sqlalchemy": ("snowflake.sqlalchemy",), + "sseclient-py": ("sseclient",), "strawberry-graphql": ("strawberry",), "streamlit-aggrid": ("st_aggrid",), "unleashclient": ("UnleashClient",),