idf-build-apps 2.5.1__py3-none-any.whl → 2.5.3__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.
@@ -8,7 +8,7 @@ Tools for building ESP-IDF related apps.
8
8
  # ruff: noqa: E402
9
9
  # avoid circular imports
10
10
 
11
- __version__ = '2.5.1'
11
+ __version__ = '2.5.3'
12
12
 
13
13
  from .session_args import (
14
14
  SessionArgs,
idf_build_apps/args.py CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  import argparse
5
5
  import enum
6
+ import glob
6
7
  import inspect
7
8
  import logging
8
9
  import os
@@ -117,6 +118,7 @@ class BaseArguments(BaseSettings):
117
118
  toml_file='.idf_build_apps.toml',
118
119
  pyproject_toml_table_header=('tool', 'idf-build-apps'),
119
120
  pyproject_toml_depth=sys.maxsize,
121
+ extra='ignore',
120
122
  )
121
123
 
122
124
  @classmethod
@@ -140,8 +142,9 @@ class BaseArguments(BaseSettings):
140
142
  if info.field_name and info.field_name in cls.model_fields:
141
143
  f = cls.model_fields[info.field_name]
142
144
  meta = get_meta(f)
143
- if meta and meta.validate_method and ValidateMethod.TO_LIST in meta.validate_method:
144
- return to_list(v)
145
+ if meta and meta.validate_method:
146
+ if ValidateMethod.TO_LIST in meta.validate_method:
147
+ return to_list(v)
145
148
 
146
149
  return v
147
150
 
@@ -189,6 +192,15 @@ class DependencyDrivenBuildArguments(GlobalArguments):
189
192
  validation_alias=AliasChoices('manifest_files', 'manifest_file'),
190
193
  default=None,
191
194
  )
195
+ manifest_filepatterns: t.Optional[t.List[str]] = field(
196
+ FieldMetadata(
197
+ validate_method=[ValidateMethod.TO_LIST],
198
+ nargs='+',
199
+ ),
200
+ description='space-separated list of file patterns to search for the manifest files. '
201
+ 'The matched files will be loaded as the manifest files.',
202
+ default=None,
203
+ )
192
204
  manifest_rootpath: str = field(
193
205
  None,
194
206
  description='Root path to resolve the relative paths defined in the manifest files. '
@@ -268,7 +280,7 @@ class DependencyDrivenBuildArguments(GlobalArguments):
268
280
  )
269
281
  compare_manifest_sha_filepath: t.Optional[str] = field(
270
282
  None,
271
- description='Path to the file containing the sha256 hash of the manifest rules. '
283
+ description='Path to the file containing the hash of the manifest rules. '
272
284
  'Compare the hash with the current manifest rules. '
273
285
  'All matched apps will be built if the corresponding manifest rule is modified',
274
286
  default=None,
@@ -277,6 +289,17 @@ class DependencyDrivenBuildArguments(GlobalArguments):
277
289
  def model_post_init(self, __context: Any) -> None:
278
290
  super().model_post_init(__context)
279
291
 
292
+ if self.manifest_filepatterns:
293
+ matched_paths = set()
294
+ for pat in [to_absolute_path(p, self.manifest_rootpath) for p in self.manifest_filepatterns]:
295
+ matched_paths.update(glob.glob(str(pat), recursive=True))
296
+
297
+ if matched_paths:
298
+ if self.manifest_files:
299
+ self.manifest_files.extend(matched_paths)
300
+ else:
301
+ self.manifest_files = list(matched_paths)
302
+
280
303
  Manifest.CHECK_MANIFEST_RULES = self.check_manifest_rules
281
304
  if self.manifest_files:
282
305
  App.MANIFEST = Manifest.from_files(
@@ -799,14 +822,19 @@ def add_args_to_parser(argument_cls: t.Type[BaseArguments], parser: argparse.Arg
799
822
  kwargs['required'] = True
800
823
  if f_meta.action:
801
824
  kwargs['action'] = f_meta.action
825
+ # to make the CLI override config file work
826
+ if f_meta.action == 'store_true':
827
+ kwargs['default'] = None
828
+
802
829
  if f_meta.nargs:
803
830
  kwargs['nargs'] = f_meta.nargs
804
831
  if f_meta.choices:
805
832
  kwargs['choices'] = f_meta.choices
806
833
  if f_meta.default:
807
834
  kwargs['default'] = f_meta.default
808
- if 'default' not in kwargs:
809
- kwargs['default'] = f.default
835
+
836
+ # here in CLI arguments, don't set the default to field.default
837
+ # otherwise it will override the config file settings
810
838
 
811
839
  parser.add_argument(
812
840
  *names,
idf_build_apps/finder.py CHANGED
@@ -33,6 +33,7 @@ def _get_apps_from_path(
33
33
  app_cls: t.Type[App] = CMakeApp,
34
34
  args: FindArguments,
35
35
  ) -> t.List[App]:
36
+ # trigger test
36
37
  def _validate_app(_app: App) -> bool:
37
38
  if target not in _app.supported_targets:
38
39
  LOGGER.debug('=> Ignored. %s only supports targets: %s', _app, ', '.join(_app.supported_targets))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: idf-build-apps
3
- Version: 2.5.1
3
+ Version: 2.5.3
4
4
  Summary: Tools for building ESP-IDF related apps.
5
5
  Author-email: Fu Hanxi <fuhanxi@espressif.com>
6
6
  Requires-Python: >=3.7
@@ -1,10 +1,10 @@
1
- idf_build_apps/__init__.py,sha256=hPsqVwLnkcGIEQNAReIvWhXRDoov8t70997wSn1zJ0g,650
1
+ idf_build_apps/__init__.py,sha256=NC4Y3XHI515eQBX8WScygPjZaCgogb4zOZjjg_UEyaY,650
2
2
  idf_build_apps/__main__.py,sha256=8E-5xHm2MlRun0L88XJleNh5U50dpE0Q1nK5KqomA7I,182
3
3
  idf_build_apps/app.py,sha256=F-MKOsaz7cJ0H2wsEE4gpO4kkkEdkyFmIZBHDoM2qgs,37359
4
- idf_build_apps/args.py,sha256=Y4Wwoi8XYLjf8lWmCUm197NSzSBa4eC95QAyx4q7-6Q,31668
4
+ idf_build_apps/args.py,sha256=3lSzUZIkfJzzmhCJ8GICtKQQ1iY-dDotIOmmqwwUrF8,32762
5
5
  idf_build_apps/autocompletions.py,sha256=g-bx0pzXoFKI0VQqftkHyGVWN6MLjuFOdozeuAf45yo,2138
6
6
  idf_build_apps/constants.py,sha256=07ve2FtWuLBuc_6LFzbs1XncB1VNi9HJUqGjQQauRNM,3952
7
- idf_build_apps/finder.py,sha256=kfZaGWJfPUwWAbaOj_W3Fu97SIIFEsv1R_dJucjbFHw,5691
7
+ idf_build_apps/finder.py,sha256=Wv0QYArXmVZZDslLxfPwGgt202s94112AlAHk0s3N1g,5710
8
8
  idf_build_apps/log.py,sha256=pyvT7N4MWzGjIXph5mThQCGBiSt53RNPW0WrFfLr0Kw,2650
9
9
  idf_build_apps/main.py,sha256=Z_hetbOavgCJZQPaP01_jx57fR1w0DefiFz0J2cCwp0,16498
10
10
  idf_build_apps/session_args.py,sha256=2WDTy40IFAc0KQ57HaeBcYj_k10eUXRKkDOWLrFCaHY,2985
@@ -20,8 +20,8 @@ idf_build_apps/vendors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
20
20
  idf_build_apps/vendors/pydantic_sources.py,sha256=2IN6opo6qjCwaqhERFbgA4PtEwqKaTtEkccy5_fYAT0,4130
21
21
  idf_build_apps/yaml/__init__.py,sha256=W-3z5no07RQ6eYKGyOAPA8Z2CLiMPob8DD91I4URjrA,162
22
22
  idf_build_apps/yaml/parser.py,sha256=b3LvogO6do-eJPRsYzT-8xk8AT2MnXpLCzQutJqyC7M,2128
23
- idf_build_apps-2.5.1.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
24
- idf_build_apps-2.5.1.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
25
- idf_build_apps-2.5.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
26
- idf_build_apps-2.5.1.dist-info/METADATA,sha256=lvliMyMStV-5w_77UputZgbH9ZL2aDagexjxU6OUi-I,4610
27
- idf_build_apps-2.5.1.dist-info/RECORD,,
23
+ idf_build_apps-2.5.3.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
24
+ idf_build_apps-2.5.3.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
25
+ idf_build_apps-2.5.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
26
+ idf_build_apps-2.5.3.dist-info/METADATA,sha256=XZLgJfyaJgEl6rULmN0zIeG9quKVH9EhuigO1hnQOvk,4610
27
+ idf_build_apps-2.5.3.dist-info/RECORD,,