spl-core 4.0.0__tar.gz → 4.1.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 (69) hide show
  1. {spl_core-4.0.0 → spl_core-4.1.0}/PKG-INFO +1 -1
  2. {spl_core-4.0.0 → spl_core-4.1.0}/pyproject.toml +2 -1
  3. spl_core-4.1.0/src/spl_core/__init__.py +1 -0
  4. spl_core-4.1.0/src/spl_core/common/command_line_executor.py +52 -0
  5. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/Pipfile +1 -4
  6. spl_core-4.1.0/src/spl_core/test_utils/base_variant_test_runner.py +61 -0
  7. spl_core-4.1.0/src/spl_core/test_utils/spl_build.py +77 -0
  8. spl_core-4.0.0/src/spl_core/__init__.py +0 -1
  9. {spl_core-4.0.0 → spl_core-4.1.0}/LICENSE +0 -0
  10. {spl_core-4.0.0 → spl_core-4.1.0}/README.md +0 -0
  11. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/common/__init__.py +0 -0
  12. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/common/cmake.py +0 -0
  13. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/common/path.py +0 -0
  14. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/gcov_maid/__init__.py +0 -0
  15. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/gcov_maid/gcov_maid.py +0 -0
  16. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/kconfig/__init__.py +0 -0
  17. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/kconfig/kconfig.py +0 -0
  18. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/__init__.py +0 -0
  19. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/creator.py +0 -0
  20. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/cookiecutter.json +0 -0
  21. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.flake8 +0 -0
  22. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.gitignore +0 -0
  23. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-kits.json +0 -0
  24. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-variants.json +0 -0
  25. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/extensions.json +0 -0
  26. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/launch.json +0 -0
  27. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/settings.json +0 -0
  28. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/tasks.json +0 -0
  29. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/CMakeLists.txt +0 -0
  30. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/KConfig +0 -0
  31. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/LICENSE +0 -0
  32. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/README.md +0 -0
  33. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/build.bat +0 -0
  34. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/build.ps1 +0 -0
  35. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/conf.py +0 -0
  36. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/Doxyfile.in +0 -0
  37. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/common/index.rst +0 -0
  38. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/components/index.rst +0 -0
  39. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/doxygen-awesome/LICENSE +0 -0
  40. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/doxygen-awesome/doxygen-awesome.css +0 -0
  41. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/software_architecture/index.rst +0 -0
  42. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/software_requirements/index.rst +0 -0
  43. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/test_report_template.txt +0 -0
  44. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/index.rst +0 -0
  45. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/install-mandatory.bat +0 -0
  46. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/pytest.ini +0 -0
  47. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/scoopfile.json +0 -0
  48. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_build.py +0 -0
  49. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_unittests.py +0 -0
  50. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/utils.py +0 -0
  51. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/tools/setup/git-config.ps1 +0 -0
  52. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/CMakeLists.txt +0 -0
  53. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/_images/screenshot.png +0 -0
  54. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/design.rst +0 -0
  55. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/index.rst +0 -0
  56. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.c +0 -0
  57. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.h +0 -0
  58. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/test/test_component.cc +0 -0
  59. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/CMakeLists.txt +0 -0
  60. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/doc/index.rst +0 -0
  61. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/src/main.c +0 -0
  62. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/clang/toolchain.cmake +0 -0
  63. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/gcc/toolchain.cmake +0 -0
  64. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/variant/cookiecutter.json +0 -0
  65. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.cmake +0 -0
  66. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.txt +0 -0
  67. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/parts.cmake +0 -0
  68. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/variant.py +0 -0
  69. {spl_core-4.0.0 → spl_core-4.1.0}/src/spl_core/project_creator/workspace_artifacts.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spl-core
3
- Version: 4.0.0
3
+ Version: 4.1.0
4
4
  Summary: Software Product Line Support for CMake
5
5
  Home-page: https://github.com/avengineers/spl-core
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "spl-core"
3
- version = "4.0.0"
3
+ version = "4.1.0"
4
4
  description = "Software Product Line Support for CMake"
5
5
  authors = ["Avengineers <karsten.guenther@kamg.de>"]
6
6
  license = "MIT"
@@ -55,6 +55,7 @@ sphinxcontrib-plantuml = "*"
55
55
  sphinx-copybutton = "*"
56
56
  sphinx-new-tab-link = "*"
57
57
  pipenv = "*"
58
+ pypeline-runner = "^0.2.1"
58
59
 
59
60
  [tool.poetry.group.docs]
60
61
  optional = true
@@ -0,0 +1 @@
1
+ __version__ = "4.1.0"
@@ -0,0 +1,52 @@
1
+ import subprocess
2
+ from pathlib import Path
3
+ from typing import Dict, List, Optional
4
+
5
+
6
+ class CommandLineExecutor:
7
+ def __init__(
8
+ self,
9
+ cwd: Optional[Path] = None,
10
+ env: Optional[Dict[str, str]] = None,
11
+ ):
12
+ """
13
+ A class for executing command line commands.
14
+
15
+ Args:
16
+ - cmd: A string or list of strings representing the command to be executed.
17
+ - cwd: An optional Path object representing the current working directory.
18
+ - env: An optional dictionary of environment variables to be used in the command execution.
19
+ """
20
+ self.current_working_directory = cwd
21
+ self.env = env
22
+
23
+ def execute(self, cmd: str | List[str]) -> subprocess.CompletedProcess[str]:
24
+ """
25
+ Executes the command and returns a CompletedProcess object.
26
+
27
+ Returns:
28
+ - A subprocess.CompletedProcess object representing the result of the command execution.
29
+ """
30
+ command = " ".join([cmd] if isinstance(cmd, str) else cmd)
31
+ output = ""
32
+ try:
33
+ print(f"Running command: {command}")
34
+ with subprocess.Popen(
35
+ command,
36
+ cwd=str(self.current_working_directory or Path.cwd()),
37
+ stdout=subprocess.PIPE,
38
+ stderr=subprocess.STDOUT,
39
+ bufsize=1,
40
+ text=True,
41
+ env=self.env,
42
+ universal_newlines=True,
43
+ ) as process:
44
+ if process.stdout:
45
+ for line in process.stdout:
46
+ print(line, end="")
47
+ # We have to store the stdout content.
48
+ # This is necessary because the stdout object is closed after we printed its content
49
+ output += line
50
+ except Exception:
51
+ raise RuntimeError(f"Command '{command}' failed.") # noqa: B904
52
+ return subprocess.CompletedProcess(args=command, returncode=process.returncode, stdout=output, stderr=None)
@@ -4,10 +4,7 @@ verify_ssl = true
4
4
  name = "pypi"
5
5
 
6
6
  [packages]
7
- cookiecutter = "*"
8
- gcovr = "*"
9
- hammocking = "*"
10
- kconfiglib = "*"
7
+ spl-core = "*"
11
8
  jinja2 = "*"
12
9
  pytest = "*"
13
10
  pytest-env = "*"
@@ -0,0 +1,61 @@
1
+ import re
2
+ from abc import ABC, abstractmethod
3
+ from pathlib import Path
4
+ from typing import List
5
+
6
+ from spl_core.test_utils.spl_build import SplBuild
7
+
8
+
9
+ class BaseVariantTestRunner(ABC):
10
+ @property
11
+ def variant(self) -> str:
12
+ return re.sub(r"^Test_", "", self.__class__.__name__).replace("__", "/")
13
+
14
+ @property
15
+ @abstractmethod
16
+ def component_paths(self) -> List[Path]:
17
+ pass
18
+
19
+ @property
20
+ @abstractmethod
21
+ def expected_build_artifacts(self) -> List[Path]:
22
+ pass
23
+
24
+ @property
25
+ def expected_test_artifacts(self) -> List[Path]:
26
+ return [Path("reports/coverage/index.html")]
27
+
28
+ @property
29
+ def expected_variant_report_artifacts(self) -> List[Path]:
30
+ return [Path("reports/reports/index.html")]
31
+
32
+ @property
33
+ def expected_component_report_artifacts(self) -> List[Path]:
34
+ return [
35
+ Path("coverage.html"),
36
+ Path("unit_test_results.html"),
37
+ Path("unit_test_spec.html"),
38
+ Path("doxygen/html/index.html"),
39
+ Path("coverage/index.html"),
40
+ ]
41
+
42
+ def test_build(self) -> None:
43
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="prod")
44
+ assert 0 == spl_build.execute(target="all") # noqa: S101
45
+ for artifact in self.expected_build_artifacts:
46
+ assert artifact.exists() or Path.joinpath(spl_build.build_dir, artifact).exists() # noqa: S101
47
+
48
+ def test_unittest(self) -> None:
49
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test")
50
+ assert 0 == spl_build.execute(target="unittests") # noqa: S101
51
+ for artifact in self.expected_test_artifacts:
52
+ assert artifact.exists() # noqa: S101
53
+
54
+ def test_reports(self) -> None:
55
+ spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test")
56
+ assert 0 == spl_build.execute(target="all") # noqa: S101
57
+ for artifact in self.expected_variant_report_artifacts:
58
+ assert Path.joinpath(spl_build.build_dir, artifact).exists() # noqa: S101
59
+ for component in self.component_paths:
60
+ for artifact in self.expected_component_report_artifacts:
61
+ assert Path.joinpath(spl_build.build_dir, component, artifact).exists() # noqa: S101
@@ -0,0 +1,77 @@
1
+ import time
2
+ from pathlib import Path
3
+ from typing import List, Optional
4
+
5
+ from py_app_dev.core.logging import time_it
6
+
7
+ from spl_core.common.command_line_executor import CommandLineExecutor
8
+
9
+
10
+ class SplBuild:
11
+ """Class for building an SPL repository."""
12
+
13
+ def __init__(self, variant: str, build_kit: str):
14
+ """
15
+ Initialize a SplBuild instance.
16
+
17
+ Args:
18
+ variant (str): The build variant.
19
+ build_kit (str): The build kit.
20
+
21
+ """
22
+ self.variant = variant
23
+ self.build_kit = build_kit
24
+
25
+ @property
26
+ def build_dir(self) -> Path:
27
+ """
28
+ Get the build directory.
29
+
30
+ Returns:
31
+ Path: The build directory path.
32
+
33
+ """
34
+ return Path(f"build/{self.variant}/{self.build_kit}")
35
+
36
+ @time_it()
37
+ def execute(self, target: str, additional_args: Optional[List[str]] = None) -> int:
38
+ """
39
+ Build the target
40
+
41
+ Args:
42
+ target (str): The build target.
43
+ additional_args (List[str], optional): Additional arguments for building. Defaults to ["-build"].
44
+
45
+ Returns:
46
+ int: 0 in case of success.
47
+
48
+ """
49
+ if additional_args is None:
50
+ additional_args = ["-build"]
51
+ return_code = -1
52
+ while True:
53
+ cmd = [
54
+ "build.bat",
55
+ "-buildKit",
56
+ self.build_kit,
57
+ "-variants",
58
+ self.variant,
59
+ "-target",
60
+ target,
61
+ "-reconfigure",
62
+ ]
63
+ cmd.extend(additional_args)
64
+ result = CommandLineExecutor().execute(cmd)
65
+ return_code = result.returncode
66
+ if result.returncode:
67
+ if result.stdout:
68
+ if any(error in str(result.stdout) for error in ["No valid floating license", "No valid license", "GHS_LMHOST = N/A"]):
69
+ print("Probably a license issue, retrying ...")
70
+ time.sleep(10)
71
+ else:
72
+ break
73
+ else:
74
+ break
75
+ else:
76
+ break
77
+ return return_code
@@ -1 +0,0 @@
1
- __version__ = "4.0.0"
File without changes
File without changes