mirror of
https://github.com/koloideal/Argenta.git
synced 2026-08-08 17:01:13 +03:00
cli module better
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user