fix(python): export SecurityOptions from top-level boxlite module#247
fix(python): export SecurityOptions from top-level boxlite module#247DorianZheng merged 1 commit intomainfrom
Conversation
SecurityOptions was defined in the Rust PyO3 layer (lib.rs) but not re-exported in __init__.py, causing: ImportError: cannot import name 'SecurityOptions' from 'boxlite' Users had to use the undocumented internal path: from boxlite.boxlite import SecurityOptions Fix: add SecurityOptions to the import list and __all__ so the documented `from boxlite import SecurityOptions` works. Note: the strict() preset referenced in some docs does not exist. Only development(), standard(), and maximum() are available. Documentation referencing strict() should be updated separately. Closes #230 Closes #236 Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR fixes issues #230 and #236 by exporting SecurityOptions from the top-level boxlite module, making it accessible via from boxlite import SecurityOptions as documented. Previously, users had to import it via the internal path from boxlite.boxlite import SecurityOptions.
Changes:
- Added
SecurityOptionsto the import list from the Rust extension module - Added
SecurityOptionsto the__all__list for proper public API exposure
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -39,6 +40,7 @@ | |||
| "BoxMetrics", | |||
| "CopyOptions", | |||
| "RootfsSpec", | |||
| "SecurityOptions", | |||
There was a problem hiding this comment.
Consider adding test coverage for the SecurityOptions export. The codebase has a pattern where Python convenience wrappers (SimpleBox, CodeBox, errors) have dedicated export tests (e.g., TestSimpleBoxExports, TestCodeBoxExports), though core Rust API types don't currently have this coverage. Adding a test would help prevent regressions and match the pattern used for Python wrapper exports.
|
Self-review: This PR looks correct. The bug: The fix adds it to both the import block and |
Summary
SecurityOptionsto the import list and__all__in__init__.pysofrom boxlite import SecurityOptionsworks as documentedTest plan
from boxlite import SecurityOptionssucceedsSecurityOptions.development(),.standard(),.maximum()all workCloses #230
Closes #236
🤖 Generated with Claude Code