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

{
  "context": "This criteria evaluates how well the engineer uses the rodi package's factory registration capabilities to configure services with different lifetimes (singleton, scoped, and transient). The focus is on proper use of add_singleton_by_factory, add_scoped_by_factory, and add_transient_by_factory methods.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Container Creation",
      "description": "Creates a Container instance from the rodi package to configure services",
      "max_score": 10
    },
    {
      "name": "Singleton Factory Registration",
      "description": "Uses add_singleton_by_factory() method to register a factory that creates the Logger instance with name 'Application', ensuring the same instance is returned for all resolutions",
      "max_score": 25
    },
    {
      "name": "Scoped Factory Registration",
      "description": "Uses add_scoped_by_factory() method to register a factory that creates RequestContext instances, ensuring the same instance is returned within a scope but different instances across different scopes",
      "max_score": 25
    },
    {
      "name": "Transient Factory Registration",
      "description": "Uses add_transient_by_factory() method to register a factory that creates DatabaseService instances with new Logger instances, ensuring a new instance is created for each resolution",
      "max_score": 25
    },
    {
      "name": "Factory Return Types",
      "description": "Properly specifies the return_type parameter in factory registration methods (e.g., return_type=Logger, return_type=RequestContext, return_type=DatabaseService) to enable type-based resolution",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-rodi

tile.json