A simple test extension for the halfORM ecosystem, demonstrating the plugin system and CLI integration.
pip install half-orm-test-extension
Once installed, the extension automatically integrates with the half_orm
command:
# Simple greeting
half_orm test-extension greet
# Custom name
half_orm test-extension greet --name "Developer"
# Show current halfORM project info (if in a project directory)
half_orm test-extension status
This extension serves as:
- Example Implementation: Shows how to create halfORM extensions
- Testing Tool: Validates the extension discovery and integration system
- Development Template: Provides a starting point for other extensions
# Clone and install in development mode
git clone https://github.com/collorg/half-orm-test-extension.git
cd half-orm-test-extension
pip install -e .
# Run tests
pytest tests/
# Verify integration
half_orm --list-extensions
half_orm test-extension greet
- ✅ CLI integration with the
half_orm
command - ✅ Configuration management
- ✅ halfORM project detection and information display
- ✅ Database introspection (when halfORM_dev available)
- ✅ Extension metadata and documentation
- ✅ Error handling and graceful degradation
- ✅ Unit testing framework
half_orm_test_extention/
├── __init__.py # Package initialization
└── cli_extension.py # Main CLI integration (required)
tests/
└── test_extension.py # Unit tests
setup.py # Package configuration
README.md # This file
The key integration point is cli_extension.py
:
def add_commands(main_group):
# Add commands to the main half_orm CLI
pass
EXTENSION_INFO = {
# Extension metadata
}
This follows the halfORM ecosystem conventions for automatic discovery and integration.