fix: resolve pyright reportUnusedImport in manifest_extends
lint / lint (push) Successful in 1m32s
test / unit (pull_request) Successful in 28s
test / integration (pull_request) Successful in 16s

Import ManifestError at module level from manifest_util (no circular
dep) and remove the redundant local imports from function bodies that
were shadowing it. ManifestBottle retains its local import pattern to
avoid the circular manifest ↔ manifest_extends dependency.
This commit is contained in:
2026-06-20 02:24:49 +00:00
parent ca26ee35fe
commit 6db2227307
+4 -4
View File
@@ -4,6 +4,8 @@ from __future__ import annotations
from typing import TYPE_CHECKING
from .manifest_util import ManifestError
if TYPE_CHECKING:
from .manifest import ManifestBottle, ManifestGitEntry
from .manifest_egress import ManifestEgressConfig
@@ -27,8 +29,6 @@ def resolve_bottles_partial(
collected in `broken` rather than raising, so unrelated bottles remain
usable. Errors for parent bottles propagate to all children that extend
them."""
from .manifest import ManifestError
cache: dict[str, ManifestBottle] = {}
broken: dict[str, ManifestError] = {}
for name in raws:
@@ -43,7 +43,7 @@ def _resolve_one_bottle(
cache: dict[str, ManifestBottle],
seen: tuple[str, ...],
) -> ManifestBottle:
from .manifest import ManifestBottle, ManifestError
from .manifest import ManifestBottle
if name in cache:
return cache[name]
@@ -191,7 +191,7 @@ def _resolve_one_bottle_partial(
seen: tuple[str, ...],
) -> None:
"""Error-tolerant variant: on failure, adds to `broken` instead of raising."""
from .manifest import ManifestBottle, ManifestError
from .manifest import ManifestBottle
if name in cache or name in broken:
return