Skip to content

python-sdk: 0.1.1 — top-level type exports and transport leak fix - #2109

Merged
koush merged 3 commits into
koush:mainfrom
raman325:python-sdk-0.1.1
Aug 1, 2026
Merged

koush merged 3 commits into
koush:mainfrom
raman325:python-sdk-0.1.1

Conversation

@raman325

@raman325 raman325 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Small follow-ups from integrating the published 0.1.0 package into the Home Assistant integration:

Changes

  • Top-level type exports: ScryptedInterface, ScryptedDeviceType, ScryptedInterfaceProperty, ScryptedInterfaceMethods, ScryptedMimeTypes, and PluginRemote are now re-exported from the package root. Previously the only import path for the types was scrypted_sdk.scrypted_python.scrypted_sdk.types (an artifact of the build-time package generation), which every consumer would otherwise have to hardcode.
  • scrypted_sdk.types alias module: the full generated type surface (245 names — interface TypedDicts, settings types, all enums) is exposed at one stable short path: from scrypted_sdk.types import VideoClip, LockState, .... A star-export into the package root instead would collide: the type tree's abstract DeviceManager/MediaManager/SystemManager would shadow the concrete plugin_remote implementations exported there, so the root keeps only the curated names.
  • Transport leak fix: connect_scrypted_client closed the transport on engine.io connect failure and handshake timeout, but not a caller-provided transport when the login phase failed — leaking its aiohttp session and send-loop task. Login failures now close it too.
  • Version bump to 0.1.1 and the CI smoke test now exercises the new exports and the alias module.

Testing

  • uv build + wheel install in a clean venv: all new top-level imports and scrypted_sdk.types resolve; root managers verified to still be the concrete plugin_remote classes
  • Verified the leak fix: pre-built transport passed to connect_scrypted_client against a dead host now has its send task torn down after the login failure (it stayed running on 0.1.0)

After merge, publishing 0.1.1 is just Actions → Python SDK → Run workflow.

🤖 Generated with Claude Code

- re-export ScryptedInterface, ScryptedDeviceType, ScryptedInterfaceProperty,
  ScryptedInterfaceMethods, ScryptedMimeTypes, and PluginRemote from the
  package root so consumers don't need the generated
  scrypted_sdk.scrypted_python.scrypted_sdk.types path
- close a caller-provided transport when the login phase fails, instead of
  leaking its session and send-loop task (engine.io and handshake failures
  already closed it)
- extend the CI smoke test to cover the new exports

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 31, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@raman325
raman325 marked this pull request as draft July 31, 2026 18:31
Exposes the full generated type surface (245 names) at a stable short
path — from scrypted_sdk.types import VideoClip, LockState, ... — without
star-exporting into the package root, where DeviceManager/MediaManager/
SystemManager from the type tree would collide with the concrete
plugin_remote implementations.

Co-Authored-By: Claude Fable 5 <[email protected]>
@raman325
raman325 marked this pull request as ready for review August 1, 2026 00:25
_login owns the request error translation and temporary-session cleanup,
leaving connect_scrypted_client a single flat try/except for closing a
caller-provided transport on login failure.

Co-Authored-By: Claude Fable 5 <[email protected]>
@koush
koush merged commit 84bb20e into koush:main Aug 1, 2026
2 checks passed
@raman325
raman325 deleted the python-sdk-0.1.1 branch August 1, 2026 00:31
Recoveredd pushed a commit to Recoveredd/scrypted that referenced this pull request Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants