Defer broken manifest parse errors to preflight #239

Merged
didericis merged 8 commits from lazy-manifest-parse-on-select into main 2026-06-22 23:59:01 -04:00
Showing only changes of commit 996a260a98 - Show all commits
+4 -4
View File
@@ -4,6 +4,8 @@ from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from .manifest_util import ManifestError
if TYPE_CHECKING: if TYPE_CHECKING:
from .manifest import ManifestBottle from .manifest import ManifestBottle
from .manifest_egress import ManifestEgressConfig from .manifest_egress import ManifestEgressConfig
@@ -31,8 +33,6 @@ def resolve_bottles_partial(
collected in `broken` rather than raising, so unrelated bottles remain collected in `broken` rather than raising, so unrelated bottles remain
usable. Errors for parent bottles propagate to all children that extend usable. Errors for parent bottles propagate to all children that extend
them.""" them."""
from .manifest import ManifestError
cache: dict[str, ManifestBottle] = {} cache: dict[str, ManifestBottle] = {}
broken: dict[str, ManifestError] = {} broken: dict[str, ManifestError] = {}
for name in raws: for name in raws:
@@ -48,7 +48,7 @@ def _resolve_one_bottle(
repos_cache: dict[str, dict[str, object]], repos_cache: dict[str, dict[str, object]],
seen: tuple[str, ...], seen: tuple[str, ...],
) -> ManifestBottle: ) -> ManifestBottle:
from .manifest import ManifestBottle, ManifestError from .manifest import ManifestBottle
if name in cache: if name in cache:
return cache[name] return cache[name]
@@ -239,7 +239,7 @@ def _resolve_one_bottle_partial(
seen: tuple[str, ...], seen: tuple[str, ...],
) -> None: ) -> None:
"""Error-tolerant variant: on failure, adds to `broken` instead of raising.""" """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: if name in cache or name in broken:
return return