idf-build-apps 2.8.1__py3-none-any.whl → 2.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- idf_build_apps/__init__.py +1 -1
- idf_build_apps/__main__.py +1 -1
- idf_build_apps/args.py +35 -8
- idf_build_apps/autocompletions.py +1 -1
- idf_build_apps/finder.py +1 -1
- idf_build_apps/junit/__init__.py +1 -1
- idf_build_apps/junit/utils.py +1 -1
- idf_build_apps/main.py +14 -2
- idf_build_apps/manifest/manifest.py +8 -1
- idf_build_apps/session_args.py +1 -1
- idf_build_apps/yaml/__init__.py +1 -1
- idf_build_apps/yaml/parser.py +1 -1
- {idf_build_apps-2.8.1.dist-info → idf_build_apps-2.10.0.dist-info}/METADATA +1 -1
- idf_build_apps-2.10.0.dist-info/RECORD +27 -0
- {idf_build_apps-2.8.1.dist-info → idf_build_apps-2.10.0.dist-info}/WHEEL +1 -1
- idf_build_apps-2.8.1.dist-info/RECORD +0 -27
- {idf_build_apps-2.8.1.dist-info → idf_build_apps-2.10.0.dist-info}/entry_points.txt +0 -0
- {idf_build_apps-2.8.1.dist-info → idf_build_apps-2.10.0.dist-info}/licenses/LICENSE +0 -0
idf_build_apps/__init__.py
CHANGED
idf_build_apps/__main__.py
CHANGED
idf_build_apps/args.py
CHANGED
|
@@ -14,6 +14,7 @@ from copy import deepcopy
|
|
|
14
14
|
from dataclasses import dataclass
|
|
15
15
|
from io import TextIOWrapper
|
|
16
16
|
from pathlib import Path
|
|
17
|
+
from string import Template
|
|
17
18
|
from typing import Any
|
|
18
19
|
|
|
19
20
|
from pydantic import AliasChoices, Field, computed_field, field_validator
|
|
@@ -112,6 +113,29 @@ def get_meta(f: FieldInfo) -> t.Optional[FieldMetadata]:
|
|
|
112
113
|
return None
|
|
113
114
|
|
|
114
115
|
|
|
116
|
+
def expand_vars(v: t.Optional[str]) -> t.Optional[str]:
|
|
117
|
+
"""
|
|
118
|
+
Expand environment variables in the string. If the variable is not found, use an empty string.
|
|
119
|
+
|
|
120
|
+
:param v: string to expand
|
|
121
|
+
:return: expanded string or None if the input is None
|
|
122
|
+
"""
|
|
123
|
+
if v is None:
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
unknown_vars: t.Dict[str, str] = dict()
|
|
127
|
+
while True:
|
|
128
|
+
try:
|
|
129
|
+
v = Template(v).substitute(os.environ, **unknown_vars)
|
|
130
|
+
except KeyError as e:
|
|
131
|
+
LOGGER.debug('Environment variable %s not found. use empty string', e)
|
|
132
|
+
unknown_vars[e.args[0]] = ''
|
|
133
|
+
else:
|
|
134
|
+
break
|
|
135
|
+
|
|
136
|
+
return v
|
|
137
|
+
|
|
138
|
+
|
|
115
139
|
class BaseArguments(BaseSettings):
|
|
116
140
|
"""Base settings class for all settings classes"""
|
|
117
141
|
|
|
@@ -154,7 +178,7 @@ class BaseArguments(BaseSettings):
|
|
|
154
178
|
if method == ValidateMethod.TO_LIST:
|
|
155
179
|
v = to_list(v)
|
|
156
180
|
elif method == ValidateMethod.EXPAND_VARS:
|
|
157
|
-
v =
|
|
181
|
+
v = expand_vars(v)
|
|
158
182
|
else:
|
|
159
183
|
raise NotImplementedError(f'Unknown validate method: {method}')
|
|
160
184
|
|
|
@@ -390,10 +414,9 @@ class FindBuildArguments(DependencyDrivenBuildArguments):
|
|
|
390
414
|
default='all', # type: ignore
|
|
391
415
|
)
|
|
392
416
|
build_system: t.Union[str, t.Type[App]] = field(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
description='Filter the apps by build system. By default set to "cmake"',
|
|
417
|
+
None,
|
|
418
|
+
description='Filter the apps by build system. By default set to "cmake". '
|
|
419
|
+
'Can be either "cmake", "make" or a custom App class path in format "module:class"',
|
|
397
420
|
default='cmake', # type: ignore
|
|
398
421
|
)
|
|
399
422
|
recursive: bool = field(
|
|
@@ -689,9 +712,10 @@ class BuildArguments(FindBuildArguments):
|
|
|
689
712
|
FieldMetadata(
|
|
690
713
|
deprecates={'collect_size_info': {}},
|
|
691
714
|
hidden=True,
|
|
715
|
+
validate_method=[ValidateMethod.EXPAND_VARS],
|
|
692
716
|
),
|
|
693
717
|
description='Record size json filepath of the built apps to the specified file. '
|
|
694
|
-
'Each line is a json string. Can expand placeholders @p',
|
|
718
|
+
'Each line is a json string. Can expand placeholders @p. Support environment variables.',
|
|
695
719
|
validation_alias=AliasChoices('collect_size_info_filename', 'collect_size_info'),
|
|
696
720
|
default=None, # type: ignore
|
|
697
721
|
exclude=True, # computed field is used
|
|
@@ -700,9 +724,10 @@ class BuildArguments(FindBuildArguments):
|
|
|
700
724
|
FieldMetadata(
|
|
701
725
|
deprecates={'collect_app_info': {}},
|
|
702
726
|
hidden=True,
|
|
727
|
+
validate_method=[ValidateMethod.EXPAND_VARS],
|
|
703
728
|
),
|
|
704
729
|
description='Record serialized app model of the built apps to the specified file. '
|
|
705
|
-
'Each line is a json string. Can expand placeholders @p',
|
|
730
|
+
'Each line is a json string. Can expand placeholders @p. Support environment variables.',
|
|
706
731
|
validation_alias=AliasChoices('collect_app_info_filename', 'collect_app_info'),
|
|
707
732
|
default=None, # type: ignore
|
|
708
733
|
exclude=True, # computed field is used
|
|
@@ -711,8 +736,10 @@ class BuildArguments(FindBuildArguments):
|
|
|
711
736
|
FieldMetadata(
|
|
712
737
|
deprecates={'junitxml': {}},
|
|
713
738
|
hidden=True,
|
|
739
|
+
validate_method=[ValidateMethod.EXPAND_VARS],
|
|
714
740
|
),
|
|
715
|
-
description='Path to the junitxml file to record the build results. Can expand placeholder @p'
|
|
741
|
+
description='Path to the junitxml file to record the build results. Can expand placeholder @p. '
|
|
742
|
+
'Support environment variables.',
|
|
716
743
|
validation_alias=AliasChoices('junitxml_filename', 'junitxml'),
|
|
717
744
|
default=None, # type: ignore
|
|
718
745
|
exclude=True, # computed field is used
|
idf_build_apps/finder.py
CHANGED
idf_build_apps/junit/__init__.py
CHANGED
idf_build_apps/junit/utils.py
CHANGED
idf_build_apps/main.py
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
6
|
import argparse
|
|
7
|
+
import importlib
|
|
7
8
|
import json
|
|
8
9
|
import logging
|
|
9
10
|
import os
|
|
@@ -90,13 +91,24 @@ def find_apps(
|
|
|
90
91
|
|
|
91
92
|
app_cls: t.Type[App]
|
|
92
93
|
if isinstance(find_arguments.build_system, str):
|
|
93
|
-
# backwards compatible
|
|
94
94
|
if find_arguments.build_system == 'cmake':
|
|
95
95
|
app_cls = CMakeApp
|
|
96
96
|
elif find_arguments.build_system == 'make':
|
|
97
97
|
app_cls = MakeApp
|
|
98
|
+
elif ':' in find_arguments.build_system:
|
|
99
|
+
# Custom App class in format "module:class"
|
|
100
|
+
try:
|
|
101
|
+
module_path, class_name = find_arguments.build_system.split(':')
|
|
102
|
+
module = importlib.import_module(module_path)
|
|
103
|
+
app_cls = getattr(module, class_name)
|
|
104
|
+
if not issubclass(app_cls, App):
|
|
105
|
+
raise ValueError(f'Class {class_name} must be a subclass of App')
|
|
106
|
+
except (ValueError, ImportError, AttributeError) as e:
|
|
107
|
+
raise ValueError(f'Invalid custom App class path: {find_arguments.build_system}. Error: {e!s}')
|
|
98
108
|
else:
|
|
99
|
-
raise ValueError(
|
|
109
|
+
raise ValueError(
|
|
110
|
+
'build_system must be either "cmake", "make" or a custom App class path in format "module:class"'
|
|
111
|
+
)
|
|
100
112
|
else:
|
|
101
113
|
app_cls = find_arguments.build_system
|
|
102
114
|
|
|
@@ -89,7 +89,10 @@ class FolderRule:
|
|
|
89
89
|
disable_test: t.Optional[t.List[t.Dict[str, t.Any]]] = None,
|
|
90
90
|
depends_components: t.Optional[t.List[t.Union[str, t.Dict[str, t.Any]]]] = None,
|
|
91
91
|
depends_filepatterns: t.Optional[t.List[t.Union[str, t.Dict[str, t.Any]]]] = None,
|
|
92
|
+
manifest_filepath: t.Optional[str] = None,
|
|
92
93
|
) -> None:
|
|
94
|
+
self._manifest_filepath = manifest_filepath
|
|
95
|
+
|
|
93
96
|
self.folder = os.path.abspath(folder)
|
|
94
97
|
|
|
95
98
|
def _clause_to_if_clause(clause: t.Dict[str, t.Any]) -> IfClause:
|
|
@@ -168,6 +171,10 @@ class FolderRule:
|
|
|
168
171
|
def __repr__(self) -> str:
|
|
169
172
|
return f'FolderRule({self.folder})'
|
|
170
173
|
|
|
174
|
+
@property
|
|
175
|
+
def by_manifest_file(self) -> t.Optional[str]:
|
|
176
|
+
return self._manifest_filepath
|
|
177
|
+
|
|
171
178
|
def _enable_build(self, target: str, config_name: str) -> bool:
|
|
172
179
|
if self.enable:
|
|
173
180
|
res = False
|
|
@@ -309,7 +316,7 @@ class Manifest:
|
|
|
309
316
|
LOGGER.warning(msg)
|
|
310
317
|
|
|
311
318
|
try:
|
|
312
|
-
rules.append(FolderRule(folder, **folder_rule if folder_rule else {}))
|
|
319
|
+
rules.append(FolderRule(folder, **folder_rule if folder_rule else {}, manifest_filepath=str(path)))
|
|
313
320
|
except InvalidIfClause as e:
|
|
314
321
|
raise InvalidManifest(f'Invalid manifest file {path}: {e}')
|
|
315
322
|
|
idf_build_apps/session_args.py
CHANGED
idf_build_apps/yaml/__init__.py
CHANGED
idf_build_apps/yaml/parser.py
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
idf_build_apps/__init__.py,sha256=Ha5ZrybfsaB7tFsUqXP6HU-k0PWWSR-8MK-OvuOfHQk,651
|
|
2
|
+
idf_build_apps/__main__.py,sha256=pT6OsFQRjCw39Jg43HAeGKzq8h5E_0m7kHDE2QMqDe0,182
|
|
3
|
+
idf_build_apps/app.py,sha256=DKofid9Z0DqoDL1DcsO05rVBtgSd5O9SoCDqKzl8iFQ,36674
|
|
4
|
+
idf_build_apps/args.py,sha256=Nbq5LBRowSFuJ4u4KFqPh7FVGMTHHxLqdH9ZUkCRTOI,35934
|
|
5
|
+
idf_build_apps/autocompletions.py,sha256=2fZQxzgZ21ie_2uk-B-7-xWYCChfOSgRFRYb7I2Onfo,2143
|
|
6
|
+
idf_build_apps/constants.py,sha256=2iwLPZRhSQcn1v4RAcOJnHbqp1fDTp6A1gHaxn5ciTE,2166
|
|
7
|
+
idf_build_apps/finder.py,sha256=wayWyUSCyMvkY72xU-b7IW7I48cv6C-pRqJHMHQsh0c,5794
|
|
8
|
+
idf_build_apps/log.py,sha256=15sSQhv9dJsHShDR2KgFGFp8ByjV0HogLr1X1lHYqGs,3899
|
|
9
|
+
idf_build_apps/main.py,sha256=COudSnUqLEuIGnIVKi06Q4h_McSXwwOpm8aDRGjwnSc,18106
|
|
10
|
+
idf_build_apps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
idf_build_apps/session_args.py,sha256=yM-78vFzCDCdhXHNxTALmzE4w2NSmka8yVBbh3wtvC8,2985
|
|
12
|
+
idf_build_apps/utils.py,sha256=cQJ5N-53vrASa4d8WW0AQCPJzendArXyU3kB5Vx-AH8,10880
|
|
13
|
+
idf_build_apps/junit/__init__.py,sha256=ljILW1rfeBAIlwZIw8jstYrVbugErlmCYzSzJwNFC2I,231
|
|
14
|
+
idf_build_apps/junit/report.py,sha256=yzt5SiJEA_AUlw2Ld23J7enYlfDluvmKAcCnAM8ccqE,6565
|
|
15
|
+
idf_build_apps/junit/utils.py,sha256=idBrLgsz6Co2QUQqq1AiyzRHnqbJf_EoykEAxCkjHZw,1303
|
|
16
|
+
idf_build_apps/manifest/__init__.py,sha256=LYGR9doEKGPEdsJPuHnmJmV-qw2kuAipV0bodkhY_JE,399
|
|
17
|
+
idf_build_apps/manifest/manifest.py,sha256=Y2NCwQE_T3kXtQJVPpA4wMi_X3amjjI-eSsKLtqmRXo,15031
|
|
18
|
+
idf_build_apps/manifest/soc_header.py,sha256=_F6H5-HP6ateAqKUGlRGH-SUtQ8NJ1RI0hBeCFvsDYA,172
|
|
19
|
+
idf_build_apps/vendors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
idf_build_apps/vendors/pydantic_sources.py,sha256=cxSIPRc3eI5peVMhDxwf58YaGhuG4SCwPRVX2znFEek,4553
|
|
21
|
+
idf_build_apps/yaml/__init__.py,sha256=R6pYasVsD31maeZ4dWRZnS10hwzM7gXdnfzDsOIRJ-4,167
|
|
22
|
+
idf_build_apps/yaml/parser.py,sha256=IhY7rCWXOxrzzgEiKipTdPs_8yXDf8JZr-sMewV1pk8,2133
|
|
23
|
+
idf_build_apps-2.10.0.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
|
|
24
|
+
idf_build_apps-2.10.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
25
|
+
idf_build_apps-2.10.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
26
|
+
idf_build_apps-2.10.0.dist-info/METADATA,sha256=TilWcEgDYDhf8AKhgjfo5s9X2Hdfhdr6eRnZigvRNQg,4736
|
|
27
|
+
idf_build_apps-2.10.0.dist-info/RECORD,,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
idf_build_apps/__init__.py,sha256=IMmTkYj0ST-jiyD0xXbUAvlIxu66jnXXcicRuu9tL-k,650
|
|
2
|
-
idf_build_apps/__main__.py,sha256=8E-5xHm2MlRun0L88XJleNh5U50dpE0Q1nK5KqomA7I,182
|
|
3
|
-
idf_build_apps/app.py,sha256=DKofid9Z0DqoDL1DcsO05rVBtgSd5O9SoCDqKzl8iFQ,36674
|
|
4
|
-
idf_build_apps/args.py,sha256=4sDupbemB66vwX60Dr5FTqfz5MvBqtyk_OPwKNidAFM,34955
|
|
5
|
-
idf_build_apps/autocompletions.py,sha256=g-bx0pzXoFKI0VQqftkHyGVWN6MLjuFOdozeuAf45yo,2138
|
|
6
|
-
idf_build_apps/constants.py,sha256=2iwLPZRhSQcn1v4RAcOJnHbqp1fDTp6A1gHaxn5ciTE,2166
|
|
7
|
-
idf_build_apps/finder.py,sha256=hY6uSMB2s65MqMKIDBSHABOfa93mOLT7x5hlMxC43EQ,5794
|
|
8
|
-
idf_build_apps/log.py,sha256=15sSQhv9dJsHShDR2KgFGFp8ByjV0HogLr1X1lHYqGs,3899
|
|
9
|
-
idf_build_apps/main.py,sha256=7CGwRBxi9j2Yqw7zYkfNbKXg_DSkLWkWMYvgiYjUFl4,17393
|
|
10
|
-
idf_build_apps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
idf_build_apps/session_args.py,sha256=2WDTy40IFAc0KQ57HaeBcYj_k10eUXRKkDOWLrFCaHY,2985
|
|
12
|
-
idf_build_apps/utils.py,sha256=cQJ5N-53vrASa4d8WW0AQCPJzendArXyU3kB5Vx-AH8,10880
|
|
13
|
-
idf_build_apps/junit/__init__.py,sha256=IxvdaS6eSXp7kZxRuXqyZyGxuA_A1nOW1jF1HMi8Gns,231
|
|
14
|
-
idf_build_apps/junit/report.py,sha256=yzt5SiJEA_AUlw2Ld23J7enYlfDluvmKAcCnAM8ccqE,6565
|
|
15
|
-
idf_build_apps/junit/utils.py,sha256=NXZxQD4tdbSVKjKMNx1kO2H3IoEiysXkDoDjLEf1RO8,1303
|
|
16
|
-
idf_build_apps/manifest/__init__.py,sha256=LYGR9doEKGPEdsJPuHnmJmV-qw2kuAipV0bodkhY_JE,399
|
|
17
|
-
idf_build_apps/manifest/manifest.py,sha256=5BIzNzGAk0w5qOCTMGsmvKcN4DQLwUi6JVGt2G4JKQs,14793
|
|
18
|
-
idf_build_apps/manifest/soc_header.py,sha256=_F6H5-HP6ateAqKUGlRGH-SUtQ8NJ1RI0hBeCFvsDYA,172
|
|
19
|
-
idf_build_apps/vendors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
idf_build_apps/vendors/pydantic_sources.py,sha256=cxSIPRc3eI5peVMhDxwf58YaGhuG4SCwPRVX2znFEek,4553
|
|
21
|
-
idf_build_apps/yaml/__init__.py,sha256=W-3z5no07RQ6eYKGyOAPA8Z2CLiMPob8DD91I4URjrA,162
|
|
22
|
-
idf_build_apps/yaml/parser.py,sha256=b3LvogO6do-eJPRsYzT-8xk8AT2MnXpLCzQutJqyC7M,2128
|
|
23
|
-
idf_build_apps-2.8.1.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
|
|
24
|
-
idf_build_apps-2.8.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
25
|
-
idf_build_apps-2.8.1.dist-info/WHEEL,sha256=_2ozNFCLWc93bK4WKHCO-eDUENDlo-dgc9cU3qokYO4,82
|
|
26
|
-
idf_build_apps-2.8.1.dist-info/METADATA,sha256=kQq1NI7VocSdPZtH66DlY5E1pj3D4ULgtNaIsmEkAto,4735
|
|
27
|
-
idf_build_apps-2.8.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|