Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Explicit reexport of types (backport to 1.x) #2913

Merged
merged 1 commit into from Mar 27, 2024

Conversation

szokeasaurusrex
Copy link
Member

@szokeasaurusrex szokeasaurusrex commented Mar 27, 2024

Explicitly reexport types to make strict mypy setups happy. This backports #2866 to 1.x.

Fixes GH-2910

* Explicitly reexport types to make strict mypy setups happy
@@ -12,3 +12,5 @@

if TYPE_CHECKING:
from sentry_sdk._types import Event, Hint # noqa: F401

__all__ = ["Event", "Hint"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that this is behind TYPE_CHECKING? Not too deep into the topic but #2909 seems to suggest it shouldn't be?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR only fixes #2910. I opened #2914 to fix #2909, and in #2914, I have moved the __all__ out of the if TYPE_CHECKING guard

@szokeasaurusrex szokeasaurusrex merged commit 790ee6a into master Mar 27, 2024
123 of 124 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/explicit-type-reexport branch March 27, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exported types are not importable by mypy
3 participants