Skip to content

Commit

Permalink
Add more otel packages to default module mapping + fix to always use …
Browse files Browse the repository at this point in the history
…tuples (pantsbuild#16345)

As a follow up for pantsbuild#16337

also added test to prevent mistakes like the ones I made in pantsbuild#16330

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
asherf authored Jul 29, 2022
1 parent 627984c commit 4436017
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"django-safedelete": ("safedelete",),
"django-simple-history": ("simple_history",),
"djangorestframework": ("rest_framework",),
"django-csp": ["csp"],
"django-csp": ("csp",),
"enum34": ("enum",),
"factory-boy": ("factory",),
"fluent-logger": ("fluent",),
Expand Down Expand Up @@ -90,6 +90,12 @@
"opentelemetry-instrumentation-grpc": ("opentelemetry.instrumentation.grpc",),
"opentelemetry-instrumentation-pymongo": ("opentelemetry.instrumentation.pymongo",),
"opentelemetry-instrumentation-requests": ("opentelemetry.instrumentation.requests",),
"opentelemetry-instrumentation-botocore": ("opentelemetry.instrumentation.botocore",),
"opentelemetry-instrumentation-django": ("opentelemetry.instrumentation.django",),
"opentelemetry-instrumentation-httpx": ("opentelemetry.instrumentation.httpx",),
"opentelemetry-instrumentation-elasticsearch": ("opentelemetry.instrumentation.elasticsearch",),
"opentelemetry-instrumentation-psycopg2": ("opentelemetry.instrumentation.psycopg2",),
"opentelemetry-instrumentation-jinja2": ("opentelemetry.instrumentation.jinja2",),
"opentelemetry-sdk": ("opentelemetry.sdk",),
"opentelemetry-test-utils": ("opentelemetry.test",),
"paho-mqtt": ("paho",),
Expand Down Expand Up @@ -125,7 +131,7 @@
"scikit-learn": ("sklearn",),
"setuptools": ("easy_install", "pkg_resources", "setuptools"),
"streamlit-aggrid": ("st_aggrid",),
"opensearch-py": ["opensearchpy"],
"opensearch-py": ("opensearchpy",),
}

DEFAULT_TYPE_STUB_MODULE_MAPPING = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def test_default_module_mapping_is_normalized() -> None:
), "Please update `DEFAULT_TYPE_STUB_MODULE_MAPPING` to use canonical project names"


def test_default_module_mapping_uses_tuples() -> None:
for modules in DEFAULT_MODULE_MAPPING.values():
assert isinstance(modules, tuple)
assert len(modules) > 0


@pytest.mark.parametrize(
"stripped_path,expected",
[
Expand Down

0 comments on commit 4436017

Please sign in to comment.