fix: resolve pyright strict errors
This commit is contained in:
@@ -25,6 +25,11 @@ from pathlib import Path
|
|||||||
from typing import Generator, Sequence
|
from typing import Generator, Sequence
|
||||||
|
|
||||||
from ...supervise import SUPERVISE_HOSTNAME, SUPERVISE_PORT
|
from ...supervise import SUPERVISE_HOSTNAME, SUPERVISE_PORT
|
||||||
|
from ...agent_provider import AgentProvisionPlan
|
||||||
|
from ...egress import EgressPlan
|
||||||
|
from ...env import ResolvedEnv
|
||||||
|
from ...git_gate import GitGatePlan
|
||||||
|
from ...supervise import SupervisePlan
|
||||||
from .. import ActiveAgent, BottleBackend, BottleSpec
|
from .. import ActiveAgent, BottleBackend, BottleSpec
|
||||||
from . import cleanup as _cleanup
|
from . import cleanup as _cleanup
|
||||||
from . import enumerate as _enumerate
|
from . import enumerate as _enumerate
|
||||||
@@ -53,11 +58,11 @@ class DockerBottleBackend(BottleBackend["DockerBottlePlan", "DockerBottleCleanup
|
|||||||
spec: BottleSpec,
|
spec: BottleSpec,
|
||||||
*,
|
*,
|
||||||
slug: str,
|
slug: str,
|
||||||
resolved_env,
|
resolved_env: ResolvedEnv,
|
||||||
agent_provision_plan,
|
agent_provision_plan: AgentProvisionPlan,
|
||||||
egress_plan,
|
egress_plan: EgressPlan,
|
||||||
git_gate_plan,
|
git_gate_plan: GitGatePlan,
|
||||||
supervise_plan,
|
supervise_plan: SupervisePlan | None,
|
||||||
stage_dir: Path,
|
stage_dir: Path,
|
||||||
) -> DockerBottlePlan:
|
) -> DockerBottlePlan:
|
||||||
return _resolve_plan.resolve_plan(
|
return _resolve_plan.resolve_plan(
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from ...agent_provider import get_provider
|
from ...agent_provider import get_provider
|
||||||
from ...log import info, warn
|
from ...log import info, warn
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ def resolve_plan(
|
|||||||
resolved_env: ResolvedEnv,
|
resolved_env: ResolvedEnv,
|
||||||
agent_provision_plan: AgentProvisionPlan,
|
agent_provision_plan: AgentProvisionPlan,
|
||||||
egress_plan: EgressPlan,
|
egress_plan: EgressPlan,
|
||||||
supervise_plan: SupervisePlan,
|
supervise_plan: SupervisePlan | None,
|
||||||
git_gate_plan: GitGatePlan,
|
git_gate_plan: GitGatePlan,
|
||||||
stage_dir: Path,
|
stage_dir: Path,
|
||||||
) -> DockerBottlePlan:
|
) -> DockerBottlePlan:
|
||||||
@@ -60,4 +60,3 @@ def resolve_plan(
|
|||||||
# workspace_plan=workspace_plan,
|
# workspace_plan=workspace_plan,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from __future__ import annotations
|
|||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
|
||||||
from typing import Iterable, Iterator
|
from typing import Iterable, Iterator
|
||||||
|
|
||||||
from ...log import die, info
|
from ...log import die, info
|
||||||
|
|||||||
@@ -13,7 +13,12 @@ from contextlib import contextmanager
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Generator, Sequence
|
from typing import Generator, Sequence
|
||||||
|
|
||||||
from .. import ActiveAgent, Bottle, BottleBackend, BottleSpec
|
from ...agent_provider import AgentProvisionPlan
|
||||||
|
from ...egress import EgressPlan
|
||||||
|
from ...env import ResolvedEnv
|
||||||
|
from ...git_gate import GitGatePlan
|
||||||
|
from ...supervise import SupervisePlan
|
||||||
|
from .. import ActiveAgent, BottleBackend, BottleSpec
|
||||||
from . import cleanup as _cleanup
|
from . import cleanup as _cleanup
|
||||||
from . import enumerate as _enumerate
|
from . import enumerate as _enumerate
|
||||||
from . import launch as _launch
|
from . import launch as _launch
|
||||||
@@ -46,11 +51,11 @@ class SmolmachinesBottleBackend(
|
|||||||
spec: BottleSpec,
|
spec: BottleSpec,
|
||||||
*,
|
*,
|
||||||
slug: str,
|
slug: str,
|
||||||
resolved_env,
|
resolved_env: ResolvedEnv,
|
||||||
agent_provision_plan,
|
agent_provision_plan: AgentProvisionPlan,
|
||||||
egress_plan,
|
egress_plan: EgressPlan,
|
||||||
git_gate_plan,
|
git_gate_plan: GitGatePlan,
|
||||||
supervise_plan,
|
supervise_plan: SupervisePlan | None,
|
||||||
stage_dir: Path,
|
stage_dir: Path,
|
||||||
) -> SmolmachinesBottlePlan:
|
) -> SmolmachinesBottlePlan:
|
||||||
return _resolve_plan.resolve_plan(
|
return _resolve_plan.resolve_plan(
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ from ...egress import EgressPlan
|
|||||||
from ...supervise import SupervisePlan
|
from ...supervise import SupervisePlan
|
||||||
from ...git_gate import GitGatePlan
|
from ...git_gate import GitGatePlan
|
||||||
|
|
||||||
from ...backend import BottleSpec
|
|
||||||
from ...env import ResolvedEnv
|
|
||||||
# from ...workspace import workspace_plan as resolve_workspace_plan
|
# from ...workspace import workspace_plan as resolve_workspace_plan
|
||||||
from .bottle_plan import SmolmachinesBottlePlan
|
from .bottle_plan import SmolmachinesBottlePlan
|
||||||
from .util import smolmachines_bundle_subnet, smolmachines_preflight
|
from .util import smolmachines_bundle_subnet, smolmachines_preflight
|
||||||
@@ -53,7 +51,7 @@ def resolve_plan(
|
|||||||
resolved_env: ResolvedEnv,
|
resolved_env: ResolvedEnv,
|
||||||
agent_provision_plan: AgentProvisionPlan,
|
agent_provision_plan: AgentProvisionPlan,
|
||||||
egress_plan: EgressPlan,
|
egress_plan: EgressPlan,
|
||||||
supervise_plan: SupervisePlan,
|
supervise_plan: SupervisePlan | None,
|
||||||
git_gate_plan: GitGatePlan,
|
git_gate_plan: GitGatePlan,
|
||||||
stage_dir: Path,
|
stage_dir: Path,
|
||||||
) -> SmolmachinesBottlePlan:
|
) -> SmolmachinesBottlePlan:
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ def approve(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Apply the proposal, write the waiting response, and audit it."""
|
"""Apply the proposal, write the waiting response, and audit it."""
|
||||||
status = STATUS_MODIFIED if final_file is not None else STATUS_APPROVED
|
status = STATUS_MODIFIED if final_file is not None else STATUS_APPROVED
|
||||||
file_to_apply = final_file if final_file is not None else qp.proposal.proposed_file
|
|
||||||
|
|
||||||
diff_before, diff_after = "", ""
|
diff_before, diff_after = "", ""
|
||||||
# if qp.proposal.tool == TOOL_CAPABILITY_BLOCK:
|
# if qp.proposal.tool == TOOL_CAPABILITY_BLOCK:
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ integration smoke."""
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
|
||||||
import unittest
|
import unittest
|
||||||
from pathlib import Path
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from bot_bottle.backend.docker import util as docker_mod
|
from bot_bottle.backend.docker import util as docker_mod
|
||||||
|
|||||||
@@ -71,11 +71,6 @@ def _make_bottle(
|
|||||||
return bottle
|
return bottle
|
||||||
|
|
||||||
|
|
||||||
def _exec_scripts(bottle: MagicMock) -> list[str]:
|
|
||||||
"""All script strings passed to bottle.exec, in call order."""
|
|
||||||
return [c.args[0] for c in bottle.exec.call_args_list]
|
|
||||||
|
|
||||||
|
|
||||||
def _exec_users(bottle: MagicMock) -> list[str]: # type: ignore
|
def _exec_users(bottle: MagicMock) -> list[str]: # type: ignore
|
||||||
"""user= kwarg from each bottle.exec call, in order."""
|
"""user= kwarg from each bottle.exec call, in order."""
|
||||||
return [c.kwargs.get("user", "node") for c in bottle.exec.call_args_list]
|
return [c.kwargs.get("user", "node") for c in bottle.exec.call_args_list]
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ from datetime import datetime, timezone
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from bot_bottle import supervise
|
from bot_bottle import supervise
|
||||||
from bot_bottle.backend.docker.capability_apply import CapabilityApplyError
|
|
||||||
from bot_bottle.cli import supervise as supervise_cli
|
from bot_bottle.cli import supervise as supervise_cli
|
||||||
from bot_bottle.supervise import (
|
from bot_bottle.supervise import (
|
||||||
Proposal,
|
Proposal,
|
||||||
|
|||||||
Reference in New Issue
Block a user