aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/target/config.py
diff options
context:
space:
mode:
authorBenjamin Klimczak <benjamin.klimczak@arm.com>2024-03-21 17:33:17 +0000
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2024-03-22 10:06:28 +0000
commitc7ee5b783f044d7ff641773aa385840f5ff944cc (patch)
tree297f308978b00282d8ebd3a1f71e1ae5e678a767 /src/mlia/target/config.py
parent508281df31dc3c18f2e007f4dd505160342a681a (diff)
downloadmlia-c7ee5b783f044d7ff641773aa385840f5ff944cc.tar.gz
refactor: Backend dependencies and more
- Add backend dependencies: One backend can now depend on another backend. - Re-factor 'DownloadArtifact': - Rename 'DownloadArtifact' to 'DownloadConfig' - Remove attributes 'name' and 'version' not relevant for downloads - Add helper properties: - 'filename' parses the URL to extract the file name from the end - 'headers' calls the function to generate a HTML header for the download - Add OutputLogger helper class - Re-factor handling of backend configurations in the target profiles. Change-Id: Ifda6cf12c375d0c1747d7e4130a0370d22c3d33a Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Diffstat (limited to 'src/mlia/target/config.py')
-rw-r--r--src/mlia/target/config.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mlia/target/config.py b/src/mlia/target/config.py
index 8ccdad8..8492086 100644
--- a/src/mlia/target/config.py
+++ b/src/mlia/target/config.py
@@ -85,9 +85,11 @@ T = TypeVar("T", bound="TargetProfile")
class TargetProfile(ABC):
"""Base class for target profiles."""
- def __init__(self, target: str) -> None:
+ def __init__(self, target: str, backend_config: dict | None = None) -> None:
"""Init TargetProfile instance with the target name."""
self.target = target
+ # Load backend config(s) to be handled by the backend(s) later.
+ self.backend_config = {} if backend_config is None else backend_config
@classmethod
def load(cls: type[T], path: str | Path) -> T: