fix(lint): remove unused BottleImages imports from two test files
pyright strict reportUnusedImport flagged BottleImages in test_docker_launch_committed_image.py and test_macos_container_launch.py; neither file references the type by name (they only use the returned value's attributes).
This commit is contained in:
@@ -18,7 +18,7 @@ from ...env import ResolvedEnv
|
|||||||
from ...git_gate import GitGatePlan
|
from ...git_gate import GitGatePlan
|
||||||
from ...manifest import Manifest
|
from ...manifest import Manifest
|
||||||
from ...supervise import SupervisePlan
|
from ...supervise import SupervisePlan
|
||||||
from .. import ActiveAgent, BottleBackend, BottleSpec
|
from .. import ActiveAgent, BottleBackend, BottleImages, 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
|
||||||
@@ -92,10 +92,16 @@ class FirecrackerBottleBackend(
|
|||||||
stage_dir=stage_dir,
|
stage_dir=stage_dir,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _build_or_load_images(self, plan: FirecrackerBottlePlan) -> BottleImages:
|
||||||
|
# Firecracker builds its rootfs image inside _launch_impl (via buildah in
|
||||||
|
# a builder VM), so there is nothing to pre-resolve here.
|
||||||
|
return BottleImages(agent=plan.image)
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def launch(
|
def _launch_impl(
|
||||||
self, plan: FirecrackerBottlePlan
|
self, plan: FirecrackerBottlePlan, images: BottleImages,
|
||||||
) -> Generator[FirecrackerBottle, None, None]:
|
) -> Generator[FirecrackerBottle, None, None]:
|
||||||
|
del images # rootfs built inside _launch.launch; images unused here
|
||||||
with _launch.launch(plan, provision=self.provision) as bottle:
|
with _launch.launch(plan, provision=self.provision) as bottle:
|
||||||
yield bottle
|
yield bottle
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from typing import Any
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from bot_bottle.agent_provider import AgentProvisionPlan
|
from bot_bottle.agent_provider import AgentProvisionPlan
|
||||||
from bot_bottle.backend import BottleImages, BottleSpec
|
from bot_bottle.backend import BottleSpec
|
||||||
from bot_bottle.backend.docker import launch as launch_mod
|
from bot_bottle.backend.docker import launch as launch_mod
|
||||||
from bot_bottle.backend.docker.bottle_plan import DockerBottlePlan
|
from bot_bottle.backend.docker.bottle_plan import DockerBottlePlan
|
||||||
from bot_bottle.backend.docker.consolidated_launch import LaunchContext
|
from bot_bottle.backend.docker.consolidated_launch import LaunchContext
|
||||||
|
|||||||
Reference in New Issue
Block a user