This package now declares that it includes typings so I tried to whitelist it in one of my projects. Unfortunately I got various errors like error: Module has no attribute "push_scope" for sentry_sdk.push_scope().
I haven't tried it but I suspect that dynamic code structures like
|
__all__ = api_all + [ # noqa |
|
"Hub", |
|
"Scope", |
|
"Client", |
|
"Transport", |
|
"HttpTransport", |
|
"init", |
|
"integrations", |
|
] |
|
def public(f): |
|
__all__.append(f.__name__) |
|
return f |
|
|
|
|
|
def hubmethod(f): |
|
f.__doc__ = "%s\n\n%s" % ( |
|
"Alias for `Hub.%s`" % f.__name__, |
|
inspect.getdoc(getattr(Hub, f.__name__)), |
|
) |
|
return public(f) |
|
|
|
|
|
@hubmethod |
|
def capture_event(event, hint=None): |
|
# type: (Dict[str, Any], Dict[str, Any]) -> Optional[str] |
|
hub = Hub.current |
|
if hub is not None: |
|
return hub.capture_event(event, hint) |
|
return None |
|
|
|
|
|
@hubmethod |
|
def capture_message(message, level=None): |
|
# type: (str, Optional[Any]) -> Optional[str] |
|
hub = Hub.current |
|
if hub is not None: |
|
return hub.capture_message(message, level) |
|
return None |
are too hard for mypy to understand. I was wondering if you'd be willing to forgo these (nice) shortcuts in order to help mypy. I'll be happy to send a PR if so.
This package now declares that it includes typings so I tried to whitelist it in one of my projects. Unfortunately I got various errors like
error: Module has no attribute "push_scope"forsentry_sdk.push_scope().I haven't tried it but I suspect that dynamic code structures like
sentry-python/sentry_sdk/__init__.py
Lines 35 to 43 in 64ca9a9
sentry-python/sentry_sdk/api.py
Lines 24 to 52 in 64ca9a9
are too hard for mypy to understand. I was wondering if you'd be willing to forgo these (nice) shortcuts in order to help mypy. I'll be happy to send a PR if so.