tessl install tessl/pypi-rodi@2.0.0Implementation of dependency injection for Python 3
Agent Success
Agent success rate when using this tile
92%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.06x
Baseline
Agent success rate without this tile
87%
{
"context": "This criteria evaluates how well an engineer uses the rodi package's dataclass support capability to implement a dependency injection system. The focus is on proper use of @inject() decorator with dataclasses, correct service registration with Container, and proper resolution of dependencies through the built provider.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import rodi Components",
"description": "Correctly imports Container from rodi package to set up dependency injection",
"max_score": 10
},
{
"name": "Use @inject() Decorator",
"description": "Applies @inject() decorator from rodi to all dataclasses (UserRepository, UserService, ProfileFormatter) to enable dependency injection with dataclasses",
"max_score": 25
},
{
"name": "Register Singleton Services",
"description": "Uses Container.add_singleton() to register Configuration and Logger as singleton services ensuring single shared instances",
"max_score": 15
},
{
"name": "Register Dataclass Services",
"description": "Uses Container.register() or Container.add_transient() to register the dataclass services (UserRepository, UserService, ProfileFormatter)",
"max_score": 15
},
{
"name": "Build Provider",
"description": "Calls Container.build_provider() to create a Services instance for resolving dependencies",
"max_score": 15
},
{
"name": "Resolve Services",
"description": "Uses the provider's get() method or resolve() to obtain service instances with injected dependencies",
"max_score": 10
},
{
"name": "Verify Dependency Injection",
"description": "Tests confirm that dataclass fields are properly populated with dependencies (not None) and singleton services are shared across instances",
"max_score": 10
}
]
}