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-2/

{
  "context": "This criteria evaluates how well the engineer uses the rodi dependency injection library to implement singleton service registration for configuration objects. The focus is specifically on registering pre-created instances as singletons using add_instance() and properly resolving them through the container/provider.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Container creation",
      "description": "Creates a Container instance from the rodi library to manage service registrations",
      "max_score": 10
    },
    {
      "name": "add_instance() usage",
      "description": "Uses Container.add_instance() method to register both AppConfig and DatabaseConfig instances as singletons with the correct syntax: container.add_instance(instance, declared_class) or container.add_instance(instance)",
      "max_score": 25
    },
    {
      "name": "Service class registration",
      "description": "Registers Application and DatabaseConnection classes with the container using appropriate registration methods (e.g., register(), add_singleton(), or add_transient())",
      "max_score": 15
    },
    {
      "name": "Provider building",
      "description": "Calls container.build_provider() to create a Services provider instance that can resolve dependencies",
      "max_score": 10
    },
    {
      "name": "Service resolution",
      "description": "Uses provider.get() method to resolve Application and DatabaseConnection instances from the provider",
      "max_score": 15
    },
    {
      "name": "Dependency injection",
      "description": "Application and DatabaseConnection classes properly receive their configuration dependencies through constructor parameters (using type hints or parameter names) so rodi can inject them automatically",
      "max_score": 15
    },
    {
      "name": "Singleton verification",
      "description": "Tests verify singleton behavior by checking that configuration instances are shared across multiple resolutions using identity checks (is operator)",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-rodi

tile.json