cli module better

This commit is contained in:
2026-03-15 18:06:45 +03:00
parent 7ffc6cd987
commit a3d7630219
4 changed files with 74 additions and 67 deletions
+2 -7
View File
@@ -1,8 +1,6 @@
__all__ = ["run_handler"]
import os
from pathlib import Path
import sys
from ..infrastructure.entrypoint_resolver.entity import (
CallableEntryPoint,
@@ -18,12 +16,9 @@ def run_handler(entrypoint_path: str) -> None:
raise ResolveFromStringError(
"Path to callable object that run orchestrator repl must be in the format <path/to/file.py>:<object_name>"
)
if str(Path.cwd()) not in sys.path:
sys.path.insert(0, str(Path.cwd()))
runner = EntrypointResolver(entrypoint_path).parse_entrypoint_with_type(
entrypoint_callable_name, CallableEntryPoint
runner = EntrypointResolver[CallableEntryPoint](entrypoint_path).parse_entrypoint_with_type(
entrypoint_callable_name
)
runner.instance_object()