spl-core 7.5.0__py3-none-any.whl → 7.6.0rc1.dev1__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.
- spl_core/__init__.py +1 -1
- spl_core/test_utils/archive_artifacts_collection.py +120 -0
- spl_core/test_utils/base_variant_test_runner.py +5 -0
- spl_core/test_utils/spl_build.py +6 -2
- {spl_core-7.5.0.dist-info → spl_core-7.6.0rc1.dev1.dist-info}/METADATA +6 -6
- {spl_core-7.5.0.dist-info → spl_core-7.6.0rc1.dev1.dist-info}/RECORD +9 -8
- {spl_core-7.5.0.dist-info → spl_core-7.6.0rc1.dev1.dist-info}/LICENSE +0 -0
- {spl_core-7.5.0.dist-info → spl_core-7.6.0rc1.dev1.dist-info}/WHEEL +0 -0
- {spl_core-7.5.0.dist-info → spl_core-7.6.0rc1.dev1.dist-info}/entry_points.txt +0 -0
spl_core/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "7.
|
|
1
|
+
__version__ = "7.6.0-rc1.dev.1"
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import zipfile
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ArchiveArtifactsCollection:
|
|
9
|
+
"""
|
|
10
|
+
Collection of artifacts to be archived.
|
|
11
|
+
This class collects artifacts from a list of paths, handling both individual files and directories.
|
|
12
|
+
It supports absolute paths and ensures that the paths are relative to the build directory when archived.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class ArchiveArtifact:
|
|
17
|
+
"""
|
|
18
|
+
Represents a single artifact to be archived.
|
|
19
|
+
This class holds the archive path (relative to the build directory) and the absolute path of the artifact.
|
|
20
|
+
It is used to ensure that artifacts are correctly archived with their intended paths.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
archive_path: Path
|
|
24
|
+
absolute_path: Path
|
|
25
|
+
|
|
26
|
+
def __init__(self, artifacts: List[Path], build_dir: Path):
|
|
27
|
+
self.build_dir = build_dir
|
|
28
|
+
self.archive_artifacts: List[ArchiveArtifactsCollection.ArchiveArtifact] = []
|
|
29
|
+
for artifact in artifacts:
|
|
30
|
+
# Convert all artifacts to absolute paths first
|
|
31
|
+
artifact_path = artifact.resolve() if not artifact.is_absolute() else artifact
|
|
32
|
+
|
|
33
|
+
# Handle directories by recursively adding all files within them
|
|
34
|
+
if artifact_path.is_dir():
|
|
35
|
+
for file_artifact in artifact_path.glob("**/*"):
|
|
36
|
+
if file_artifact.is_file():
|
|
37
|
+
# Calculate the relative path from build_dir for the archive
|
|
38
|
+
if file_artifact.is_relative_to(build_dir.absolute()):
|
|
39
|
+
archive_path = file_artifact.relative_to(build_dir.absolute())
|
|
40
|
+
else:
|
|
41
|
+
# If not relative to build_dir, just use the filename
|
|
42
|
+
archive_path = Path(file_artifact.name)
|
|
43
|
+
|
|
44
|
+
self.archive_artifacts.append(self.ArchiveArtifact(archive_path=archive_path, absolute_path=file_artifact))
|
|
45
|
+
else:
|
|
46
|
+
# Handle individual files
|
|
47
|
+
# Calculate the relative path from build_dir for the archive
|
|
48
|
+
if artifact_path.is_relative_to(build_dir.absolute()):
|
|
49
|
+
archive_path = artifact_path.relative_to(build_dir.absolute())
|
|
50
|
+
else:
|
|
51
|
+
# If not relative to build_dir, just use the filename
|
|
52
|
+
archive_path = Path(artifact_path.name)
|
|
53
|
+
|
|
54
|
+
self.archive_artifacts.append(self.ArchiveArtifact(archive_path=archive_path, absolute_path=artifact_path))
|
|
55
|
+
|
|
56
|
+
def create_archive(self, zip_filename: Optional[str] = None) -> Path:
|
|
57
|
+
"""
|
|
58
|
+
Create a zip file containing the collected artifacts.
|
|
59
|
+
Args:
|
|
60
|
+
zip_filename: Optional custom name for the zip file (without extension).
|
|
61
|
+
If None, defaults to "artifacts.zip"
|
|
62
|
+
Returns:
|
|
63
|
+
Path: The path to the created zip file.
|
|
64
|
+
Raises:
|
|
65
|
+
Exception: If there is an error creating the zip file.
|
|
66
|
+
"""
|
|
67
|
+
if zip_filename is None:
|
|
68
|
+
zip_path = self.build_dir / "artifacts.zip"
|
|
69
|
+
else:
|
|
70
|
+
# Ensure the filename has .zip extension
|
|
71
|
+
if not zip_filename.endswith(".zip"):
|
|
72
|
+
zip_filename += ".zip"
|
|
73
|
+
zip_path = self.build_dir / zip_filename
|
|
74
|
+
|
|
75
|
+
# Delete the file if it already exists
|
|
76
|
+
if zip_path.exists():
|
|
77
|
+
zip_path.unlink()
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
with zipfile.ZipFile(zip_path, "w") as zip_file:
|
|
81
|
+
for artifact in self.archive_artifacts:
|
|
82
|
+
zip_file.write(artifact.absolute_path, arcname=artifact.archive_path)
|
|
83
|
+
print(f"Zip file created at: {zip_path}")
|
|
84
|
+
return zip_path
|
|
85
|
+
except Exception as e:
|
|
86
|
+
print(f"Error creating artifacts zip file: {e}")
|
|
87
|
+
raise e
|
|
88
|
+
|
|
89
|
+
def create_json(self, json_filename: Optional[str] = None) -> Path:
|
|
90
|
+
"""
|
|
91
|
+
Create a JSON file containing the collected artifacts.
|
|
92
|
+
Args:
|
|
93
|
+
json_filename: Optional custom name for the JSON file (without extension).
|
|
94
|
+
If None, defaults to "artifacts.json"
|
|
95
|
+
Returns:
|
|
96
|
+
Path: The path to the created JSON file.
|
|
97
|
+
Raises:
|
|
98
|
+
Exception: If there is an error creating the JSON file.
|
|
99
|
+
"""
|
|
100
|
+
if json_filename is None:
|
|
101
|
+
json_path = self.build_dir / "artifacts.json"
|
|
102
|
+
else:
|
|
103
|
+
# Ensure the filename has .json extension
|
|
104
|
+
if not json_filename.endswith(".json"):
|
|
105
|
+
json_filename += ".json"
|
|
106
|
+
json_path = self.build_dir / json_filename
|
|
107
|
+
|
|
108
|
+
# Delete the file if it already exists
|
|
109
|
+
if json_path.exists():
|
|
110
|
+
json_path.unlink()
|
|
111
|
+
|
|
112
|
+
try:
|
|
113
|
+
json_content = {
|
|
114
|
+
"artifacts": [str(artifact.archive_path.as_posix()) for artifact in self.archive_artifacts],
|
|
115
|
+
}
|
|
116
|
+
json_path.write_text(json.dumps(json_content, indent=4))
|
|
117
|
+
return json_path
|
|
118
|
+
except Exception as e:
|
|
119
|
+
print(f"Error creating artifacts JSON file: {e}")
|
|
120
|
+
raise e
|
|
@@ -9,6 +9,11 @@ from spl_core.test_utils.spl_build import SplBuild
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class BaseVariantTestRunner(ABC):
|
|
12
|
+
"""
|
|
13
|
+
Obsolete class for running tests on a specific variant of the SPL.
|
|
14
|
+
Instead use SplBuild directly in your test cases.
|
|
15
|
+
"""
|
|
16
|
+
|
|
12
17
|
@property
|
|
13
18
|
def variant(self) -> str:
|
|
14
19
|
return re.sub(r"^Test_", "", self.__class__.__name__).replace("__", "/")
|
spl_core/test_utils/spl_build.py
CHANGED
|
@@ -12,11 +12,15 @@ from spl_core.common.command_line_executor import CommandLineExecutor
|
|
|
12
12
|
|
|
13
13
|
@dataclass
|
|
14
14
|
class ArchiveArtifact:
|
|
15
|
+
"""Obsolete class for storing archive artifacts."""
|
|
16
|
+
|
|
15
17
|
archive_path: Path
|
|
16
18
|
absolute_path: Path
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
class ArtifactsCollection:
|
|
22
|
+
"""Obsolete class for collecting artifacts to be archived."""
|
|
23
|
+
|
|
20
24
|
def __init__(self, artifacts: List[Path], build_dir: Path):
|
|
21
25
|
self.archive_artifacts: List[ArchiveArtifact] = []
|
|
22
26
|
for artifact in artifacts:
|
|
@@ -161,7 +165,7 @@ class SplBuild:
|
|
|
161
165
|
|
|
162
166
|
def create_artifacts_archive(self, expected_artifacts: List[Path]) -> Path:
|
|
163
167
|
"""
|
|
164
|
-
|
|
168
|
+
Obsolete method for creating an archive of artifacts.
|
|
165
169
|
|
|
166
170
|
Args:
|
|
167
171
|
expected_artifacts: List of Path of artifacts which should be archived
|
|
@@ -192,7 +196,7 @@ class SplBuild:
|
|
|
192
196
|
|
|
193
197
|
def create_artifacts_json(self, expected_artifacts: List[Path]) -> Path:
|
|
194
198
|
"""
|
|
195
|
-
|
|
199
|
+
Obsolete method to create a JSON file listing the collected artifacts.
|
|
196
200
|
|
|
197
201
|
Returns:
|
|
198
202
|
Path: The path to the created JSON file.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: spl-core
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.6.0rc1.dev1
|
|
4
4
|
Summary: Software Product Line Support for CMake
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Avengineers
|
|
@@ -15,10 +15,10 @@ Classifier: Programming Language :: Python :: 3
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
-
Requires-Dist: cookiecutter (==2.
|
|
18
|
+
Requires-Dist: cookiecutter (==2.6.0)
|
|
19
19
|
Requires-Dist: doxysphinx (>=3.3,<4.0)
|
|
20
20
|
Requires-Dist: gcovr (>=8.3,<9.0)
|
|
21
|
-
Requires-Dist: hammocking (>=0.8,<0.
|
|
21
|
+
Requires-Dist: hammocking (>=0.8,<0.10)
|
|
22
22
|
Requires-Dist: kconfiglib (>=14.1,<15.0)
|
|
23
23
|
Requires-Dist: mlx-traceability (>=10.0,<11.0)
|
|
24
24
|
Requires-Dist: myst-parser (>=0.16)
|
|
@@ -26,15 +26,15 @@ Requires-Dist: py-app-dev (>=2.1,<3.0)
|
|
|
26
26
|
Requires-Dist: sphinx (>=7.3,<8.0)
|
|
27
27
|
Requires-Dist: sphinx-book-theme (>=1.1,<2.0)
|
|
28
28
|
Requires-Dist: sphinx-copybutton (>=0.5,<0.6)
|
|
29
|
-
Requires-Dist: sphinx-design (>=0.5,<0.
|
|
29
|
+
Requires-Dist: sphinx-design (>=0.5,<0.7)
|
|
30
30
|
Requires-Dist: sphinx-needs (>=2.0,<3.0)
|
|
31
|
-
Requires-Dist: sphinx-new-tab-link (>=0.4,<0.
|
|
31
|
+
Requires-Dist: sphinx-new-tab-link (>=0.4,<0.9)
|
|
32
32
|
Requires-Dist: sphinx-rtd-size (>=0.2,<0.3)
|
|
33
33
|
Requires-Dist: sphinx-rtd-theme (>=2.0,<3.0)
|
|
34
34
|
Requires-Dist: sphinx-test-reports (>=1.0,<2.0)
|
|
35
35
|
Requires-Dist: sphinxcontrib-datatemplates (>=0.11,<0.12)
|
|
36
36
|
Requires-Dist: sphinxcontrib-mermaid (>=0.9,<0.10)
|
|
37
|
-
Requires-Dist: sphinxcontrib-plantuml (>=0.29,<0.
|
|
37
|
+
Requires-Dist: sphinxcontrib-plantuml (>=0.29,<0.31)
|
|
38
38
|
Requires-Dist: typer (>=0,<1)
|
|
39
39
|
Project-URL: Bug Tracker, https://github.com/avengineers/spl-core/issues
|
|
40
40
|
Project-URL: Changelog, https://github.com/avengineers/spl-core/blob/develop/CHANGELOG.md
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
spl_core/__init__.py,sha256=
|
|
1
|
+
spl_core/__init__.py,sha256=2gY838g6_bBYT-OoraqhFcJpeqoshHodwrzyOoAVO1Q,32
|
|
2
2
|
spl_core/__run.py,sha256=DphnN7_Bjiw_mOOztsHxTDHS8snz1g2MMWAaJpZxPKM,361
|
|
3
3
|
spl_core/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
spl_core/common/command_line_executor.py,sha256=GHIMpNiMD_eP44vq7L_HiC08aKt7lgW_wn_omU6REwQ,2217
|
|
@@ -60,10 +60,11 @@ spl_core/kickstart/templates/project/tools/toolchains/clang/toolchain.cmake,sha2
|
|
|
60
60
|
spl_core/kickstart/templates/project/tools/toolchains/gcc/toolchain.cmake,sha256=AmLzPyhTgfc_Dsre4AlsvSOkVGW6VswWvrEnUL8JLhA,183
|
|
61
61
|
spl_core/main.py,sha256=_hL4j155WZMXog_755bgAH1PeUwvTdJZvVdVw9EWhvo,1225
|
|
62
62
|
spl_core/spl.cmake,sha256=W8h-Zj-N302qxMrRG8MhoEkJ0io92bWGp4Y5r8LBQnc,4535
|
|
63
|
-
spl_core/test_utils/
|
|
64
|
-
spl_core/test_utils/
|
|
65
|
-
spl_core
|
|
66
|
-
spl_core-7.
|
|
67
|
-
spl_core-7.
|
|
68
|
-
spl_core-7.
|
|
69
|
-
spl_core-7.
|
|
63
|
+
spl_core/test_utils/archive_artifacts_collection.py,sha256=x7LH5dGIvssyhXsTFzB6rjgb5D2efKvHVpnjId3MNDk,5126
|
|
64
|
+
spl_core/test_utils/base_variant_test_runner.py,sha256=Oq27lkJlpB_y-p2_8S23F5zjn1438HW148q-hQNz3EY,3795
|
|
65
|
+
spl_core/test_utils/spl_build.py,sha256=o3MCWYRb769bXut_9EM_ZEweRKH7SSAuajh9277mKuI,8233
|
|
66
|
+
spl_core-7.6.0rc1.dev1.dist-info/LICENSE,sha256=UjjA0o8f5tT3wVm7qodTLAhPWLl6kgVyn9FPAd1VeYY,1099
|
|
67
|
+
spl_core-7.6.0rc1.dev1.dist-info/METADATA,sha256=XENTS2NI5WpHV4m70zXtMb4b3ZbEqNMrqgT22NDZe7o,5165
|
|
68
|
+
spl_core-7.6.0rc1.dev1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
69
|
+
spl_core-7.6.0rc1.dev1.dist-info/entry_points.txt,sha256=18_sdVY93N1GVBiAHxQ_F9ZM-bBvOmVMOMn7PNe2EqU,45
|
|
70
|
+
spl_core-7.6.0rc1.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|