CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-rodi

Implementation of dependency injection for Python 3

Overall
score

92%

Overview
Eval results
Files

rubric.jsonevals/scenario-7/

{
  "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
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-rodi

tile.json