66
77from __future__ import annotations
88
9- import itertools
109import logging
11-
1210from dataclasses import dataclass
1311from pathlib import Path
1412from typing import Iterable , List , Optional , Set
1513
1614import pydantic
17- from setuptools .build_meta import build_editable
1815
19- from mbed_tools .build ._internal .config .schemas import MbedAppJSON
20- from mbed_tools .lib .json_helpers import decode_json_file
21- from mbed_tools .project import MbedProgram
16+ from mbed_tools .build ._internal .config import source
2217from mbed_tools .build ._internal .config .config import Config
18+ from mbed_tools .build ._internal .config .schemas import MbedAppJSON
2319from mbed_tools .build ._internal .find_files import LabelFilter , filter_files , find_files
20+ from mbed_tools .lib .json_helpers import decode_json_file
2421from mbed_tools .project import MbedProgram
2522
2623logger = logging .getLogger (__name__ )
@@ -98,12 +95,12 @@ def _assemble_config_from_sources(
9895 # if it does not pass the schema. This provides compatibility with older projects, as mbed_app.json has
9996 # historically been a total wild west where any internal Mbed state could potentially be overridden.
10097 try :
101- MbedAppJSON .model_validate (mbed_app_json_dict , strict = True )
98+ _ = MbedAppJSON .model_validate (mbed_app_json_dict , strict = True )
10299 except pydantic .ValidationError as ex :
103100 logger .warning (
104101 "mbed_app.json5 failed to validate against the schema. This likely means it contains deprecated attributes, misspelled attributes, or overrides for things that should not be set in mbed_app.json5. This version of mbed-os still allows this, but this will change in the future."
105102 )
106- logger .warning ("Error was: " + str (ex ))
103+ logger .warning ("Error was: %s" , str (ex ))
107104
108105 app_data = source .prepare (
109106 "mbed_app.json5" , mbed_app_json_dict , source_name = "app" , target_filters = filter_data .labels
@@ -123,7 +120,7 @@ class FileFilterData:
123120 requires : Set [str ]
124121
125122 @classmethod
126- def from_config (cls , config : Config ) -> " FileFilterData" :
123+ def from_config (cls , config : Config ) -> FileFilterData :
127124 """Extract file filters from a Config object."""
128125 return cls (
129126 labels = config .get ("labels" , set ()) | config .get ("extra_labels" , set ()),
0 commit comments