Skip to content

refactor: make client almost client again - #1666

Open
ZohebShaikh wants to merge 1 commit into
mainfrom
fix-dependencies
Open

ZohebShaikh wants to merge 1 commit into
mainfrom
fix-dependencies

Conversation

@ZohebShaikh

@ZohebShaikh ZohebShaikh commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

I would like to go further in the split by doing the following but would like feedback on this before

  1. Move setup-scratch to be server only
  2. Have a click interface for only the serve which can only run commands like serve, setup-scratch
  3. Move the bluesky, ophyd-async,event-model,opentelemetry-distro,observability-utils to server only

Related to but does not solves #1414

@ZohebShaikh
ZohebShaikh requested a review from a team as a code owner September 10, 2026 17:39
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.95833% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.30%. Comparing base (f1455ad) to head (3f9a08d).

Files with missing lines Patch % Lines
src/blueapi/service/environment.py 96.07% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1666      +/-   ##
==========================================
- Coverage   96.34%   96.30%   -0.05%     
==========================================
  Files          46       48       +2     
  Lines        3665     3676      +11     
==========================================
+ Hits         3531     3540       +9     
- Misses        134      136       +2     

☔ 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.

@Alexj9837 Alexj9837 self-assigned this Sep 11, 2026

@Alexj9837 Alexj9837 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.

LGTM


if (nt_conf := configuration.numtracker) is not None:
if configuration.env.metadata is not None:
from blueapi.service.numtracker import NumtrackerClient

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.

If we need to import it anyway, is there any real benefit to wrapping the initial import in the TYPE_CHECKING check?

I see the circular import error when importing the client eagerly. Were there other issues with numtracker being in the utils package instead of service? Lazy imports to avoid circular references feels like we're working around doing something wrong.

Comment thread pyproject.toml
"click>=8.2.0",
"fastapi>=0.112.0",
"uvicorn>=0.52.1",
"click>=8.2.0", # need for blueapi serve and blueapi setup-scratch

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.

click is needed for the whole CLI isn't it?

Suggested change
"click>=8.2.0", # need for blueapi serve and blueapi setup-scratch
"click>=8.2.0",

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