-
Notifications
You must be signed in to change notification settings - Fork 514
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
sentry_sdk.init fails mypy checks #1415
Comments
Thanks @dhuckins , we are on this and we expect to have a fix for this by Wednesday. |
awesome! thank you! |
thanks for taking care of this so quickly! when is the next release (with these changes) planned? |
@dhuckins released 1.5.11 |
Thanks! |
@sl0thentr0py any reason why https://peps.python.org/pep-0612 or python/typing#270 (comment) was not used as a fix? I was looking at python/typing#270 and saw that @untitaker was involved in discussion about it so I assumed that it would be the fix. |
Honestly I can't wrap my head around that PEP right now so if you think you have a better solution i'd create a patch. |
@untitaker I took a closer I guess PEP 612 does not apply. How I understand that could work, is to remove the hacks with then add: F = TypeVar('F', bound=Callable[..., Any])
class copy_signature(Generic[F]):
def __init__(self, target: F) -> None: ...
def __call__(self, wrapped: Callable[..., Any]) -> F: ... As mentioned in the comment, and add then |
@takeda if you make a PR, I'll be happy to merge in the changes |
I think using a decorator instead of a class hierarchy to patch in the signature might be a good idea that makes things more legible, but I think TypedDict (still) cannot be used to type out kwargs. |
Error: lpld/settings.py:398: error: Cannot instantiate abstract class "init" with abstract attribute "__exit__" [abstract] See also: getsentry/sentry-python#1415
Error: lpld/settings.py:398: error: Cannot instantiate abstract class "init" with abstract attribute "__exit__" [abstract] See also: getsentry/sentry-python#1415
Error: lpld/settings.py:398: error: Cannot instantiate abstract class "init" with abstract attribute "__exit__" [abstract] See also: getsentry/sentry-python#1415
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.5.10
Steps to Reproduce
$ python3.10 -m venv venv
$ source ./venv/bin/activate # assuming unix
[venv] $ pip install sentry-sdk==1.5.10 mypy==0.950
(currently the latest versions of sentry-sdk and mypy)mytest.py
for example purposes)[venv] $ mypy mytest.py
Expected Result
no errors
Actual Result
The text was updated successfully, but these errors were encountered: