BREAKING: ble and serial dependencies are optional#102
Merged
JPHutchins merged 2 commits intomainfrom Mar 4, 2026
Merged
Conversation
Use [ble], [serial], or [all] to enable the transports that are required. Existing projects are encouraged to use [all] to minimize migration friction.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes BLE (bleak) and serial (pyserial) transport dependencies optional extras, enabling downstream consumers (e.g., embedded Linux deployments) to avoid pulling in unused/OS-heavy dependency trees while keeping UDP transport always available.
Changes:
- Moves
bleakandpyserialfrom required deps to[project.optional-dependencies](ble,serial,all). - Adds import-time guards in BLE/serial transport modules to raise a clearer error when the relevant extra isn’t installed.
- Updates documentation, lockfile metadata, and CI to validate import behavior across extra combinations.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Makes BLE/serial optional extras and adds an all aggregate extra; ensures dev env pulls in all transports. |
uv.lock |
Reflects new optional dependency layout and extras metadata; updates dev requirements to include smpclient[all]. |
src/smpclient/transport/serial.py |
Wraps pyserial import with a clearer “install extra” error for missing serial support. |
src/smpclient/transport/ble.py |
Wraps bleak import with a clearer “install extra” error for missing BLE support. |
src/smpclient/__init__.py |
Documents that transports are optional extras and UDP is always available. |
README.md |
Adds installation guidance for selecting transports via extras. |
.github/workflows/test.yaml |
Adds CI matrix to verify expected import pass/fail behavior with different extras installed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use [ble], [serial], or [all] to enable the transports that are required.
Existing projects are encouraged to use [all] to minimize migration friction.
This is needed for downstream applications, particularly those deployed on embedded linux, that may not want to bring in dependency trees that they are not using, particularly those that would have heavy OS dependencies, like BLE.
Existing projects can migrate safely by changing
smpclient->smpclient[all].UDP transport support is builtin to python so it is always available.
FYI @otavio this may open the door to slimming (but complicating) the nix builds. That said, we don't intend to release an smpmgr that doesn't have all transports enabled.