-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add py.typed file to package #346
Conversation
This breaks bluesky's |
@evalott100 Ah I'm guessing because bluesky has typing errors related to event-model objects? |
It's because we have some Here datum_doc = typing.cast(Datum, self._docs_cache.pop(datum_id)) since there's no way the type checker will know that an element with I think this is the format of most of the issues with type checking on bluesky for this PR. |
Okay, I'll try to take a stab at it and see if I can get it to work. Thanks for the info! |
Cheers! Instead of casting, the above example can probably be solved by making individual This would be nicer, and actually lead to better code across the file imo. For some places you might have to cast instead though. If there's somewhere where a nicer typing solution is feasible but you don't have the time then just adding casts for now is probably fine. |
@evalott100 I finished the changes to bluesky that are blocking this PR from being merged. Please see bluesky/bluesky#1873 I tried my best not to simply cast where I could but indeed some places it was necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bluesky changes to accomodate this ready to be merged as well.
Description
Add
py.typed
marker for the package.Motivation and Context
When using ophyd-async, the mypy extension in VS Code complains that there is no py.typed stub in event-model.
How Has This Been Tested?