idf-build-apps 2.8.1__py3-none-any.whl → 2.9.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.
@@ -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.8.1'
11
+ __version__ = '2.9.0'
12
12
 
13
13
  from .session_args import (
14
14
  SessionArgs,
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  from .main import (
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 = os.path.expandvars(v)
181
+ v = expand_vars(v)
158
182
  else:
159
183
  raise NotImplementedError(f'Unknown validate method: {method}')
160
184
 
@@ -689,9 +713,10 @@ class BuildArguments(FindBuildArguments):
689
713
  FieldMetadata(
690
714
  deprecates={'collect_size_info': {}},
691
715
  hidden=True,
716
+ validate_method=[ValidateMethod.EXPAND_VARS],
692
717
  ),
693
718
  description='Record size json filepath of the built apps to the specified file. '
694
- 'Each line is a json string. Can expand placeholders @p',
719
+ 'Each line is a json string. Can expand placeholders @p. Support environment variables.',
695
720
  validation_alias=AliasChoices('collect_size_info_filename', 'collect_size_info'),
696
721
  default=None, # type: ignore
697
722
  exclude=True, # computed field is used
@@ -700,9 +725,10 @@ class BuildArguments(FindBuildArguments):
700
725
  FieldMetadata(
701
726
  deprecates={'collect_app_info': {}},
702
727
  hidden=True,
728
+ validate_method=[ValidateMethod.EXPAND_VARS],
703
729
  ),
704
730
  description='Record serialized app model of the built apps to the specified file. '
705
- 'Each line is a json string. Can expand placeholders @p',
731
+ 'Each line is a json string. Can expand placeholders @p. Support environment variables.',
706
732
  validation_alias=AliasChoices('collect_app_info_filename', 'collect_app_info'),
707
733
  default=None, # type: ignore
708
734
  exclude=True, # computed field is used
@@ -711,8 +737,10 @@ class BuildArguments(FindBuildArguments):
711
737
  FieldMetadata(
712
738
  deprecates={'junitxml': {}},
713
739
  hidden=True,
740
+ validate_method=[ValidateMethod.EXPAND_VARS],
714
741
  ),
715
- description='Path to the junitxml file to record the build results. Can expand placeholder @p',
742
+ description='Path to the junitxml file to record the build results. Can expand placeholder @p. '
743
+ 'Support environment variables.',
716
744
  validation_alias=AliasChoices('junitxml_filename', 'junitxml'),
717
745
  default=None, # type: ignore
718
746
  exclude=True, # computed field is used
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import os
idf_build_apps/finder.py CHANGED
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import logging
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  from .report import (
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import os
@@ -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
 
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import logging
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  from .parser import (
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
1
+ # SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import typing as t
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: idf-build-apps
3
- Version: 2.8.1
3
+ Version: 2.9.0
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
@@ -0,0 +1,27 @@
1
+ idf_build_apps/__init__.py,sha256=OZJ67f2AZ_iIZsd6KKhg9CsTDQLWPKJEjQD4r3ABbnU,650
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=fkRCeADtNUgsPgR6-L-6ZaPxQZqzjg9e6Xq0RGQj--Q,35899
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=7CGwRBxi9j2Yqw7zYkfNbKXg_DSkLWkWMYvgiYjUFl4,17393
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.9.0.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
24
+ idf_build_apps-2.9.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
25
+ idf_build_apps-2.9.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
26
+ idf_build_apps-2.9.0.dist-info/METADATA,sha256=uO2KdzYJfOdjNQShm3tVrbuWbzQowGaxxIc_de2dduI,4735
27
+ idf_build_apps-2.9.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.11.0
2
+ Generator: flit 3.12.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -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,,