idf-build-apps 2.10.1__py3-none-any.whl → 2.10.2__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.10.1'
11
+ __version__ = '2.10.2'
12
12
 
13
13
  from .session_args import (
14
14
  SessionArgs,
@@ -254,9 +254,11 @@ class Manifest:
254
254
 
255
255
  def __init__(self, rules: t.Iterable[FolderRule], *, root_path: str = os.curdir) -> None:
256
256
  self.rules = sorted(rules, key=lambda x: x.folder)
257
-
258
257
  self._root_path = to_absolute_path(root_path)
259
258
 
259
+ # Pre-compute rule paths
260
+ self._rule_paths = {rule.folder: rule for rule in self.rules}
261
+
260
262
  @classmethod
261
263
  def from_files(cls, paths: t.Iterable[PathLike], *, root_path: str = os.curdir) -> 'Manifest':
262
264
  """
@@ -383,9 +385,17 @@ class Manifest:
383
385
 
384
386
  def most_suitable_rule(self, _folder: str) -> FolderRule:
385
387
  folder = to_absolute_path(_folder)
386
- for rule in self.rules[::-1]:
387
- if os.path.commonpath([folder, rule.folder]) == rule.folder:
388
- return rule
388
+
389
+ while True:
390
+ if folder in self._rule_paths:
391
+ return self._rule_paths[folder]
392
+ folder = os.path.dirname(folder)
393
+
394
+ # reached the root path, stop searching
395
+ if folder == self._root_path:
396
+ if folder in self._rule_paths:
397
+ return self._rule_paths[folder]
398
+ break
389
399
 
390
400
  return DefaultRule(folder)
391
401
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: idf-build-apps
3
- Version: 2.10.1
3
+ Version: 2.10.2
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
- idf_build_apps/__init__.py,sha256=20NqJN4TGWNWQmCELK2yHFpTJtstbRhr5rMUOr6TkzQ,711
1
+ idf_build_apps/__init__.py,sha256=zkzOAoCvbSslS9KdGqm47Zsd9VZD_XBc_R7g7ODZBTI,711
2
2
  idf_build_apps/__main__.py,sha256=pT6OsFQRjCw39Jg43HAeGKzq8h5E_0m7kHDE2QMqDe0,182
3
3
  idf_build_apps/app.py,sha256=wwwpEciOFwjTmkb-IoucM1CeIqAYVSPxNAEsxti-Frg,36914
4
4
  idf_build_apps/args.py,sha256=BBTDk87nBaHodn_VLp65jvhtwjLsskX7qZLTDLRH6kY,37968
@@ -14,14 +14,14 @@ idf_build_apps/junit/__init__.py,sha256=ljILW1rfeBAIlwZIw8jstYrVbugErlmCYzSzJwNF
14
14
  idf_build_apps/junit/report.py,sha256=yzt5SiJEA_AUlw2Ld23J7enYlfDluvmKAcCnAM8ccqE,6565
15
15
  idf_build_apps/junit/utils.py,sha256=idBrLgsz6Co2QUQqq1AiyzRHnqbJf_EoykEAxCkjHZw,1303
16
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
17
+ idf_build_apps/manifest/manifest.py,sha256=k33elhIdlYj7sEwLzlxA499_l_Ah6zBolMMk-nioVsg,15368
18
18
  idf_build_apps/manifest/soc_header.py,sha256=_F6H5-HP6ateAqKUGlRGH-SUtQ8NJ1RI0hBeCFvsDYA,172
19
19
  idf_build_apps/vendors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  idf_build_apps/vendors/pydantic_sources.py,sha256=cxSIPRc3eI5peVMhDxwf58YaGhuG4SCwPRVX2znFEek,4553
21
21
  idf_build_apps/yaml/__init__.py,sha256=R6pYasVsD31maeZ4dWRZnS10hwzM7gXdnfzDsOIRJ-4,167
22
22
  idf_build_apps/yaml/parser.py,sha256=IhY7rCWXOxrzzgEiKipTdPs_8yXDf8JZr-sMewV1pk8,2133
23
- idf_build_apps-2.10.1.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
24
- idf_build_apps-2.10.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
25
- idf_build_apps-2.10.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
26
- idf_build_apps-2.10.1.dist-info/METADATA,sha256=-lAyB6KVFTYVMK9NwDAcyl-sc_oYKxYNBfY79HFto3Y,4795
27
- idf_build_apps-2.10.1.dist-info/RECORD,,
23
+ idf_build_apps-2.10.2.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
24
+ idf_build_apps-2.10.2.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
25
+ idf_build_apps-2.10.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
26
+ idf_build_apps-2.10.2.dist-info/METADATA,sha256=jaqohtgOUpOEjjxZX4MAOyuIRA-t8QEbxH0yR__bW_k,4795
27
+ idf_build_apps-2.10.2.dist-info/RECORD,,