in chz/blueprint/_blueprint.py [0:0]
def _make_lazy(self) -> _MakeResult:
all_params: dict[str, _Param] = {}
used_args: set[tuple[str, int]] = set()
meta_factory_value: dict[str, Any] = {}
missing_params: list[str] = []
value_mapping: dict[str, Evaluatable] | ConstructionIssue | None
value_mapping = _construct_param(
self.param,
"",
self._arg_map,
all_params=all_params,
used_args=used_args,
meta_factory_value=meta_factory_value,
missing_params=missing_params,
)
if isinstance(value_mapping, ConstructionIssue):
raise ConstructionException(value_mapping.issue)
if value_mapping is None:
# value_mapping is None if _construct_param / _construct_unspecified_param
# wants us to fallback to the default or thinks we're missing required arguments
# This is sort of equivalent to what happens in _construct_factory
unspecified_factory = self.meta_factory.unspecified_factory()
if unspecified_factory is None:
raise ConstructionException(
f"Cannot construct {self.target} because it has no unspecified factory"
)
value_mapping = {"": Thunk(unspecified_factory, {})}
if "" in missing_params:
missing_params.remove("")
return _MakeResult(
value_mapping=value_mapping,
all_params=all_params,
used_args=used_args,
meta_factory_value=meta_factory_value,
missing_params=missing_params,
)