idf-build-apps 2.7.0__tar.gz → 2.8.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.7.0 → idf_build_apps-2.8.0}/CHANGELOG.md +6 -0
  2. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/PKG-INFO +3 -2
  3. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/__init__.py +1 -1
  4. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/args.py +17 -1
  5. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/pyproject.toml +1 -1
  6. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/setup.py +1 -1
  7. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_args.py +49 -1
  8. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.editorconfig +0 -0
  9. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.git-blame-ignore-revs +0 -0
  10. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.gitattributes +0 -0
  11. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.github/dependabot.yml +0 -0
  12. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.github/workflows/check-pre-commit.yml +0 -0
  13. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.github/workflows/publish-pypi.yml +0 -0
  14. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.github/workflows/sync-jira.yml +0 -0
  15. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.github/workflows/test-build-docs.yml +0 -0
  16. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.github/workflows/test-build-idf-apps.yml +0 -0
  17. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.gitignore +0 -0
  18. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.pre-commit-config.yaml +0 -0
  19. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/.readthedocs.yml +0 -0
  20. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/CONTRIBUTING.md +0 -0
  21. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/LICENSE +0 -0
  22. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/README.md +0 -0
  23. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/_apidoc_templates/module.rst_t +0 -0
  24. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/_apidoc_templates/package.rst_t +0 -0
  25. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/_apidoc_templates/toc.rst_t +0 -0
  26. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/_static/espressif-logo.svg +0 -0
  27. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/_static/theme_overrides.css +0 -0
  28. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/_templates/layout.html +0 -0
  29. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/conf_common.py +0 -0
  30. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/Makefile +0 -0
  31. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/conf.py +0 -0
  32. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/explanations/build.rst +0 -0
  33. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/explanations/config_rules.rst +0 -0
  34. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/explanations/dependency_driven_build.rst +0 -0
  35. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/explanations/find.rst +0 -0
  36. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/guides/1.x_to_2.x.md +0 -0
  37. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/index.rst +0 -0
  38. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/others/CHANGELOG.md +0 -0
  39. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/others/CONTRIBUTING.md +0 -0
  40. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/references/cli.rst +0 -0
  41. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/references/config_file.rst +0 -0
  42. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/docs/en/references/manifest.rst +0 -0
  43. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/__main__.py +0 -0
  44. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/app.py +0 -0
  45. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/autocompletions.py +0 -0
  46. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/constants.py +0 -0
  47. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/finder.py +0 -0
  48. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/junit/__init__.py +0 -0
  49. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/junit/report.py +0 -0
  50. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/junit/utils.py +0 -0
  51. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/log.py +0 -0
  52. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/main.py +0 -0
  53. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/manifest/__init__.py +0 -0
  54. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/manifest/manifest.py +0 -0
  55. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/manifest/soc_header.py +0 -0
  56. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/py.typed +0 -0
  57. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/session_args.py +0 -0
  58. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/utils.py +0 -0
  59. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/vendors/__init__.py +0 -0
  60. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/vendors/pydantic_sources.py +0 -0
  61. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/yaml/__init__.py +0 -0
  62. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/idf_build_apps/yaml/parser.py +0 -0
  63. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/license_header.txt +0 -0
  64. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/conftest.py +0 -0
  65. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_app.py +0 -0
  66. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_build.py +0 -0
  67. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_cmd.py +0 -0
  68. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_finder.py +0 -0
  69. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_manifest.py +0 -0
  70. {idf_build_apps-2.7.0 → idf_build_apps-2.8.0}/tests/test_utils.py +0 -0
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## v2.8.0 (2025-02-20)
6
+
7
+ ### Feat
8
+
9
+ - support '--disable-targets'
10
+
5
11
  ## v2.7.0 (2025-02-18)
6
12
 
7
13
  ### Feat
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: idf-build-apps
3
- Version: 2.7.0
3
+ Version: 2.8.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
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
+ License-File: LICENSE
16
17
  Requires-Dist: pyparsing
17
18
  Requires-Dist: pyyaml
18
19
  Requires-Dist: packaging
@@ -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.7.0'
11
+ __version__ = '2.8.0'
12
12
 
13
13
  from .session_args import (
14
14
  SessionArgs,
@@ -27,7 +27,7 @@ from pydantic_settings import (
27
27
  from typing_extensions import Concatenate, ParamSpec
28
28
 
29
29
  from . import SESSION_ARGS, App, setup_logging
30
- from .constants import ALL_TARGETS, IDF_BUILD_APPS_TOML_FN
30
+ from .constants import ALL_TARGETS, IDF_BUILD_APPS_TOML_FN, SUPPORTED_TARGETS
31
31
  from .manifest.manifest import FolderRule, Manifest
32
32
  from .utils import InvalidCommand, files_matches_patterns, semicolon_separated_str_to_list, to_absolute_path, to_list
33
33
  from .vendors.pydantic_sources import PyprojectTomlConfigSettingsSource, TomlConfigSettingsSource
@@ -500,6 +500,14 @@ class FindBuildArguments(DependencyDrivenBuildArguments):
500
500
  'including the preview targets. As the targets defined in `idf.py --list-targets --preview`',
501
501
  default=False, # type: ignore
502
502
  )
503
+ disable_targets: t.Optional[t.List[str]] = field(
504
+ FieldMetadata(
505
+ validate_method=[ValidateMethod.TO_LIST],
506
+ nargs='+',
507
+ ),
508
+ description='space-separated list of targets that should be disabled to all apps.',
509
+ default=None, # type: ignore
510
+ )
503
511
  include_skipped_apps: bool = field(
504
512
  FieldMetadata(
505
513
  action='store_true',
@@ -549,6 +557,14 @@ class FindBuildArguments(DependencyDrivenBuildArguments):
549
557
  self.default_build_targets = deepcopy(ALL_TARGETS)
550
558
  LOGGER.info('Overriding default build targets to %s', self.default_build_targets)
551
559
  FolderRule.DEFAULT_BUILD_TARGETS = self.default_build_targets
560
+ else:
561
+ # restore default build targets
562
+ FolderRule.DEFAULT_BUILD_TARGETS = SUPPORTED_TARGETS
563
+
564
+ if self.disable_targets and FolderRule.DEFAULT_BUILD_TARGETS:
565
+ LOGGER.info('Disable targets: %s', self.disable_targets)
566
+ self.default_build_targets = [t for t in FolderRule.DEFAULT_BUILD_TARGETS if t not in self.disable_targets]
567
+ FolderRule.DEFAULT_BUILD_TARGETS = self.default_build_targets
552
568
 
553
569
  if self.override_sdkconfig_items or self.override_sdkconfig_items:
554
570
  SESSION_ARGS.set(self)
@@ -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.7.0"
67
+ version = "2.8.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.7.0',
41
+ version='2.8.0',
42
42
  description='Tools for building ESP-IDF related apps.',
43
43
  author=None,
44
44
  author_email='Fu Hanxi <fuhanxi@espressif.com>',
@@ -16,7 +16,7 @@ from idf_build_apps.args import (
16
16
  FindArguments,
17
17
  FindBuildArguments,
18
18
  )
19
- from idf_build_apps.constants import IDF_BUILD_APPS_TOML_FN
19
+ from idf_build_apps.constants import IDF_BUILD_APPS_TOML_FN, PREVIEW_TARGETS, SUPPORTED_TARGETS
20
20
  from idf_build_apps.main import main
21
21
 
22
22
 
@@ -161,6 +161,54 @@ modified_files = [
161
161
  assert args.deactivate_dependency_driven_build_by_components == ['baz']
162
162
 
163
163
 
164
+ def test_build_targets_cli(tmp_path, monkeypatch):
165
+ create_project('foo', tmp_path)
166
+ with open(IDF_BUILD_APPS_TOML_FN, 'w') as fw:
167
+ fw.write("""paths = ["foo"]
168
+ build_dir = "build_@t"
169
+ junitxml = "test.xml"
170
+ dry_run = true
171
+ """)
172
+
173
+ def get_enabled_targets(args):
174
+ with monkeypatch.context() as m:
175
+ m.setattr('sys.argv', args)
176
+ main()
177
+ with open('test.xml') as f:
178
+ xml = ElementTree.fromstring(f.read())
179
+ test_suite = xml.findall('testsuite')[0]
180
+ testcases = test_suite.findall('testcase')
181
+ # get targets
182
+ return [c.attrib['name'].replace('foo/build_', '') for c in testcases]
183
+
184
+ # default build SUPPORTED_TARGETS
185
+ targets = get_enabled_targets(['idf-build-apps', 'build'])
186
+ assert len(targets) == len(SUPPORTED_TARGETS)
187
+ assert set(targets) == set(SUPPORTED_TARGETS)
188
+ # build with --target
189
+ targets = get_enabled_targets(['idf-build-apps', 'build', '--target', 'esp32'])
190
+ assert len(targets) == 1
191
+ assert targets[0] == 'esp32'
192
+ # build with --default-build-targets
193
+ targets = get_enabled_targets(['idf-build-apps', 'build', '--default-build-targets', 'esp32', 'esp32s2'])
194
+ assert len(targets) == 2
195
+ assert set(targets) == {'esp32', 'esp32s2'}
196
+ # build with --enable-preview-targets
197
+ targets = get_enabled_targets(['idf-build-apps', 'build', '--enable-preview-targets'])
198
+ assert len(targets) == len(SUPPORTED_TARGETS) + len(PREVIEW_TARGETS)
199
+ assert set(targets) == set(SUPPORTED_TARGETS) | set(PREVIEW_TARGETS)
200
+ # build with --disable-targets
201
+ assert 'esp32' in SUPPORTED_TARGETS and 'esp32s2' in SUPPORTED_TARGETS
202
+ targets = get_enabled_targets(['idf-build-apps', 'build', '--disable-targets', 'esp32', 'esp32s2'])
203
+ assert set(targets) == set(SUPPORTED_TARGETS) - {'esp32', 'esp32s2'}
204
+ # build with --enable-preview-targets and --disable-targets
205
+ targets = get_enabled_targets(
206
+ ['idf-build-apps', 'build', '--enable-preview-targets', '--disable-targets', PREVIEW_TARGETS[0]]
207
+ )
208
+ assert len(targets) == len(SUPPORTED_TARGETS) + len(PREVIEW_TARGETS) - 1
209
+ assert set(targets) == set(SUPPORTED_TARGETS) | set(PREVIEW_TARGETS) - {PREVIEW_TARGETS[0]}
210
+
211
+
164
212
  class TestIgnoreWarningFile:
165
213
  def test_deprecated_cli(self, monkeypatch, capsys):
166
214
  with open('foo.txt', 'w') as fw:
File without changes
File without changes