Skip to content

fix(python): export SecurityOptions from top-level boxlite module#247

Merged
DorianZheng merged 1 commit intomainfrom
fix/export-security-options
Feb 13, 2026
Merged

fix(python): export SecurityOptions from top-level boxlite module#247
DorianZheng merged 1 commit intomainfrom
fix/export-security-options

Conversation

@yingjunwu
Copy link
Copy Markdown
Contributor

Summary

  • Add SecurityOptions to the import list and __all__ in __init__.py so from boxlite import SecurityOptions works as documented

Test plan

  • from boxlite import SecurityOptions succeeds
  • SecurityOptions.development(), .standard(), .maximum() all work

Closes #230
Closes #236

🤖 Generated with Claude Code

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]>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SecurityOptions to the import list from the Rust extension module
  • Added SecurityOptions to the __all__ list for proper public API exposure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 25 to +43
@@ -39,6 +40,7 @@
"BoxMetrics",
"CopyOptions",
"RootfsSpec",
"SecurityOptions",
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@yingjunwu
Copy link
Copy Markdown
Contributor Author

Self-review: This PR looks correct.

The bug: SecurityOptions was registered in the Rust PyO3 module (lib.rs:23) but not re-exported from __init__.py, causing from boxlite import SecurityOptions to fail with ImportError.

The fix adds it to both the import block and __all__. Standalone, no dependencies.

@DorianZheng DorianZheng merged commit 490de60 into main Feb 13, 2026
25 checks passed
@DorianZheng DorianZheng deleted the fix/export-security-options branch February 13, 2026 01:48
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.

SecurityOptions not exported from top-level boxlite module SecurityOptions not exported from top-level boxlite package; strict() preset missing

3 participants