Declare the operator's kubernetes dependency and fail with guidance#280
Merged
Conversation
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
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.
Summary
pyisolate/operator/run_operator()imports the third-partykubernetesclient, but it was never declared as a dependency or extra. On a clean install the call raised a bareImportErrorwith no hint about how to fix it.Changes
pyisolate[operator]optional-dependency group containingkubernetes.RuntimeErrorthat points atpip install pyisolate[operator]instead of a bareImportError.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
kubernetesmodule viasys.modulesand 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