idf-build-apps 2.8.0__tar.gz → 2.9.0__tar.gz

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.
Files changed (70) hide show
  1. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.pre-commit-config.yaml +2 -2
  2. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/CHANGELOG.md +13 -0
  3. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/PKG-INFO +1 -1
  4. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/conf_common.py +1 -1
  5. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/conf.py +1 -1
  6. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/explanations/config_rules.rst +6 -0
  7. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/references/config_file.rst +12 -0
  8. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/__init__.py +1 -1
  9. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/__main__.py +1 -1
  10. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/args.py +33 -5
  11. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/autocompletions.py +1 -1
  12. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/finder.py +1 -1
  13. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/junit/__init__.py +1 -1
  14. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/junit/utils.py +1 -1
  15. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/manifest/manifest.py +8 -1
  16. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/session_args.py +1 -1
  17. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/yaml/__init__.py +1 -1
  18. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/yaml/parser.py +1 -1
  19. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/pyproject.toml +1 -1
  20. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/setup.py +1 -1
  21. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_args.py +10 -0
  22. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_cmd.py +1 -1
  23. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_finder.py +0 -3
  24. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_manifest.py +22 -0
  25. idf_build_apps-2.8.0/.github/workflows/check-pre-commit.yml +0 -18
  26. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.editorconfig +0 -0
  27. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.git-blame-ignore-revs +0 -0
  28. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.gitattributes +0 -0
  29. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.github/dependabot.yml +0 -0
  30. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.github/workflows/publish-pypi.yml +0 -0
  31. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.github/workflows/sync-jira.yml +0 -0
  32. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.github/workflows/test-build-docs.yml +0 -0
  33. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.github/workflows/test-build-idf-apps.yml +0 -0
  34. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.gitignore +0 -0
  35. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/.readthedocs.yml +0 -0
  36. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/CONTRIBUTING.md +0 -0
  37. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/LICENSE +0 -0
  38. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/README.md +0 -0
  39. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/_apidoc_templates/module.rst_t +0 -0
  40. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/_apidoc_templates/package.rst_t +0 -0
  41. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/_apidoc_templates/toc.rst_t +0 -0
  42. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/_static/espressif-logo.svg +0 -0
  43. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/_static/theme_overrides.css +0 -0
  44. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/_templates/layout.html +0 -0
  45. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/Makefile +0 -0
  46. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/explanations/build.rst +0 -0
  47. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/explanations/dependency_driven_build.rst +0 -0
  48. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/explanations/find.rst +0 -0
  49. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/guides/1.x_to_2.x.md +0 -0
  50. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/index.rst +0 -0
  51. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/others/CHANGELOG.md +0 -0
  52. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/others/CONTRIBUTING.md +0 -0
  53. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/references/cli.rst +0 -0
  54. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/docs/en/references/manifest.rst +0 -0
  55. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/app.py +0 -0
  56. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/constants.py +0 -0
  57. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/junit/report.py +0 -0
  58. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/log.py +0 -0
  59. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/main.py +0 -0
  60. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/manifest/__init__.py +0 -0
  61. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/manifest/soc_header.py +0 -0
  62. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/py.typed +0 -0
  63. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/utils.py +0 -0
  64. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/vendors/__init__.py +0 -0
  65. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/idf_build_apps/vendors/pydantic_sources.py +0 -0
  66. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/license_header.txt +0 -0
  67. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/conftest.py +0 -0
  68. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_app.py +0 -0
  69. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_build.py +0 -0
  70. {idf_build_apps-2.8.0 → idf_build_apps-2.9.0}/tests/test_utils.py +0 -0
@@ -16,8 +16,8 @@ repos:
16
16
  - license_header.txt # defaults to: LICENSE.txt
17
17
  - --use-current-year
18
18
  exclude: 'idf_build_apps/vendors/'
19
- - repo: https://github.com/charliermarsh/ruff-pre-commit
20
- rev: 'v0.9.5'
19
+ - repo: https://github.com/astral-sh/ruff-pre-commit
20
+ rev: 'v0.11.5'
21
21
  hooks:
22
22
  - id: ruff
23
23
  args: ['--fix']
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## v2.9.0 (2025-04-16)
6
+
7
+ ### Feat
8
+
9
+ - record manifest_path that introduced the folder rule
10
+ - support env var expansion in some fields
11
+
12
+ ## v2.8.1 (2025-03-04)
13
+
14
+ ### Fix
15
+
16
+ - --override-sdkconfig-files not working
17
+
5
18
  ## v2.8.0 (2025-02-20)
6
19
 
7
20
  ### Feat
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: idf-build-apps
3
- Version: 2.8.0
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
@@ -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
@@ -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
@@ -146,6 +146,12 @@ When building the project for the ESP32 target, `sdkconfig files`_ with the ``.e
146
146
  B --> C --> D -- "populates sdkconfig file, then build" --> F
147
147
  B --> E -- "populates sdkconfig file, then build" --> G
148
148
 
149
+ .. warning::
150
+
151
+ Standalone target-specific sdkconfig files are ignored. To make the target-specific sdkconfig files effective, the original sdkconfig file, (without the target name suffix) must be present.
152
+
153
+ For example, ``sdkconfig.ci.foo.esp32`` will only be taken into account while building with target ``esp32`` if ``sdkconfig.ci.foo`` is also present.
154
+
149
155
  Override In CLI
150
156
  ===============
151
157
 
@@ -97,6 +97,18 @@ This indicates that in the configuration file, you should specify it with the na
97
97
  "bar",
98
98
  ]
99
99
 
100
+ ******************************
101
+ Expand Environment Variables
102
+ ******************************
103
+
104
+ Some configuration options support environment variables. You can use environment variables in the configuration file by using the syntax ``${VAR_NAME}`` or ``$VAR_NAME``. Undeclared environment variables will be replaced with an empty string. For exmaple:
105
+
106
+ .. code:: toml
107
+
108
+ collect_app_info_filename = "app_info_${CI_JOB_NAME_SLUG}"
109
+
110
+ when the environment variable ``CI_JOB_NAME_SLUG`` is set to ``my_job``, the ``collect_app_info_filename`` will be expanded to ``app_info_my_job``. When the environment variable is not set, the value will be ``app_info_``.
111
+
100
112
  *************************
101
113
  CLI Argument Precedence
102
114
  *************************
@@ -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.0'
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 (
@@ -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
 
@@ -566,7 +590,7 @@ class FindBuildArguments(DependencyDrivenBuildArguments):
566
590
  self.default_build_targets = [t for t in FolderRule.DEFAULT_BUILD_TARGETS if t not in self.disable_targets]
567
591
  FolderRule.DEFAULT_BUILD_TARGETS = self.default_build_targets
568
592
 
569
- if self.override_sdkconfig_items or self.override_sdkconfig_items:
593
+ if self.override_sdkconfig_files or self.override_sdkconfig_items:
570
594
  SESSION_ARGS.set(self)
571
595
 
572
596
 
@@ -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
@@ -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
@@ -64,7 +64,7 @@ idf-build-apps = "idf_build_apps:main.main"
64
64
 
65
65
  [tool.commitizen]
66
66
  name = "cz_conventional_commits"
67
- version = "2.8.0"
67
+ version = "2.9.0"
68
68
  tag_format = "v$version"
69
69
  version_files = [
70
70
  "idf_build_apps/__init__.py",
@@ -38,7 +38,7 @@ entry_points = \
38
38
  {'console_scripts': ['idf-build-apps = idf_build_apps:main.main']}
39
39
 
40
40
  setup(name='idf-build-apps',
41
- version='2.8.0',
41
+ version='2.9.0',
42
42
  description='Tools for building ESP-IDF related apps.',
43
43
  author=None,
44
44
  author_email='Fu Hanxi <fuhanxi@espressif.com>',
@@ -15,6 +15,7 @@ from idf_build_apps.args import (
15
15
  DependencyDrivenBuildArguments,
16
16
  FindArguments,
17
17
  FindBuildArguments,
18
+ expand_vars,
18
19
  )
19
20
  from idf_build_apps.constants import IDF_BUILD_APPS_TOML_FN, PREVIEW_TARGETS, SUPPORTED_TARGETS
20
21
  from idf_build_apps.main import main
@@ -408,3 +409,12 @@ dry_run = false
408
409
  assert test_suite.attrib['errors'] == '0'
409
410
  assert test_suite.attrib['skipped'] == '1'
410
411
  assert test_suite.findall('testcase')[0].attrib['name'] == 'bar/build'
412
+
413
+
414
+ def test_expand_vars(monkeypatch):
415
+ assert expand_vars('Value is $TEST_VAR') == 'Value is '
416
+ monkeypatch.setenv('TEST_VAR', 'test_value')
417
+ assert expand_vars('Value is $TEST_VAR') == 'Value is test_value'
418
+ assert expand_vars('Value is $TEST_VAR and $NON_EXISTING_VAR') == 'Value is test_value and '
419
+ assert expand_vars('No variables here') == 'No variables here'
420
+ assert expand_vars('') == ''
@@ -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
  import os
4
4
  import sys
@@ -1,7 +1,6 @@
1
1
  # SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import logging
5
4
  import os
6
5
  import tempfile
7
6
  from pathlib import (
@@ -443,7 +442,6 @@ class TestFindWithSdkconfigFiles:
443
442
  if not os.path.isfile(default_sdkconfig_path):
444
443
  with open(default_sdkconfig_path, 'w') as fw:
445
444
  fw.write('CONFIG_IDF_TARGET="linux"')
446
- logging.info('Created temp %s %s', DEFAULT_SDKCONFIG, default_sdkconfig_path)
447
445
  _app = app
448
446
  _default_sdkconfig_path = default_sdkconfig_path
449
447
  break
@@ -456,7 +454,6 @@ class TestFindWithSdkconfigFiles:
456
454
  finally:
457
455
  try:
458
456
  os.remove(_default_sdkconfig_path)
459
- logging.info('Removed temp %s %s', DEFAULT_SDKCONFIG, _default_sdkconfig_path)
460
457
  except: # noqa
461
458
  pass
462
459
 
@@ -535,6 +535,28 @@ baz:
535
535
  }
536
536
 
537
537
 
538
+ def test_folder_rule_introduced_by(tmp_path):
539
+ yaml_file = tmp_path / 'test.yml'
540
+ yaml_file.write_text(
541
+ """
542
+ foo:
543
+ enable:
544
+ - if: IDF_TARGET == "esp32"
545
+ - if: IDF_TARGET == "esp32c3"
546
+ bar:
547
+ enable:
548
+ - if: IDF_TARGET == "esp32"
549
+ baz:
550
+ enable:
551
+ - if: IDF_TARGET == "esp32"
552
+ """,
553
+ encoding='utf8',
554
+ )
555
+
556
+ manifest = Manifest.from_file(yaml_file)
557
+ assert manifest.most_suitable_rule('baz').by_manifest_file == str(yaml_file)
558
+
559
+
538
560
  class TestIfParser:
539
561
  def test_invalid_if_statement(self):
540
562
  statement = '1'
@@ -1,18 +0,0 @@
1
- name: pre-commit check
2
-
3
- on:
4
- pull_request:
5
-
6
- jobs:
7
- pre-commit:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/checkout@v4
11
- with:
12
- fetch-depth: 0
13
- - uses: actions/setup-python@v5
14
- - id: changed-files
15
- uses: tj-actions/changed-files@v45
16
- - uses: pre-commit/action@v3.0.1
17
- with:
18
- extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
File without changes
File without changes