From 66882a57ac23d3b786756edd4b43f09039c33db5 Mon Sep 17 00:00:00 2001 From: MaXFeeD Date: Mon, 26 May 2025 20:58:16 +0300 Subject: [PATCH] Reference template --- src/icmtoolchain/__init__.py | 2 +- src/icmtoolchain/language.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/icmtoolchain/__init__.py b/src/icmtoolchain/__init__.py index 4fa050c..995993d 100644 --- a/src/icmtoolchain/__init__.py +++ b/src/icmtoolchain/__init__.py @@ -1,7 +1,7 @@ import os from copy import deepcopy from os.path import abspath, dirname, isfile, join, splitdrive -from typing import Iterable, Optional, Union +from typing import Iterable, Optional from .config import Config, FileConfig diff --git a/src/icmtoolchain/language.py b/src/icmtoolchain/language.py index 29660d8..339c0d7 100644 --- a/src/icmtoolchain/language.py +++ b/src/icmtoolchain/language.py @@ -166,13 +166,22 @@ class MakeDataConfig(FileConfig, metaclass=ABCMeta): """ return False + def iterate_dependencies(self) -> Iterable['MakeDataConfig']: + """Each project may contain dependencies that must be compiled before that project itself. + When instantiating a config, toolchain will make a dependency graph first, and only then build your project. + + Returns: + Iterable[MakeDataConfig]: optional project data on which manifest is based + """ + ... + @abstractmethod def obtain_project_data(self) -> Optional[Union[MakeModData, MakePackData]]: """Basic data describing this config and project as a whole. They should be provided in any case. If there is no value, no built-in startup configurations are created. Returns: - Union[MakeModData, MakePackData]: project data on which manifest is based + Optional[Union[MakeModData, MakePackData]]: optional project data on which manifest is based """ ... @@ -352,7 +361,7 @@ class MakeDataConfig(FileConfig, metaclass=ABCMeta): Args: criteria (Union[str, Callable[[str], bool]]): filter configs by filename or deeper callable inspection - data (type['MakeDataConfig']): type to be created, which will become a config with data + data (type[MakeDataConfig]): type to be created, which will become a config with data Raises: ValueError: if this criteria has already been registered earlier