Skip to content

feat: Add utility to generate plan cache stubs - #1740

Draft
tpoliaw wants to merge 7 commits into
mainfrom
stub-cache
Draft

tpoliaw wants to merge 7 commits into
mainfrom
stub-cache

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

When editing scripts that make use of the dynamic plan/device access in
the client, there is no type checking available by default (as the
available plans are unknown). This adds a subcommand to generate a
type-stubs package for the currently running server to help write scripts.

blueapi generate-stubs /tmp/blueapi-stubs
pip install --editable /tmp/blueapi-stubs

type checkers and LSPs will then be able to check scripts for correct plan
names/arguments/etc as well as providing completions while editing.

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.74312% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.31%. Comparing base (0178a43) to head (b3c3d86).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/blueapi/cli/cli.py 44.44% 5 Missing ⚠️
src/blueapi/cli/stubgen.py 97.50% 2 Missing ⚠️
src/blueapi/client/client.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1740      +/-   ##
==========================================
- Coverage   96.46%   96.31%   -0.16%     
==========================================
  Files          49       49              
  Lines        3791     3876      +85     
==========================================
+ Hits         3657     3733      +76     
- Misses        134      143       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tpoliaw

tpoliaw commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Needs DiamondLightSource/observability-utils#24 for this to work well

This branch has not been deployed

No deployments
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.

1 participant