From 9cdf4ab87ea7583aac6eb501ea3d09a655ff8718 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Wed, 12 Jun 2024 01:12:15 -0700 Subject: [PATCH] fix: Explicitly export cron symbols for typecheckers (#3072) Mypy with no_implicit_reexport = true does not see the symbols in sentry_sdk.crons as exported: my_file.py:10: error: Module "sentry_sdk.crons" does not explicitly export attribute "monitor" [attr-defined] Adding the symbols to __all__ marks them as exported and silences the error. --- sentry_sdk/crons/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sentry_sdk/crons/__init__.py b/sentry_sdk/crons/__init__.py index 5d1fe357d2..6f748aaecb 100644 --- a/sentry_sdk/crons/__init__.py +++ b/sentry_sdk/crons/__init__.py @@ -1,3 +1,10 @@ -from sentry_sdk.crons.api import capture_checkin # noqa -from sentry_sdk.crons.consts import MonitorStatus # noqa -from sentry_sdk.crons.decorator import monitor # noqa +from sentry_sdk.crons.api import capture_checkin +from sentry_sdk.crons.consts import MonitorStatus +from sentry_sdk.crons.decorator import monitor + + +__all__ = [ + "capture_checkin", + "MonitorStatus", + "monitor", +]