fix(deps): update dependency pytango to v10.1.3#1195
fix(deps): update dependency pytango to v10.1.3#1195renovate[bot] wants to merge 7 commits intomainfrom
Conversation
|
@burkeds the tests seem to be failing on pytango 10.1.2, do you know why? |
|
I don't but I've been meaning to do a review of event subscriptions once I had Command sorted out. I saw some inconsistent failures with Tango devices that have multiple Hinted event backed signals. There might be a race condition I overlooked or that might have been introduced in the latest pytango. |
b3d86d9 to
d2baffd
Compare
d2baffd to
278f4f5
Compare
|
I'll spend some time looking into this today. |
…gument was deprecated from subscribe_event. The exception was then lost to the event loop. I added a try/except block and logger message to hopefully make this easier to notice in the future. I also make the class attributes in AttributeProxy into instance attributes which they probably should have been in the first place. I will likely refactor CommandProxy when TangoCommands are added
I pushed a fix. The stateless arg of DeviceProxy.subscribe_event was deprecated. This raised an exception lost to the event loop. Commenting it out fixes it. |
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
|
This seems to have completely broken type-checking somehow... |
|
Looks like |
Right, I vaguely remember Yury mentioning that. I'll sort this out next week. |
|
Pytango does something weird.
I created an issue on the pytango GitLab https://gitlab.com/tango-controls/pytango/-/issues/750 Since this pattern is runtime generated I expect the only solution will be to |
…s an async interface over DeviceProxy which makes like difficult for static type checkers. Unless typing in pytango is widened to accomodate this use case in future versions, we will need to type: ignore just about anything that directly uses the tango DeviceProxy.
…of DevState. get_python_type now raises an error if you try to find the type of an IMAGE of strings or enums. These are not valid tango types.
… _subscribe_to_event from a synchronous function so I removed the RuntimeError exception. Added a test to ensure the logger.debug message appears if the subscription fails.
|
@claude given the GitLab issue https://gitlab.com/tango-controls/pytango/-/issues/750 is there anything better we can do here? |
|
Claude finished @coretl's task in 2m 54s —— View job Analysis
On the typing approachThe current approach adds ~15 Better approach: define a You could define an from typing import Awaitable, Protocol
class AsyncDeviceProxyProtocol(Protocol):
def get_attribute_list(self) -> list[str]: ...
def get_command_list(self) -> list[str]: ...
def name(self) -> str: ...
def subscribe_event(
self, attr_name: str, event_type: EventType, callback: Any, **kwargs: Any
) -> Awaitable[int]: ...
def unsubscribe_event(self, eid: int, **kwargs: Any) -> Any: ... # sync and async
def read_attribute(self, attr_name: str) -> Awaitable[DeviceAttribute]: ...
def write_attribute(self, attr_name: str, value: Any) -> Awaitable[None]: ...
def get_attribute_config(self, attr_name: str) -> Awaitable[AttributeInfoEx]: ...
def get_command_config(self, cmd_name: str) -> Awaitable[CommandInfo]: ...Then proxy creation becomes: proxy = cast(AsyncDeviceProxyProtocol, await AsyncDeviceProxy(trl)) # type: ignore[misc]And One complication:
Typing this as Is it worth it now? The Protocol approach trades ~15 small scattered suppressions for 1 well-documented suppression and a Protocol that doubles as documentation of the interface contract. When pytango eventually fixes the issue (or if it's fixed via a custom stub in the project), removing the cast is a one-line change. That said, the current PR is already pragmatic and correct — this is a refinement question. If you'd rather not add complexity now, the Other notes on the diff:
|
This PR contains the following updates:
==10.0.3→==10.1.3Release Notes
tango-controls/pytango (pytango)
v10.1.3Compare Source
Documentation
More details in the full changelog 10.1.2...10.1.3
v10.1.2Compare Source
Fixed
Documentation
More details in the full changelog 10.1.1...10.1.2
v10.1.1Compare Source
Fixed
Documentation
DevOps and code maintenance changes
More details in the full changelog 10.1.0...10.1.1
v10.1.0Compare Source
Added
Removed
Changed
Fixed
DeviceProxy.__getattr__if attribute was removedDocumentation
DevOps and code maintenance changes
v10.0.4: v10.0.04Compare Source
Documentation
More details in the full changelog 10.0.3...10.0.4
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.