Skip to content

Commit

Permalink
fix(tracing) : Add trace to __all__ in top-level __init__.py (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
lobsterkatie authored Oct 2, 2023
1 parent 7c74ed3 commit afc488d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sentry_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"get_traceparent",
"get_baggage",
"continue_trace",
"trace",
]

# Initialize the debug support after everything is loaded
Expand Down

0 comments on commit afc488d

Please sign in to comment.