idf-build-apps 1.1.2__tar.gz → 1.1.4__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-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/test-build-idf-apps.yml +2 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/CHANGELOG.md +13 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/PKG-INFO +3 -2
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/__init__.py +1 -1
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/app.py +10 -1
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/manifest/manifest.py +11 -9
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/pyproject.toml +3 -2
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/setup.py +4 -3
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/tests/conftest.py +18 -17
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/tests/test_build.py +22 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/tests/test_manifest.py +24 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.editorconfig +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.git-blame-ignore-revs +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.gitattributes +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/dependabot.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/check-pre-commit.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/issue_comment.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/new_issues.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/new_prs.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/publish-pypi.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.github/workflows/test-build-docs.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.gitignore +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.pre-commit-config.yaml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/.readthedocs.yml +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/CONTRIBUTING.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/LICENSE +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/README.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/CHANGELOG.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/CONTRIBUTING.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/Makefile +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/_static/espressif-logo.svg +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/_static/theme_overrides.css +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/_templates/layout.html +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/api.rst +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/conf.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/config_file.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/find_build.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/index.rst +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/docs/manifest.md +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/__main__.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/config.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/constants.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/finder.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/log.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/main.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/manifest/__init__.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/manifest/if_parser.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/manifest/soc_header.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/idf_build_apps/utils.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/license_header.txt +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/tests/test_finder.py +0 -0
- {idf_build_apps-1.1.2 → idf_build_apps-1.1.4}/tests/test_utils.py +0 -0
|
@@ -61,7 +61,9 @@ jobs:
|
|
|
61
61
|
pyenv global ${{ matrix.python-version }}
|
|
62
62
|
rm $(which python3)
|
|
63
63
|
echo "urllib3<1.25,>=1.21.1" >> $IDF_PATH/requirements.txt
|
|
64
|
+
echo "brotli<1.1" >> $IDF_PATH/requirements.txt
|
|
64
65
|
sed -i 's/idf-component-manager~=1.0/idf-component-manager<1.3/g' $IDF_PATH/requirements.txt
|
|
66
|
+
pip install -U pip
|
|
65
67
|
bash $IDF_PATH/install.sh
|
|
66
68
|
. $IDF_PATH/export.sh
|
|
67
69
|
pip install idf_build_apps-*-py2.py3-none-any.whl
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v1.1.4 (2023-12-29)
|
|
6
|
+
|
|
7
|
+
### Fix
|
|
8
|
+
|
|
9
|
+
- stop modifying yaml dict shared by yaml anchors
|
|
10
|
+
|
|
11
|
+
## v1.1.3 (2023-11-13)
|
|
12
|
+
|
|
13
|
+
### Fix
|
|
14
|
+
|
|
15
|
+
- pyyaml dependency for python version older than 3.5
|
|
16
|
+
- stop recursively copy when work dir in app dir
|
|
17
|
+
|
|
5
18
|
## v1.1.2 (2023-08-16)
|
|
6
19
|
|
|
7
20
|
### Feat
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: idf-build-apps
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.4
|
|
4
4
|
Summary: Tools for building ESP-IDF related apps.
|
|
5
5
|
Author-email: Fu Hanxi <fuhanxi@espressif.com>
|
|
6
6
|
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
|
|
@@ -19,7 +19,8 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
19
19
|
Requires-Dist: pathlib; python_version < '3.4'
|
|
20
20
|
Requires-Dist: glob2; python_version < '3.5'
|
|
21
21
|
Requires-Dist: pyparsing
|
|
22
|
-
Requires-Dist: pyyaml
|
|
22
|
+
Requires-Dist: pyyaml>=5.3; python_version >= '3.5'
|
|
23
|
+
Requires-Dist: pyyaml<5.3; python_version < '3.5'
|
|
23
24
|
Requires-Dist: packaging
|
|
24
25
|
Requires-Dist: toml; python_version < '3.11'
|
|
25
26
|
Requires-Dist: sphinx ; extra == "doc"
|
|
@@ -598,7 +598,16 @@ class CMakeApp(App):
|
|
|
598
598
|
shutil.rmtree(self.work_dir)
|
|
599
599
|
LOGGER.debug('==> Copying app from %s to %s', self.app_dir, self.work_dir)
|
|
600
600
|
if not self.dry_run:
|
|
601
|
-
|
|
601
|
+
# if the new directory inside the original directory,
|
|
602
|
+
# make sure not to go into recursion.
|
|
603
|
+
ignore = shutil.ignore_patterns(
|
|
604
|
+
os.path.basename(self.work_dir),
|
|
605
|
+
# also ignore files which may be present in the work directory
|
|
606
|
+
'build',
|
|
607
|
+
'sdkconfig',
|
|
608
|
+
)
|
|
609
|
+
|
|
610
|
+
shutil.copytree(self.app_dir, self.work_dir, ignore=ignore, symlinks=True)
|
|
602
611
|
|
|
603
612
|
if os.path.exists(self.build_path):
|
|
604
613
|
LOGGER.debug('==> Build directory %s exists, removing', self.build_path)
|
|
@@ -59,15 +59,17 @@ class FolderRule:
|
|
|
59
59
|
): # type: (...) -> None
|
|
60
60
|
self.folder = folder.resolve()
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
self.
|
|
62
|
+
def _clause_to_if_clause(clause): # type: (dict[str, str]) -> IfClause
|
|
63
|
+
_kwargs = {'stmt': clause['if']}
|
|
64
|
+
if 'temporary' in clause:
|
|
65
|
+
_kwargs['temporary'] = clause['temporary']
|
|
66
|
+
if 'reason' in clause:
|
|
67
|
+
_kwargs['reason'] = clause['reason']
|
|
68
|
+
return IfClause(**_kwargs)
|
|
69
|
+
|
|
70
|
+
self.enable = [_clause_to_if_clause(clause) for clause in enable] if enable else []
|
|
71
|
+
self.disable = [_clause_to_if_clause(clause) for clause in disable] if disable else []
|
|
72
|
+
self.disable_test = [_clause_to_if_clause(clause) for clause in disable_test] if disable_test else []
|
|
71
73
|
self.depends_components = depends_components or []
|
|
72
74
|
self.depends_filepatterns = depends_filepatterns or []
|
|
73
75
|
|
|
@@ -29,7 +29,8 @@ dependencies = [
|
|
|
29
29
|
"pathlib; python_version < '3.4'",
|
|
30
30
|
"glob2; python_version < '3.5'",
|
|
31
31
|
"pyparsing",
|
|
32
|
-
"pyyaml",
|
|
32
|
+
"pyyaml>=5.3; python_version >= '3.5'",
|
|
33
|
+
"pyyaml<5.3; python_version < '3.5'",
|
|
33
34
|
"packaging",
|
|
34
35
|
"toml; python_version < '3.11'",
|
|
35
36
|
]
|
|
@@ -60,7 +61,7 @@ idf-build-apps = "idf_build_apps:main.main"
|
|
|
60
61
|
|
|
61
62
|
[tool.commitizen]
|
|
62
63
|
name = "cz_conventional_commits"
|
|
63
|
-
version = "1.1.
|
|
64
|
+
version = "1.1.4"
|
|
64
65
|
tag_format = "v$version"
|
|
65
66
|
version_files = [
|
|
66
67
|
"idf_build_apps/__init__.py",
|
|
@@ -10,12 +10,13 @@ package_data = \
|
|
|
10
10
|
{'': ['*']}
|
|
11
11
|
|
|
12
12
|
install_requires = \
|
|
13
|
-
['pyparsing', '
|
|
13
|
+
['pyparsing', 'packaging']
|
|
14
14
|
|
|
15
15
|
extras_require = \
|
|
16
16
|
{":python_version < '3.11'": ['toml'],
|
|
17
17
|
":python_version < '3.4'": ['pathlib'],
|
|
18
|
-
":python_version < '3.5'": ['glob2'],
|
|
18
|
+
":python_version < '3.5'": ['glob2', 'pyyaml<5.3'],
|
|
19
|
+
":python_version >= '3.5'": ['pyyaml>=5.3'],
|
|
19
20
|
'doc': ['sphinx',
|
|
20
21
|
'sphinx-rtd-theme',
|
|
21
22
|
'sphinx_copybutton',
|
|
@@ -27,7 +28,7 @@ entry_points = \
|
|
|
27
28
|
{'console_scripts': ['idf-build-apps = idf_build_apps:main.main']}
|
|
28
29
|
|
|
29
30
|
setup(name='idf-build-apps',
|
|
30
|
-
version='1.1.
|
|
31
|
+
version='1.1.4',
|
|
31
32
|
description='Tools for building ESP-IDF related apps.',
|
|
32
33
|
author=None,
|
|
33
34
|
author_email='Fu Hanxi <fuhanxi@espressif.com>',
|
|
@@ -26,26 +26,27 @@ def create_project(name, folder):
|
|
|
26
26
|
os.makedirs(os.path.join(p, 'main'))
|
|
27
27
|
|
|
28
28
|
with open(os.path.join(p, 'CMakeLists.txt'), 'w') as fw:
|
|
29
|
-
fw.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
fw.write(
|
|
30
|
+
"""cmake_minimum_required(VERSION 3.16)
|
|
31
|
+
include($ENV{{IDF_PATH}}/tools/cmake/project.cmake)
|
|
32
|
+
project({})
|
|
33
|
+
""".format(
|
|
34
|
+
name
|
|
35
|
+
)
|
|
35
36
|
)
|
|
36
37
|
|
|
37
38
|
with open(os.path.join(p, 'main', 'CMakeLists.txt'), 'w') as fw:
|
|
38
|
-
fw.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
fw.write(
|
|
40
|
+
"""idf_component_register(SRCS "{}.c"
|
|
41
|
+
INCLUDE_DIRS ".")
|
|
42
|
+
""".format(
|
|
43
|
+
name
|
|
44
|
+
)
|
|
43
45
|
)
|
|
44
46
|
|
|
45
|
-
with open(os.path.join(p, 'main', '{}.c'
|
|
46
|
-
fw.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]
|
|
47
|
+
with open(os.path.join(p, 'main', f'{name}.c'), 'w') as fw:
|
|
48
|
+
fw.write(
|
|
49
|
+
"""#include <stdio.h>
|
|
50
|
+
void app_main(void) {}
|
|
51
|
+
"""
|
|
51
52
|
)
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import os
|
|
3
5
|
import shutil
|
|
4
6
|
|
|
5
7
|
import pytest
|
|
8
|
+
from conftest import (
|
|
9
|
+
create_project,
|
|
10
|
+
)
|
|
6
11
|
|
|
7
12
|
from idf_build_apps import (
|
|
13
|
+
build_apps,
|
|
8
14
|
find_apps,
|
|
9
15
|
)
|
|
10
16
|
from idf_build_apps.app import (
|
|
@@ -103,3 +109,19 @@ def test_idf_version_keywords_type():
|
|
|
103
109
|
assert isinstance(IDF_VERSION_MAJOR, int)
|
|
104
110
|
assert isinstance(IDF_VERSION_MINOR, int)
|
|
105
111
|
assert isinstance(IDF_VERSION_PATCH, int)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@pytest.mark.skipif(not shutil.which('idf.py'), reason='idf.py not found')
|
|
115
|
+
def test_work_dir_inside_relative_app_dir(tmp_path):
|
|
116
|
+
create_project('foo', tmp_path)
|
|
117
|
+
|
|
118
|
+
os.chdir(tmp_path / 'foo')
|
|
119
|
+
apps = find_apps(
|
|
120
|
+
'.',
|
|
121
|
+
'esp32',
|
|
122
|
+
work_dir=os.path.join('foo', 'bar'),
|
|
123
|
+
)
|
|
124
|
+
res = build_apps(apps)
|
|
125
|
+
|
|
126
|
+
assert len(apps) == 1
|
|
127
|
+
assert res == 0
|
|
@@ -44,6 +44,30 @@ test2:
|
|
|
44
44
|
assert manifest.enable_test_targets('test2') == ['linux']
|
|
45
45
|
|
|
46
46
|
|
|
47
|
+
def test_manifest_with_anchor(tmpdir, monkeypatch):
|
|
48
|
+
yaml_file = tmpdir / 'test.yml'
|
|
49
|
+
yaml_file.write_text(
|
|
50
|
+
"""
|
|
51
|
+
.base: &base
|
|
52
|
+
depends_components:
|
|
53
|
+
- a
|
|
54
|
+
|
|
55
|
+
foo: &foo
|
|
56
|
+
<<: *base
|
|
57
|
+
disable:
|
|
58
|
+
- if: IDF_TARGET == "esp32"
|
|
59
|
+
|
|
60
|
+
bar:
|
|
61
|
+
<<: *foo
|
|
62
|
+
""",
|
|
63
|
+
encoding='utf8',
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
monkeypatch.setattr(idf_build_apps.manifest.manifest.FolderRule, 'DEFAULT_BUILD_TARGETS', ['esp32'])
|
|
67
|
+
manifest = Manifest.from_file(yaml_file)
|
|
68
|
+
assert manifest.enable_build_targets('bar') == []
|
|
69
|
+
|
|
70
|
+
|
|
47
71
|
class TestIfParser:
|
|
48
72
|
def test_idf_version(self, monkeypatch):
|
|
49
73
|
monkeypatch.setattr(idf_build_apps.manifest.if_parser, 'IDF_VERSION', Version('5.9.0'))
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|