spl-core 7.6.0rc1.dev1__py3-none-any.whl → 7.7.0__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "7.6.0-rc1.dev.1"
1
+ __version__ = "7.7.0"
@@ -6,8 +6,7 @@ from pathlib import Path
6
6
  from typing import Callable, ClassVar, List, Optional
7
7
 
8
8
  from py_app_dev.core.logging import time_it
9
-
10
- from spl_core.common.command_line_executor import CommandLineExecutor
9
+ from py_app_dev.core.subprocess import SubprocessExecutor
11
10
 
12
11
 
13
12
  @dataclass
@@ -110,7 +109,7 @@ class SplBuild:
110
109
  target = self.target if self.target else "all"
111
110
  return_code = -1
112
111
  while True:
113
- cmd = [
112
+ cmd: list[str | Path] = [
114
113
  "build.bat",
115
114
  "-build",
116
115
  "-buildKit",
@@ -125,7 +124,11 @@ class SplBuild:
125
124
  cmd.extend(["-buildType", self.build_type])
126
125
  if additional_args:
127
126
  cmd.extend(additional_args)
128
- result = CommandLineExecutor().execute(cmd)
127
+ # Cast to Union[str, List[Union[str, Path]]] to satisfy SubprocessExecutor type
128
+ result = SubprocessExecutor(command=cmd).execute(handle_errors=False)
129
+ if result is None:
130
+ return_code = -1
131
+ break
129
132
  return_code = result.returncode
130
133
  if result.returncode:
131
134
  if result.stdout:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: spl-core
3
- Version: 7.6.0rc1.dev1
3
+ Version: 7.7.0
4
4
  Summary: Software Product Line Support for CMake
5
5
  License: MIT
6
6
  Author: Avengineers
@@ -1,7 +1,6 @@
1
- spl_core/__init__.py,sha256=2gY838g6_bBYT-OoraqhFcJpeqoshHodwrzyOoAVO1Q,32
1
+ spl_core/__init__.py,sha256=47fvHIkSmhyHn0x0ry3g-q6AbbaUsW0cVGEQdzOPvBw,22
2
2
  spl_core/__run.py,sha256=DphnN7_Bjiw_mOOztsHxTDHS8snz1g2MMWAaJpZxPKM,361
3
3
  spl_core/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- spl_core/common/command_line_executor.py,sha256=GHIMpNiMD_eP44vq7L_HiC08aKt7lgW_wn_omU6REwQ,2217
5
4
  spl_core/common/path.py,sha256=sDujd3n4XP1XGjHc7ImXEdjihO6A8BOIDbKCf7HgQ0Y,462
6
5
  spl_core/common.cmake,sha256=sRWqQeK04iUpeM3beQZXIi5mpEQNyO751O-yBoFCrqk,35160
7
6
  spl_core/conan.cmake,sha256=i1AuyN-e8cczX7TI1nl6e3Y8N-EP-QXPVY7LG6NUyJY,41958
@@ -62,9 +61,9 @@ spl_core/main.py,sha256=_hL4j155WZMXog_755bgAH1PeUwvTdJZvVdVw9EWhvo,1225
62
61
  spl_core/spl.cmake,sha256=W8h-Zj-N302qxMrRG8MhoEkJ0io92bWGp4Y5r8LBQnc,4535
63
62
  spl_core/test_utils/archive_artifacts_collection.py,sha256=x7LH5dGIvssyhXsTFzB6rjgb5D2efKvHVpnjId3MNDk,5126
64
63
  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,,
64
+ spl_core/test_utils/spl_build.py,sha256=bSM6hwhTH9aRryvUvtSPDfk_zoZuKEO5g3QXK4SIrco,8442
65
+ spl_core-7.7.0.dist-info/LICENSE,sha256=UjjA0o8f5tT3wVm7qodTLAhPWLl6kgVyn9FPAd1VeYY,1099
66
+ spl_core-7.7.0.dist-info/METADATA,sha256=vQKMDRbm6_XfeGLUHER-VjAWu78M3xPExLG7ZfkUvqc,5157
67
+ spl_core-7.7.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
68
+ spl_core-7.7.0.dist-info/entry_points.txt,sha256=18_sdVY93N1GVBiAHxQ_F9ZM-bBvOmVMOMn7PNe2EqU,45
69
+ spl_core-7.7.0.dist-info/RECORD,,
@@ -1,57 +0,0 @@
1
- import locale
2
- import subprocess
3
- import sys
4
- from pathlib import Path
5
- from typing import Dict, List, Optional
6
-
7
-
8
- class CommandLineExecutor:
9
- def __init__(
10
- self,
11
- cwd: Optional[Path] = None,
12
- env: Optional[Dict[str, str]] = None,
13
- ):
14
- """
15
- A class for executing command line commands.
16
-
17
- Args:
18
- - cmd: A string or list of strings representing the command to be executed.
19
- - cwd: An optional Path object representing the current working directory.
20
- - env: An optional dictionary of environment variables to be used in the command execution.
21
- """
22
- self.current_working_directory = cwd
23
- self.env = env
24
-
25
- def execute(self, cmd: str | List[str]) -> subprocess.CompletedProcess[str]:
26
- """
27
- Executes the command and returns a CompletedProcess object.
28
-
29
- Returns:
30
- - A subprocess.CompletedProcess object representing the result of the command execution.
31
- """
32
- command = " ".join([cmd] if isinstance(cmd, str) else cmd)
33
- output = ""
34
- try:
35
- print("=" * 120)
36
- print(f"= Running command: {command}")
37
- print("=" * 120)
38
- with subprocess.Popen(
39
- command,
40
- cwd=str(self.current_working_directory or Path.cwd()),
41
- stdout=subprocess.PIPE,
42
- stderr=subprocess.STDOUT,
43
- bufsize=1,
44
- text=True,
45
- env=self.env,
46
- universal_newlines=True,
47
- encoding="cp850" if (locale.getlocale()[0] == "de_DE" and sys.platform == "win32") else "utf-8",
48
- ) as process:
49
- if process.stdout:
50
- for line in process.stdout:
51
- print(line, end="")
52
- # We have to store the stdout content.
53
- # This is necessary because the stdout object is closed after we printed its content
54
- output += line
55
- except Exception:
56
- raise RuntimeError(f"Command '{command}' failed.") # noqa: B904
57
- return subprocess.CompletedProcess(args=command, returncode=process.returncode, stdout=output, stderr=None)