diff --git a/build_pipeline_generator.py b/build_pipeline_generator.py index 4b94a0476f56cab3a3071353aedf92b45b366288..d228a6c1c6bf3021819d1e7af778700fbb973123 100644 --- a/build_pipeline_generator.py +++ b/build_pipeline_generator.py @@ -7,7 +7,8 @@ from argparse import ArgumentParser sys.path.append(str(Path("common_py/src/").resolve())) os.environ["VIDEOAG_CONFIG"] = "/dev/null" -from videoag_common.miscellaneous import CJsonValue, JsonDataClass, JsonSerializableEnum, json_field, JsonOnlyDeserializable +from videoag_common.miscellaneous import CJsonValue, JsonDataClass, JsonSerializableEnum, json_field, JsonSerializable, \ + JsonTypes class OsType(JsonSerializableEnum): @@ -15,7 +16,7 @@ class OsType(JsonSerializableEnum): ALPINE = "alpine" -class OsModuleDependencies(JsonOnlyDeserializable): +class OsModuleDependencies(JsonSerializable): def __init__(self, names_by_type: dict[OsType, set[str]] or None = None): super().__init__() @@ -33,6 +34,10 @@ class OsModuleDependencies(JsonOnlyDeserializable): names_list.append(val.as_string(max_length=100)) return OsModuleDependencies(names_by_type) + def to_json(self) -> JsonTypes: + # Not supported/needed + raise NotImplementedError() + def update(self, other: "OsModuleDependencies"): for type, names in other._names_by_type.items(): self._names_by_type[type].update(names) diff --git a/common_py/src/videoag_common/miscellaneous/json_serializable.py b/common_py/src/videoag_common/miscellaneous/json_serializable.py index 1fa64a24359567c870204bb56627225c4f58d041..e492d58e497707cfbd339c6cbe1e64261d1e0d60 100644 --- a/common_py/src/videoag_common/miscellaneous/json_serializable.py +++ b/common_py/src/videoag_common/miscellaneous/json_serializable.py @@ -302,7 +302,8 @@ class JsonDataClass(JsonSerializable): args = {} for id, field in cls.__all_json_fields__.items(): - unused_keys.remove(id) + if id in unused_keys: + unused_keys.remove(id) val = field.from_json(json, id) if val != dataclasses.MISSING: