Skip to content

Declare the operator's kubernetes dependency and fail with guidance#280

Merged
seanwevans merged 1 commit into
mainfrom
claude/operator-kubernetes-extra
Jul 21, 2026
Merged

Declare the operator's kubernetes dependency and fail with guidance#280
seanwevans merged 1 commit into
mainfrom
claude/operator-kubernetes-extra

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

Summary

pyisolate/operator/run_operator() imports the third-party kubernetes client, but it was never declared as a dependency or extra. On a clean install the call raised a bare ImportError with no hint about how to fix it.

Changes

  • Add a pyisolate[operator] optional-dependency group containing kubernetes.
  • Wrap the import so a missing client raises a RuntimeError that points at pip install pyisolate[operator] instead of a bare ImportError.

Tests

New test asserts the actionable error on hosts without the kubernetes client (skipped where it's installed). The existing operator tests inject a fake kubernetes module via sys.modules and are unaffected by the guard.

Found during a full-project review; one of several small correctness/packaging gaps being addressed one PR at a time.

🤖 Generated with Claude Code


Generated by Claude Code

pyisolate/operator/run_operator() imports the third-party `kubernetes` client,
but it was never declared as a dependency or extra, so on a clean install the
call raised a bare ImportError with no hint about the fix.

- Add a `pyisolate[operator]` optional-dependency group with `kubernetes`.
- Wrap the import so a missing client raises a RuntimeError that points at
  `pip install pyisolate[operator]` instead of a bare ImportError.

New test asserts the actionable error on hosts without the kubernetes client
(skipped where it is installed). Existing operator tests inject a fake
kubernetes module and are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PbbJc7Ntj159D9LNGevwC2
@seanwevans
seanwevans merged commit 083c53d into main Jul 21, 2026
18 checks passed
@seanwevans
seanwevans deleted the claude/operator-kubernetes-extra branch July 21, 2026 18:32
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