idf-build-apps 2.5.1__tar.gz → 2.5.2__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.
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/test-build-idf-apps.yml +6 -1
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/CHANGELOG.md +7 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/PKG-INFO +1 -1
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/__init__.py +1 -1
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/args.py +12 -5
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/finder.py +1 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/pyproject.toml +1 -1
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/setup.py +1 -1
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/conftest.py +2 -1
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_args.py +104 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.editorconfig +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.git-blame-ignore-revs +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.gitattributes +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/dependabot.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/check-pre-commit.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/issue_comment.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/new_issues.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/new_prs.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/publish-pypi.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.github/workflows/test-build-docs.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.gitignore +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.pre-commit-config.yaml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/.readthedocs.yml +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/CONTRIBUTING.md +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/LICENSE +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/README.md +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/_apidoc_templates/module.rst_t +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/_apidoc_templates/package.rst_t +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/_apidoc_templates/toc.rst_t +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/_static/espressif-logo.svg +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/_static/theme_overrides.css +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/_templates/layout.html +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/conf_common.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/Makefile +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/conf.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/explanations/build.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/explanations/config_rules.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/explanations/dependency_driven_build.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/explanations/find.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/guides/1.x_to_2.x.md +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/index.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/others/CHANGELOG.md +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/others/CONTRIBUTING.md +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/references/cli.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/references/config_file.md +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/references/manifest.rst +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/__main__.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/app.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/autocompletions.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/constants.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/junit/__init__.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/junit/report.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/junit/utils.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/log.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/main.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/manifest/__init__.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/manifest/if_parser.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/manifest/manifest.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/manifest/soc_header.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/session_args.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/utils.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/vendors/__init__.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/vendors/pydantic_sources.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/yaml/__init__.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/idf_build_apps/yaml/parser.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/license_header.txt +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_app.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_build.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_cmd.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_finder.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_manifest.py +0 -0
- {idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/tests/test_utils.py +0 -0
|
@@ -76,7 +76,12 @@ jobs:
|
|
|
76
76
|
python -m idf_build_apps build -vv -t esp32 \
|
|
77
77
|
-p $IDF_PATH/examples/get-started/hello_world \
|
|
78
78
|
--size-file size_info.json
|
|
79
|
-
pytest --cov idf_build_apps --cov-report term-missing --junit-xml
|
|
79
|
+
pytest --cov idf_build_apps --cov-report term-missing:skip-covered --junit-xml pytest.xml | tee pytest-coverage.txt
|
|
80
|
+
- name: Pytest coverage comment
|
|
81
|
+
uses: MishaKav/pytest-coverage-comment@main
|
|
82
|
+
with:
|
|
83
|
+
pytest-coverage-path: pytest-coverage.txt
|
|
84
|
+
junitxml-path: pytest.xml
|
|
80
85
|
|
|
81
86
|
build-apps-on-idf-8266:
|
|
82
87
|
runs-on: ubuntu-latest
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v2.5.2 (2024-09-27)
|
|
6
|
+
|
|
7
|
+
### Fix
|
|
8
|
+
|
|
9
|
+
- unset CLI argument wrongly overwrite config file settings with default value
|
|
10
|
+
- allow unknown fields
|
|
11
|
+
|
|
5
12
|
## v2.5.1 (2024-09-26)
|
|
6
13
|
|
|
7
14
|
### Fix
|
|
@@ -117,6 +117,7 @@ class BaseArguments(BaseSettings):
|
|
|
117
117
|
toml_file='.idf_build_apps.toml',
|
|
118
118
|
pyproject_toml_table_header=('tool', 'idf-build-apps'),
|
|
119
119
|
pyproject_toml_depth=sys.maxsize,
|
|
120
|
+
extra='ignore',
|
|
120
121
|
)
|
|
121
122
|
|
|
122
123
|
@classmethod
|
|
@@ -140,8 +141,9 @@ class BaseArguments(BaseSettings):
|
|
|
140
141
|
if info.field_name and info.field_name in cls.model_fields:
|
|
141
142
|
f = cls.model_fields[info.field_name]
|
|
142
143
|
meta = get_meta(f)
|
|
143
|
-
if meta and meta.validate_method
|
|
144
|
-
|
|
144
|
+
if meta and meta.validate_method:
|
|
145
|
+
if ValidateMethod.TO_LIST in meta.validate_method:
|
|
146
|
+
return to_list(v)
|
|
145
147
|
|
|
146
148
|
return v
|
|
147
149
|
|
|
@@ -268,7 +270,7 @@ class DependencyDrivenBuildArguments(GlobalArguments):
|
|
|
268
270
|
)
|
|
269
271
|
compare_manifest_sha_filepath: t.Optional[str] = field(
|
|
270
272
|
None,
|
|
271
|
-
description='Path to the file containing the
|
|
273
|
+
description='Path to the file containing the hash of the manifest rules. '
|
|
272
274
|
'Compare the hash with the current manifest rules. '
|
|
273
275
|
'All matched apps will be built if the corresponding manifest rule is modified',
|
|
274
276
|
default=None,
|
|
@@ -799,14 +801,19 @@ def add_args_to_parser(argument_cls: t.Type[BaseArguments], parser: argparse.Arg
|
|
|
799
801
|
kwargs['required'] = True
|
|
800
802
|
if f_meta.action:
|
|
801
803
|
kwargs['action'] = f_meta.action
|
|
804
|
+
# to make the CLI override config file work
|
|
805
|
+
if f_meta.action == 'store_true':
|
|
806
|
+
kwargs['default'] = None
|
|
807
|
+
|
|
802
808
|
if f_meta.nargs:
|
|
803
809
|
kwargs['nargs'] = f_meta.nargs
|
|
804
810
|
if f_meta.choices:
|
|
805
811
|
kwargs['choices'] = f_meta.choices
|
|
806
812
|
if f_meta.default:
|
|
807
813
|
kwargs['default'] = f_meta.default
|
|
808
|
-
|
|
809
|
-
|
|
814
|
+
|
|
815
|
+
# here in CLI arguments, don't set the default to field.default
|
|
816
|
+
# otherwise it will override the config file settings
|
|
810
817
|
|
|
811
818
|
parser.add_argument(
|
|
812
819
|
*names,
|
|
@@ -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))
|
|
@@ -35,7 +35,7 @@ entry_points = \
|
|
|
35
35
|
{'console_scripts': ['idf-build-apps = idf_build_apps:main.main']}
|
|
36
36
|
|
|
37
37
|
setup(name='idf-build-apps',
|
|
38
|
-
version='2.5.
|
|
38
|
+
version='2.5.2',
|
|
39
39
|
description='Tools for building ESP-IDF related apps.',
|
|
40
40
|
author=None,
|
|
41
41
|
author_email='Fu Hanxi <fuhanxi@espressif.com>',
|
|
@@ -10,13 +10,14 @@ from idf_build_apps import (
|
|
|
10
10
|
setup_logging,
|
|
11
11
|
)
|
|
12
12
|
from idf_build_apps.args import apply_config_file
|
|
13
|
-
from idf_build_apps.constants import IDF_BUILD_APPS_TOML_FN
|
|
13
|
+
from idf_build_apps.constants import IDF_BUILD_APPS_TOML_FN, SUPPORTED_TARGETS
|
|
14
14
|
from idf_build_apps.manifest.manifest import FolderRule
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
@pytest.fixture(autouse=True)
|
|
18
18
|
def clean_cls_attr(tmp_path):
|
|
19
19
|
App.MANIFEST = None
|
|
20
|
+
FolderRule.DEFAULT_BUILD_TARGETS = SUPPORTED_TARGETS
|
|
20
21
|
idf_build_apps.SESSION_ARGS.clean()
|
|
21
22
|
apply_config_file(IDF_BUILD_APPS_TOML_FN)
|
|
22
23
|
os.chdir(tmp_path)
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
from xml.etree import ElementTree
|
|
3
4
|
|
|
4
5
|
import pytest
|
|
6
|
+
from conftest import (
|
|
7
|
+
create_project,
|
|
8
|
+
)
|
|
5
9
|
|
|
6
10
|
from idf_build_apps import App
|
|
7
11
|
from idf_build_apps.args import (
|
|
@@ -190,3 +194,103 @@ class TestIgnoreWarningFile:
|
|
|
190
194
|
assert len(App.IGNORE_WARNS_REGEXES) == 2
|
|
191
195
|
assert App.IGNORE_WARNS_REGEXES[0].pattern == 'warning:xxx'
|
|
192
196
|
assert App.IGNORE_WARNS_REGEXES[1].pattern == 'warning:yyy'
|
|
197
|
+
|
|
198
|
+
def test_ignore_extra_fields(self):
|
|
199
|
+
with open(IDF_BUILD_APPS_TOML_FN, 'w') as fw:
|
|
200
|
+
fw.write("""dry_run = true""")
|
|
201
|
+
|
|
202
|
+
args = FindArguments()
|
|
203
|
+
assert not hasattr(args, 'dry_run')
|
|
204
|
+
|
|
205
|
+
def test_config_file(self, tmp_path, monkeypatch):
|
|
206
|
+
create_project('foo', tmp_path)
|
|
207
|
+
|
|
208
|
+
with open(IDF_BUILD_APPS_TOML_FN, 'w') as fw:
|
|
209
|
+
fw.write("""paths = ["foo"]
|
|
210
|
+
target = "esp32"
|
|
211
|
+
build_dir = "build_@t"
|
|
212
|
+
junitxml = "test.xml"
|
|
213
|
+
keep_going = true
|
|
214
|
+
""")
|
|
215
|
+
|
|
216
|
+
# test basic config
|
|
217
|
+
with monkeypatch.context() as m:
|
|
218
|
+
m.setenv('PATH', 'foo') # let build fail
|
|
219
|
+
m.setattr('sys.argv', ['idf-build-apps', 'build'])
|
|
220
|
+
with pytest.raises(SystemExit):
|
|
221
|
+
main()
|
|
222
|
+
|
|
223
|
+
with open('test.xml') as f:
|
|
224
|
+
xml = ElementTree.fromstring(f.read())
|
|
225
|
+
test_suite = xml.findall('testsuite')[0]
|
|
226
|
+
assert test_suite.attrib['failures'] == '1'
|
|
227
|
+
assert test_suite.attrib['errors'] == '0'
|
|
228
|
+
assert test_suite.attrib['skipped'] == '0'
|
|
229
|
+
assert test_suite.findall('testcase')[0].attrib['name'] == 'foo/build_esp32'
|
|
230
|
+
|
|
231
|
+
# test cli overrides config
|
|
232
|
+
with monkeypatch.context() as m:
|
|
233
|
+
m.setenv('PATH', 'foo') # let build fail
|
|
234
|
+
m.setattr('sys.argv', ['idf-build-apps', 'build', '--build-dir', 'build_hi_@t'])
|
|
235
|
+
with pytest.raises(SystemExit):
|
|
236
|
+
main()
|
|
237
|
+
|
|
238
|
+
with open('test.xml') as f:
|
|
239
|
+
xml = ElementTree.fromstring(f.read())
|
|
240
|
+
test_suite = xml.findall('testsuite')[0]
|
|
241
|
+
assert test_suite.attrib['failures'] == '1'
|
|
242
|
+
assert test_suite.attrib['errors'] == '0'
|
|
243
|
+
assert test_suite.attrib['skipped'] == '0'
|
|
244
|
+
assert test_suite.findall('testcase')[0].attrib['name'] == 'foo/build_hi_esp32'
|
|
245
|
+
|
|
246
|
+
# test cli action_true
|
|
247
|
+
with monkeypatch.context() as m:
|
|
248
|
+
m.setattr('sys.argv', ['idf-build-apps', 'build', '--dry-run'])
|
|
249
|
+
main()
|
|
250
|
+
|
|
251
|
+
with open('test.xml') as f:
|
|
252
|
+
xml = ElementTree.fromstring(f.read())
|
|
253
|
+
test_suite = xml.findall('testsuite')[0]
|
|
254
|
+
assert test_suite.attrib['failures'] == '0'
|
|
255
|
+
assert test_suite.attrib['errors'] == '0'
|
|
256
|
+
assert test_suite.attrib['skipped'] == '1'
|
|
257
|
+
assert test_suite.findall('testcase')[0].attrib['name'] == 'foo/build_esp32'
|
|
258
|
+
|
|
259
|
+
# test config store_true set to true
|
|
260
|
+
with open(IDF_BUILD_APPS_TOML_FN, 'a') as fw:
|
|
261
|
+
fw.write('\ndry_run = true\n')
|
|
262
|
+
|
|
263
|
+
with monkeypatch.context() as m:
|
|
264
|
+
m.setattr('sys.argv', ['idf-build-apps', 'build'])
|
|
265
|
+
main()
|
|
266
|
+
|
|
267
|
+
with open('test.xml') as f:
|
|
268
|
+
xml = ElementTree.fromstring(f.read())
|
|
269
|
+
test_suite = xml.findall('testsuite')[0]
|
|
270
|
+
assert test_suite.attrib['failures'] == '0'
|
|
271
|
+
assert test_suite.attrib['errors'] == '0'
|
|
272
|
+
assert test_suite.attrib['skipped'] == '1'
|
|
273
|
+
assert test_suite.findall('testcase')[0].attrib['name'] == 'foo/build_esp32'
|
|
274
|
+
|
|
275
|
+
# test config store_true set to false, but CLI set to true
|
|
276
|
+
with open(IDF_BUILD_APPS_TOML_FN, 'w') as fw:
|
|
277
|
+
fw.write("""paths = ["foo"]
|
|
278
|
+
build_dir = "build_@t"
|
|
279
|
+
junitxml = "test.xml"
|
|
280
|
+
dry_run = false
|
|
281
|
+
""")
|
|
282
|
+
|
|
283
|
+
with monkeypatch.context() as m:
|
|
284
|
+
m.setattr(
|
|
285
|
+
'sys.argv', ['idf-build-apps', 'build', '--default-build-targets', 'esp32', 'esp32s2', '--dry-run']
|
|
286
|
+
)
|
|
287
|
+
main()
|
|
288
|
+
|
|
289
|
+
with open('test.xml') as f:
|
|
290
|
+
xml = ElementTree.fromstring(f.read())
|
|
291
|
+
test_suite = xml.findall('testsuite')[0]
|
|
292
|
+
assert test_suite.attrib['failures'] == '0'
|
|
293
|
+
assert test_suite.attrib['errors'] == '0'
|
|
294
|
+
assert test_suite.attrib['skipped'] == '2'
|
|
295
|
+
assert test_suite.findall('testcase')[0].attrib['name'] == 'foo/build_esp32'
|
|
296
|
+
assert test_suite.findall('testcase')[1].attrib['name'] == 'foo/build_esp32s2'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{idf_build_apps-2.5.1 → idf_build_apps-2.5.2}/docs/en/explanations/dependency_driven_build.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|