-
Notifications
You must be signed in to change notification settings - Fork 6
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
619 move to pyright #632
619 move to pyright #632
Conversation
1bd5afb
to
48371ac
Compare
@callumforrester please let me know your thoughts |
@stan-dot I like where this is going, thanks |
ok will try to finish this today |
48371ac
to
d28365e
Compare
simmotor has adding an ignore line pending ophyd choosing a side here |
|
|
still one issue with the stomp instantiation from the CLI - what's your opinion @callumforrester ? |
@stan-dot: Maybe we should make the password a secret in a separate PR, in order to deal with the errors. It is not essential to adopting pyright. |
I'd agree with you, @callumforrester had this difference was between a 200 lines PR and 1k lines PR. it's 100 +- lines at the moment so easy to review. :( The errors are from pyright, so it makes sense to make this as a change
this soft maybe does not feel honest as we both know you'd abosolutely not allow for this to go in the same PR, so please skip the pleasantries and just tell me to raise an issue and make a PR... |
For the record it was a genuine maybe, I agree that those changes are tangentially related. I read them during review and decided not to contest them unless they caused problems. I am unable to commit the time to help you debug the error right now so I'm leaving it up to you whether you want to put time into debugging on your own or make an issue and defer until later. I am happy with either resolution. |
/workspaces/blueapi/src/blueapi/startup/simmotor.py:41:9 - error: Method "set" overrides class "SynAxis" in an incompatible manner
Return type mismatch: base method returns type "MoveStatus", override returns type "Status"
"Status" is not assignable to "MoveStatus" (reportIncompatibleMethodOverride)
/workspaces/blueapi/src/blueapi/startup/simmotor.py:70:14 - error: "MoveStatus" is not defined (reportUndefinedVariable)
/workspaces/blueapi/src/blueapi/startup/simmotor.py:93:36 - error: "MoveStatus" is not defined (reportUndefinedVariable)
/workspaces/blueapi/src/blueapi/startup/simmotor.py:94:16 - error: "MoveStatus" is not defined (reportUndefinedVariable)
/workspaces/blueapi/src/blueapi/worker/task_worker.py
/workspaces/blueapi/src/blueapi/worker/task_worker.py:99:54 - error: Argument of type "LoggingPropertyMachine | ProxyString | str" cannot be assigned to parameter "bluesky_state" of type "RawRunEngineState" in function "from_bluesky_state"
Type "LoggingPropertyMachine | ProxyString | str" is not assignable to type "RawRunEngineState"
Type "str" is not assignable to type "RawRunEngineState"
Type "str" is not assignable to type "type[ProxyString]"
Type "str" is not assignable to type "type[str]"
Type "str" is not assignable to type "type[PropertyMachine]" (reportArgumentType)
/workspaces/blueapi/tests/unit_tests/worker/devices.py
/workspaces/blueapi/tests/unit_tests/worker/devices.py:43:9 - error: Method "set" overrides class "Movable" in an incompatible manner
Return type mismatch: base method returns type "Status", override returns type "Status"
"Status" is incompatible with protocol "Status"
"exception" is an incompatible type
Type "(timeout: Unknown | None = None) -> (StatusTimeoutError | Exception | type[Exception] | None)" is not assignable to type "(timeout: float | None = 0) -> (BaseException | None)"
Function return type "StatusTimeoutError | Exception | type[Exception] | None" is incompatible with type "BaseException | None"
"bluesky.protocols.Status" is not assignable to "ophyd.status.Status"
"bluesky.protocols.Status" is not assignable to "ophyd.status.Status" (reportIncompatibleMethodOverride)
/workspaces/blueapi/tests/unit_tests/worker/devices.py:45:16 - error: Type "AdditionalUpdateStatus" is not assignable to return type "Status"
"AdditionalUpdateStatus" is not assignable to "Status" (reportReturnType)
7 errors, 0 warnings, 0 informations those are the errors, they are all grounded in the chaos around ophyd-vs-ophyd-async bluesky protocol import (SynAxis and worker devices cases), as well as with State tracking - EngineState and the application specific state, and the unexpected super_state_machine import - not maintained, afaik vendored in into Bluesky. either those are solved in a different PR or this PR is merged with 'ignore' flags. |
@stan-dot I am okay with ignore flags on ophyd (not ophyd-async) devices, this problem is probably related to bluesky/bluesky#1809 |
53dc1ad
to
5850a02
Compare
any idea why are the tests taking forever @callumforrester ? |
No although all bets are off while |
Co-authored-by: Joseph Ware <[email protected]>
typo Co-authored-by: Joseph Ware <[email protected]>
9165f13
to
02f8738
Compare
re: versions - I heard the reconciled version set is worked on atm |
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.
Just needs the tests fixed- I think the fixture is now returning the wrong object: it may have previously been returning the right object of the wrong type?
exporter in conftest
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: assert list[bluesky.protocols.Movable] == list[blueapi.core.context.BlueskyContext._reference.<locals>.Reference]
Full diff:
- list[blueapi.core.context.BlueskyContext._reference.<locals>.Reference]
+ list[bluesky.protocols.Movable]
some tests still not updated wrt the dependencies change? this plus the run engine which was just copy pasted from bluesky but there the structure changed |
6a4bbb2
to
65de2f5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #632 +/- ##
==========================================
- Coverage 92.27% 92.17% -0.10%
==========================================
Files 35 35
Lines 1800 1803 +3
==========================================
+ Hits 1661 1662 +1
- Misses 139 141 +2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
65de2f5
to
e3d3302
Compare
Move to pyright simplifies the setup and gives more precise feedback on the code quality