diff --git a/robot/helper_context_analysis.py b/robot/helper_context_analysis.py index bac1117d2..68d35be7b 100644 --- a/robot/helper_context_analysis.py +++ b/robot/helper_context_analysis.py @@ -15,7 +15,7 @@ from typing import Any src_dir = Path(__file__).parent.parent / "src" sys.path.insert(0, str(src_dir)) -from cleveragents.agents.context_analysis import ( +from cleveragents.agents.context_analysis import ( # noqa: E402 ContextAnalysisAgent, ContextAnalysisState, ) diff --git a/robot/helper_plan_generation.py b/robot/helper_plan_generation.py index df7cfc6d1..d58810096 100644 --- a/robot/helper_plan_generation.py +++ b/robot/helper_plan_generation.py @@ -12,8 +12,8 @@ SRC_DIR = PROJECT_ROOT / "src" if str(SRC_DIR) not in sys.path: sys.path.insert(0, str(SRC_DIR)) -from cleveragents.agents.plan_generation import PlanGenerationGraph -from cleveragents.domain.models.core import Context +from cleveragents.agents.plan_generation import PlanGenerationGraph # noqa: E402 +from cleveragents.domain.models.core import Context # noqa: E402 def run_context_summary() -> None: diff --git a/robot/indentation_library.py b/robot/indentation_library.py index 53d72b140..e229a2086 100644 --- a/robot/indentation_library.py +++ b/robot/indentation_library.py @@ -31,12 +31,17 @@ def fix_python_indentation(script: str) -> str: # Check if we should dedent from a class/function body back to module level # This happens when we see import, class, or a top-level statement after a class is_module_level_statement = False - if indent_level > 0 and block_stack: - # If we're inside a class and see an import, we need to dedent - if stripped.startswith(("import ", "from ")) or ( - stripped.startswith("class ") and block_stack[-1] == "class" - ): - is_module_level_statement = True + + # If we're inside a class and see an import, we need to dedent + if ( + indent_level > 0 + and block_stack + and ( + stripped.startswith(("import ", "from ")) + or (stripped.startswith("class ") and block_stack[-1] == "class") + ) + ): + is_module_level_statement = True if is_dedenting and block_stack: if stripped.startswith(("except:", "except ", "finally:")): diff --git a/typings/numpy/__init__.pyi b/typings/numpy/__init__.pyi index 86ad6be5b..5379cad0a 100644 --- a/typings/numpy/__init__.pyi +++ b/typings/numpy/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any, Generic, TypeVar +from typing import Any, TypeVar T = TypeVar("T") @@ -9,7 +9,7 @@ class dtype: int64: dtype bool: dtype -class ndarray(Generic[T]): +class ndarray[T]: dtype: dtype shape: tuple[int, ...] ndim: int