From afc488d6d5155d5664eb69b14b633959a2902499 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 2 Oct 2023 13:19:10 -0700 Subject: [PATCH] fix(tracing) : Add `trace` to `__all__` in top-level `__init__.py` (#2401) Currently, using the decorator form of `trace` like this (as mentioned in the docs[1]): ``` import sentry_sdk @sentry_sdk.trace def do_stuff(): ``` causes mypy to throw a `Module "sentry_sdk" does not explicitly export attribute "trace" [attr-defined]` error. This adds `trace` to the top-level `__init__.py`'s `__all__` so mypy sees it as being officially exported and stops throwing the error. [1] https://docs.sentry.io/platforms/python/performance/instrumentation/custom-instrumentation/#using-a-decorator-1 --- sentry_sdk/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sentry_sdk/__init__.py b/sentry_sdk/__init__.py index f4baf78b9c..562da90739 100644 --- a/sentry_sdk/__init__.py +++ b/sentry_sdk/__init__.py @@ -39,6 +39,7 @@ "get_traceparent", "get_baggage", "continue_trace", + "trace", ] # Initialize the debug support after everything is loaded