Skip to content

Conversation

@tpoliaw
Copy link
Contributor

@tpoliaw tpoliaw commented Jan 15, 2026

When editing scripts that make use of the dynamic plan/device access in
the new 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.

Mainly to make supporting type stubs easier
When editing scripts that make use of the dynamic plan/device access in
the new 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.
@tpoliaw tpoliaw changed the base branch from main to user-client January 15, 2026 22:53
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 83.41969% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.42%. Comparing base (ba2287b) to head (76d70fd).

Files with missing lines Patch % Lines
src/blueapi/cli/stubgen.py 65.75% 25 Missing ⚠️
src/blueapi/cli/cli.py 44.44% 5 Missing ⚠️
src/blueapi/client/client.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           user-client    #1338      +/-   ##
===============================================
- Coverage        95.34%   94.42%   -0.93%     
===============================================
  Files               42       44       +2     
  Lines             2900     2995      +95     
===============================================
+ Hits              2765     2828      +63     
- Misses             135      167      +32     

☔ View full report in Codecov by Sentry.
📢 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.

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.

2 participants