idf-build-apps 2.4.3__py3-none-any.whl → 2.5.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/config.py DELETED
@@ -1,91 +0,0 @@
1
- # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2
- # SPDX-License-Identifier: Apache-2.0
3
-
4
- import os
5
- import typing as t
6
- from pathlib import (
7
- Path,
8
- )
9
-
10
- from idf_build_apps.utils import (
11
- to_absolute_path,
12
- )
13
-
14
-
15
- class InvalidTomlError(SystemExit):
16
- def __init__(self, filepath: t.Union[str, Path], msg: str) -> None:
17
- super().__init__(f'Failed parsing toml file "{filepath}" with error: {msg}')
18
-
19
-
20
- PYPROJECT_TOML_FN = 'pyproject.toml'
21
- IDF_BUILD_APPS_TOML_FN = '.idf_build_apps.toml'
22
-
23
-
24
- def load_toml(filepath: t.Union[str, Path]) -> dict:
25
- try:
26
- import tomllib # type: ignore # python 3.11
27
-
28
- try:
29
- with open(str(filepath), 'rb') as fr:
30
- return tomllib.load(fr)
31
- except Exception as e:
32
- raise InvalidTomlError(filepath, str(e))
33
- except ImportError:
34
- import toml
35
-
36
- try:
37
- return toml.load(str(filepath))
38
- except Exception as e:
39
- raise InvalidTomlError(filepath, str(e))
40
-
41
-
42
- def _get_config_from_file(filepath: str) -> t.Tuple[t.Optional[dict], str]:
43
- config = None
44
- if os.path.isfile(filepath):
45
- if os.path.basename(filepath) == PYPROJECT_TOML_FN:
46
- tool = load_toml(filepath).get('tool', None)
47
- if tool:
48
- config = tool.get('idf-build-apps', None)
49
- elif config is None:
50
- config = load_toml(filepath)
51
-
52
- return config, filepath
53
-
54
-
55
- def _get_config_from_path(dirpath: str) -> t.Tuple[t.Optional[dict], str]:
56
- config = None
57
- filepath = dirpath
58
- if os.path.isfile(os.path.join(dirpath, PYPROJECT_TOML_FN)):
59
- config, filepath = _get_config_from_file(os.path.join(dirpath, PYPROJECT_TOML_FN))
60
-
61
- if config is None and os.path.isfile(os.path.join(dirpath, IDF_BUILD_APPS_TOML_FN)):
62
- config, filepath = _get_config_from_file(os.path.join(dirpath, IDF_BUILD_APPS_TOML_FN))
63
-
64
- return config, filepath
65
-
66
-
67
- def get_valid_config(starts_from: str = os.getcwd(), custom_path: t.Optional[str] = None) -> t.Optional[dict]:
68
- root_dir = to_absolute_path('/')
69
- cur_dir = to_absolute_path(starts_from)
70
-
71
- config = None
72
- if custom_path and os.path.isfile(custom_path):
73
- config, filepath = _get_config_from_file(to_absolute_path(custom_path))
74
- if config is not None:
75
- # use print here since the verbose settings may be set in the config file
76
- print(f'Using custom config file: {filepath}')
77
- return config
78
-
79
- while cur_dir != root_dir and config is None:
80
- config, filepath = _get_config_from_path(cur_dir)
81
- if config is not None:
82
- # use print here since the verbose settings may be set in the config file
83
- print(f'Using config file: {filepath}')
84
- return config
85
-
86
- if os.path.exists(os.path.join(cur_dir, '.git')):
87
- break
88
-
89
- cur_dir = os.path.abspath(os.path.join(cur_dir, '..'))
90
-
91
- return None
@@ -1,26 +0,0 @@
1
- idf_build_apps/__init__.py,sha256=f_NYZ6u3CevDB7l3_nWGaHJRQ0GfuVDJSl8LcgjCDCw,650
2
- idf_build_apps/__main__.py,sha256=8E-5xHm2MlRun0L88XJleNh5U50dpE0Q1nK5KqomA7I,182
3
- idf_build_apps/app.py,sha256=q9udvZyBG3qWrNxlyuG3iTiLcayOSrSwRuyL2n7QALY,37002
4
- idf_build_apps/autocompletions.py,sha256=g-bx0pzXoFKI0VQqftkHyGVWN6MLjuFOdozeuAf45yo,2138
5
- idf_build_apps/build_apps_args.py,sha256=r6VCJDdCzE873X8OTputYkCBZPgECaKoNlAejfcamJk,1644
6
- idf_build_apps/config.py,sha256=I75uOQGarCWVKGi16ZYpo0qTVU25BUP4eh6-RWCtbvw,2924
7
- idf_build_apps/constants.py,sha256=8Bh99xGFpyLkEovQMglS2KydxoEZesAHQSgdpsUnSTM,4000
8
- idf_build_apps/finder.py,sha256=2TOQ6fq9q3MtsLnG4o0VvA2aMd3Zb6w6CL-U_tQrT3k,6362
9
- idf_build_apps/log.py,sha256=JysogBHoompfW9E9w0U4wZH7tt8dBdfoh-stPXQz1hw,2573
10
- idf_build_apps/main.py,sha256=u2MiVuGFL72-43DdwXs2BgRG90MZuxbjfJRsbxP8BSg,39201
11
- idf_build_apps/session_args.py,sha256=2WDTy40IFAc0KQ57HaeBcYj_k10eUXRKkDOWLrFCaHY,2985
12
- idf_build_apps/utils.py,sha256=dYxNXPe7FRWxzUFlTzOb3G-LpKpRUrNWdQrsO5MXAB8,9702
13
- idf_build_apps/junit/__init__.py,sha256=IxvdaS6eSXp7kZxRuXqyZyGxuA_A1nOW1jF1HMi8Gns,231
14
- idf_build_apps/junit/report.py,sha256=T7dVU3Sz5tqjfbcFW7wjsb65PDH6C2HFf73ePJqBhMs,6555
15
- idf_build_apps/junit/utils.py,sha256=j0PYhFTZjXtTwkENdeL4bFJcX24ktf1CsOOVXz65yNo,1297
16
- idf_build_apps/manifest/__init__.py,sha256=Q2-cb3ngNjnl6_zWhUfzZZB10f_-Rv2JYNck3Lk7UkQ,133
17
- idf_build_apps/manifest/if_parser.py,sha256=r0pivV9gmniPn3Ia6sTMbW5tFAKInhOXk-Lfd6GokqE,6381
18
- idf_build_apps/manifest/manifest.py,sha256=P5ZaUd72A_HOVF6iuwap__Bw-w7WI72ugiTURm9PNNQ,10708
19
- idf_build_apps/manifest/soc_header.py,sha256=PzJ37xFspt5f0AXWvAFNA_avHZA9fMXHBrwDYLi3qEI,4344
20
- idf_build_apps/yaml/__init__.py,sha256=W-3z5no07RQ6eYKGyOAPA8Z2CLiMPob8DD91I4URjrA,162
21
- idf_build_apps/yaml/parser.py,sha256=Y2OyB4g1DCC7C7jrvpIyZV9lgeCB_XvuB75iGmqiTaM,2093
22
- idf_build_apps-2.4.3.dist-info/entry_points.txt,sha256=3pVUirUEsb6jsDRikkQWNUt4hqLK2ci1HvW_Vf8b6uE,59
23
- idf_build_apps-2.4.3.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
24
- idf_build_apps-2.4.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
25
- idf_build_apps-2.4.3.dist-info/METADATA,sha256=tfLthnRioC7cNvQ51g1VjXcI5qZ8DxhR00kDh0hn_0Y,4608
26
- idf_build_apps-2.4.3.dist-info/RECORD,,