ScriptCollection 4.2.80__py3-none-any.whl → 4.2.81__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.
@@ -98,7 +98,7 @@ class AnionBuildPlatform:
98
98
  # merge_to_main_arguments+=f" --commonremotename {self.__configuration.common_remote_name}"
99
99
  if self.__configuration.verbosity is not None:
100
100
  merge_to_main_arguments+=f" --verbosity {self.__configuration.verbosity.value}"
101
- self.__sc.run_program("python",f"MergeToMain.py{merge_to_main_arguments}",scripts_folder,print_live_output=True)
101
+ self.__sc.run_program(GeneralUtilities.get_python_executable(),f"MergeToMain.py{merge_to_main_arguments}",scripts_folder,print_live_output=True)
102
102
 
103
103
  merge_to_stable_arguments=""
104
104
  #if self.__configuration.project_to_build is not None:
@@ -127,7 +127,7 @@ class AnionBuildPlatform:
127
127
  # merge_to_stable_arguments+=f" --commonremoteurl {self.__configuration.common_remote_url}"
128
128
  if self.__configuration.verbosity == LogLevel.Debug:
129
129
  merge_to_stable_arguments+=f" --verbosity {self.__configuration.verbosity.value}"
130
- self.__sc.run_program("python",f"MergeToStable.py{merge_to_stable_arguments}",scripts_folder,print_live_output=True)
130
+ self.__sc.run_program(GeneralUtilities.get_python_executable(),f"MergeToStable.py{merge_to_stable_arguments}",scripts_folder,print_live_output=True)
131
131
 
132
132
  #prepare for next-release
133
133
  self.__sc.git_checkout(repository,self.__configuration.source_branch)
@@ -851,7 +851,7 @@ def CreateRelease()->int:
851
851
  arguments=arguments+" --updatedependencies"
852
852
  if args.lazymode:
853
853
  arguments=arguments+" --lazymode"
854
- sc.run_program("python", arguments, scripts_folder,print_live_output=True)
854
+ sc.run_program(GeneralUtilities.get_python_executable(), arguments, scripts_folder,print_live_output=True)
855
855
 
856
856
  return 0
857
857
 
@@ -733,6 +733,22 @@ class GeneralUtilities:
733
733
  def to_pascal_case(s: str) -> str:
734
734
  return ''.join(current.lower() if prev.isalnum() else current.upper() for prev, current in zip(' ' + s, s) if current.isalnum())
735
735
 
736
+ @staticmethod
737
+ @check_arguments
738
+ def to_snake_case(s: str) -> str:
739
+ return '_'.join(t.lower() for t in re.split(r'[^a-zA-Z0-9]+', s) if t)
740
+
741
+ @staticmethod
742
+ @check_arguments
743
+ def to_camel_case(s: str) -> str:
744
+ words = [t.lower() for t in re.split(r'[^a-zA-Z0-9]+', s) if t]
745
+ return words[0] + ''.join(w.capitalize() for w in words[1:]) if words else ''
746
+
747
+ @staticmethod
748
+ @check_arguments
749
+ def to_kebab_case(s: str) -> str:
750
+ return '-'.join(t.lower() for t in re.split(r'[^a-zA-Z0-9]+', s) if t)
751
+
736
752
  @staticmethod
737
753
  @check_arguments
738
754
  def find_between(s: str, start: str, end: str) -> str:
@@ -1525,7 +1541,7 @@ class GeneralUtilities:
1525
1541
  Platform.MacOS_ARM64: "linux/arm64", # macOS → linux container
1526
1542
  }
1527
1543
  return mapping[platform_value]
1528
-
1544
+
1529
1545
  @staticmethod
1530
1546
  @check_arguments
1531
1547
  def platform_to_dotnet_runtime_identifier(platform_value: Platform) -> str:
@@ -1536,6 +1552,7 @@ class GeneralUtilities:
1536
1552
  Platform.MacOS_ARM64: "osx-arm64",
1537
1553
  }
1538
1554
  return mapping[platform_value]
1555
+
1539
1556
  @staticmethod
1540
1557
  @check_arguments
1541
1558
  def platform_to_go_runtime_identifier(platform_value: Platform) -> str:
@@ -1549,9 +1566,24 @@ class GeneralUtilities:
1549
1566
  @check_arguments
1550
1567
  def get_all_platforms() -> list[Platform]:
1551
1568
  return [
1552
- Platform.Windows_AMD64,
1553
- Platform.Linux_AMD64,
1554
- Platform.Linux_ARM64,
1569
+ Platform.Windows_AMD64,
1570
+ Platform.Linux_AMD64,
1571
+ Platform.Linux_ARM64,
1555
1572
  Platform.MacOS_ARM64,
1556
1573
  ]
1557
-
1574
+
1575
+ @staticmethod
1576
+ @check_arguments
1577
+ def get_python_executable() -> str:
1578
+ #virtual_env = os.environ.get("VIRTUAL_ENV")
1579
+ #if GeneralUtilities.string_has_content(virtual_env):
1580
+ # if platform.system() == "Windows":
1581
+ # result = os.path.join(virtual_env, "Scripts", "python.exe")
1582
+ # else:
1583
+ # result = os.path.join(virtual_env, "bin", "python")
1584
+ if GeneralUtilities.string_has_content(sys.executable):
1585
+ result = sys.executable
1586
+ else:
1587
+ result = "python"
1588
+ GeneralUtilities.assert_condition(os.path.isfile(result), f"Python executable does not exist: '{result}'")
1589
+ return result
@@ -30,12 +30,14 @@ class OCIImageManager:
30
30
  ImageHandlerGitlabEE(),
31
31
  ]
32
32
 
33
+ @GeneralUtilities.check_arguments
33
34
  def get_image_handler(self,image_name:str)->AbstractImageHandler:
34
35
  for image_handler in self.image_handler:
35
36
  if image_handler.can_handle(image_name):
36
37
  return image_handler
37
38
  raise ValueError(f"No image-handler available for image \"{image_name}\".")
38
39
 
40
+ @GeneralUtilities.check_arguments
39
41
  def get_repository_image_definition_file(self,repository:str)->str:
40
42
  self.__sc.assert_is_git_repository(repository)
41
43
  sc_folder_in_repo=os.path.join(repository,".ScriptCollection","OCIImages")
@@ -64,6 +66,7 @@ class OCIImageManager:
64
66
  result.append(line[0])
65
67
  return result
66
68
 
69
+ @GeneralUtilities.check_arguments
67
70
  def custom_registry_is_defined(self,image_name:str)->bool:
68
71
  global_docker_image_registries_file=self.get_global_docker_image_registries_file()
69
72
  for line in GeneralUtilities.read_nonempty_lines_from_file(global_docker_image_registries_file)[1:]:
@@ -73,6 +76,7 @@ class OCIImageManager:
73
76
  return True
74
77
  return False
75
78
 
79
+ @GeneralUtilities.check_arguments
76
80
  def get_tag_for_image(self,repository:str,image_name:str,strict_mode:bool)->str:
77
81
  repository_image_definition_file=self.get_repository_image_definition_file(repository)
78
82
  for line in [f.split(";") for f in GeneralUtilities.read_nonempty_lines_from_file(repository_image_definition_file)[1:]]:
@@ -80,6 +84,7 @@ class OCIImageManager:
80
84
  return line[2]
81
85
  raise ValueError(f"No tag defined for image \"{image_name}\".")
82
86
 
87
+ @GeneralUtilities.check_arguments
83
88
  def get_registry_address_for_image(self,repository:str,image_name:str)->str:
84
89
  """if image_name==Debian this function returns something like "myregistry.example.com/debian", always without tag."""
85
90
  if self.custom_registry_is_defined(image_name):
@@ -96,9 +101,11 @@ class OCIImageManager:
96
101
  return line[1]
97
102
  raise ValueError(f"No registry defined for image \"{image_name}\".")
98
103
 
104
+ @GeneralUtilities.check_arguments
99
105
  def get_registry_address_for_image_with_default_tag(self,repository:str,image_name:str,strict_mode:bool=True)->str:
100
106
  return f"{self.get_registry_address_for_image(repository,image_name)}:{self.get_tag_for_image(repository,image_name,strict_mode)}"
101
107
 
108
+ @GeneralUtilities.check_arguments
102
109
  def update_default_tag_for_images_in_image_definitions_file(self,repository:str,search_in_custom_registry_only_if_available:bool)->None:
103
110
  file=f"{repository}/.ScriptCollection/OCIImages/ImageDefinition.csv"
104
111
  GeneralUtilities.assert_file_exists(file)
@@ -125,7 +132,7 @@ class OCIImageManager:
125
132
  raise ValueError(f"No custom registry defined for image {image_name}.")
126
133
  if not search_in_custom_registry_only_if_available:
127
134
  addresses_to_check.append(registry_address)
128
- newest_versions:set[Version]=[default_tag]
135
+ newest_versions:set[Version]={default_tag}
129
136
  current_version=Version(default_tag)
130
137
  for address in addresses_to_check:
131
138
  newest_versions_for_address=self.get_available_versions_of_image_which_are_newer(image_name,address,current_version,VersionEcholon.LatestVersion)
@@ -139,40 +146,45 @@ class OCIImageManager:
139
146
  new_lines.append(f"{image_name};{registry_address};{tag}")
140
147
  GeneralUtilities.write_lines_to_file(file,new_lines)
141
148
 
149
+ @GeneralUtilities.check_arguments
142
150
  def get_available_versions_of_image_which_are_newer(self,image_name:str,registry_address:str,current_version:Version,echolon: VersionEcholon)->Version:
143
- image_handler=self.get_image_handler(image_name)
151
+ #image_handler=self.get_image_handler(image_name)
144
152
  result= None #TODO calculate result using get_available_tags_of_image.
145
153
  #TODO if echolon is not none, then use echolon instead of the default echolon of the image-handler.
146
154
  #TODO return the versions sorted.
147
155
  #TODO if result is empty: return None
148
156
  return result
149
157
 
158
+ @GeneralUtilities.check_arguments
150
159
  def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
151
160
  """registry_address must have one of theese formats: "myregistry.example.com/debian" or "docker.io/debian" or "docker.io/myuser/debian".
152
161
  returns something like ["13.2-slim", "13.2", "13.3-slim", "13.3"]."""
153
162
  return self.get_image_handler(image_name).get_available_tags_of_image(image_name,registry_address)
154
163
 
164
+ @GeneralUtilities.check_arguments
155
165
  def tag_to_version(self,image_name:str,tag:str)->Version:
156
166
  """registry_address must have one of theese formats: "myregistry.example.com/debian" or "docker.io/debian" or "docker.io/myuser/debian"."""
157
167
  return self.get_image_handler(image_name).tag_to_version(image_name, tag)
158
168
 
169
+ @GeneralUtilities.check_arguments
159
170
  def version_to_tag(self,image_name:str,version:Version)->str:
160
171
  """registry_address must have one of theese formats: "myregistry.example.com/debian" or "docker.io/debian" or "docker.io/myuser/debian".
161
172
  returns something like "13.3-slim".
162
173
  If there are multiple tags available for a certain version then the image-handler decides which one will be returned."""
163
174
  return self.get_image_handler(image_name).version_to_tag(image_name,version)
164
175
 
176
+ @GeneralUtilities.check_arguments
165
177
  def get_images_used_in_docker_compose_file(self,docker_compose_file:str)->dict[str,tuple[str,str,str]]:#returns dict[service_name,[image_name,image_address,current_tag]]
166
178
  GeneralUtilities.assert_file_exists(docker_compose_file)
167
179
  return {}#TODO implement function
168
180
 
181
+ @GeneralUtilities.check_arguments
169
182
  def update_image_in_docker_compose_file(self,docker_compose_file:str)->None:
170
- for service,service_information in self.get_images_used_in_docker_compose_file(docker_compose_file).items():
183
+ for service,service_information in self.get_images_used_in_docker_compose_file(docker_compose_file).items():#pylint:disable=unused-variable
171
184
  image_name=service_information[0]
172
185
  image_address=service_information[1]
173
186
  current_tag=service_information[2]
174
187
  image_handler=self.get_image_handler(image_name)
175
188
  new_versions_for_address=self.get_available_versions_of_image_which_are_newer(image_name,image_address,self.tag_to_version(image_name,current_tag),image_handler.get_default_echolon_for_update())
176
- new_tag=self.version_to_tag(image_name,new_versions_for_address)
189
+ new_tag=self.version_to_tag(image_name,new_versions_for_address)#pylint:disable=unused-variable
177
190
  #TODO update tag for service in docker-compose-file to new_tag
178
-
@@ -38,7 +38,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
38
38
  from .ProgramRunnerPopen import ProgramRunnerPopen
39
39
  from .SCLog import SCLog, LogLevel
40
40
 
41
- version = "4.2.80"
41
+ version = "4.2.81"
42
42
  __version__ = version
43
43
 
44
44
  class VSCodeWorkspaceShellTask:
@@ -513,17 +513,22 @@ class ScriptCollectionCore:
513
513
 
514
514
  @GeneralUtilities.check_arguments
515
515
  def git_fetch(self, folder: str, remotename: str = "--all") -> None:
516
- self.is_git_or_bare_git_repository(folder)
516
+ self.assert_is_git_repository(folder)
517
517
  self.run_program_argsasarray("git", ["fetch", remotename, "--tags", "--prune"], folder, throw_exception_if_exitcode_is_not_zero=True)
518
518
 
519
519
  @GeneralUtilities.check_arguments
520
520
  def git_fetch_in_bare_repository(self, folder: str, remotename, localbranch: str, remotebranch: str) -> None:
521
- self.is_git_or_bare_git_repository(folder)
521
+ self.assert_is_git_repository(folder)
522
522
  self.run_program_argsasarray("git", ["fetch", remotename, f"{remotebranch}:{localbranch}"], folder, throw_exception_if_exitcode_is_not_zero=True)
523
523
 
524
+ def branch_exists(self, folder: str, branchname: str) -> bool:
525
+ self.assert_is_git_repository(folder)
526
+ result = self.run_program_argsasarray("git", ["rev-parse", "--verify", branchname], folder, throw_exception_if_exitcode_is_not_zero=False)
527
+ return result[0] == 0
528
+
524
529
  @GeneralUtilities.check_arguments
525
530
  def git_remove_branch(self, folder: str, branchname: str) -> None:
526
- self.is_git_or_bare_git_repository(folder)
531
+ self.assert_is_git_repository(folder)
527
532
  self.run_program("git", f"branch -D {branchname}", folder, throw_exception_if_exitcode_is_not_zero=True)
528
533
 
529
534
  @GeneralUtilities.check_arguments
@@ -204,6 +204,11 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
204
204
  GeneralUtilities.ensure_directory_does_not_exist(temp_output_folder)
205
205
  diagnostics: list[tuple[LogLevel, str, str | None, int | None]] = []
206
206
  pattern = re.compile(r"^\s*(?:(.+?)\((\d+),\d+\): )?(error|warning|message|info) [^:]+: (.+?)(?:\s*\[.+\])?\s*$", re.IGNORECASE)
207
+ #TODO fix this function. this does not work. fyi output looks like this:
208
+ #E:\Data\Projects\GRYLibrary\GRYLibrary>dotnet build GRYLibrary.sln -nologo -v minimal
209
+ #Restore succeeded with 11 warning(s) in 0,9s
210
+ # E:\Data\Projects\GRYLibrary\GRYLibrary\GRYLibrary\GRYLibrary.csproj : warning NU1510: PackageReference Microsoft.CSharp will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
211
+ # E:\Data\Projects\GRYLibrary\GRYLibrary\GRYLibraryTests\GRYLibraryTests.csproj : warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
207
212
  for line in GeneralUtilities.string_to_lines(run_result[1] + "\n" + run_result[2]):
208
213
  m = pattern.match(line)
209
214
  if m:
@@ -462,14 +467,26 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
462
467
  GeneralUtilities.ensure_directory_exists(temp_folder)
463
468
  runsettings_file = "runsettings.xml"
464
469
  codeunit_folder = f"{repository_folder}/{codeunit_name}"
465
- arg = f"test . -c {dotnet_build_configuration}"
470
+ args: list[str] = ["test", ".", "-c", dotnet_build_configuration]
466
471
  if os.path.isfile(os.path.join(codeunit_folder, runsettings_file)):
467
- arg = f"{arg} --settings {runsettings_file}"
468
- arg = f"{arg} /p:CollectCoverage=true /p:CoverletOutput=../Other/Artifacts/TestCoverage/Testcoverage /p:CoverletOutputFormat=cobertura"
469
- self._protected_sc.run_program("dotnet", arg, codeunit_folder, print_live_output=self.get_verbosity()==LogLevel.Debug,timeoutInSeconds=60*20)
470
- target_file = os.path.join(coverage_file_folder, "TestCoverage.xml")
472
+ args += ["--settings", runsettings_file]
473
+ args += ["--collect:XPlat Code Coverage", "--results-directory", temp_folder]
474
+ self._protected_sc.run_program_argsasarray("dotnet", args, codeunit_folder, print_live_output=self.get_verbosity()==LogLevel.Debug, timeoutInSeconds=60*20)
475
+ # coverlet.collector writes the report to <temp_folder>/<run-guid>/coverage.cobertura.xml
476
+ generated_coverage_file: str = None
477
+ for root_dir, _, files in os.walk(temp_folder):
478
+ for f in files:
479
+ if f == "coverage.cobertura.xml":
480
+ generated_coverage_file = os.path.join(root_dir, f)
481
+ break
482
+ if generated_coverage_file is not None:
483
+ break
484
+ GeneralUtilities.assert_condition(generated_coverage_file is not None, f"Coverage file 'coverage.cobertura.xml' was not found under '{temp_folder}'.")
485
+ GeneralUtilities.ensure_directory_exists(coverage_file_folder)
486
+ target_file = os.path.join(coverage_file_folder, "TestCoverage.xml")
471
487
  GeneralUtilities.ensure_file_does_not_exist(target_file)
472
- os.rename(os.path.join(coverage_file_folder, "Testcoverage.cobertura.xml"), target_file)
488
+ shutil.copyfile(generated_coverage_file, target_file)
489
+ GeneralUtilities.ensure_directory_does_not_exist(temp_folder)
473
490
  self.__remove_unrelated_package_from_testcoverage_file(target_file, codeunit_name)
474
491
  root: etree._ElementTree = etree.parse(target_file)
475
492
  source_base_path_in_coverage_file: str = root.xpath("//coverage/sources/source/text()")[0].replace("\\", "/")
@@ -1,4 +1,3 @@
1
- import os
2
1
  from ...GeneralUtilities import GeneralUtilities
3
2
  from ...SCLog import LogLevel
4
3
  from ..TFCPS_CodeUnitSpecific_Base import TFCPS_CodeUnitSpecific_Base, TFCPS_CodeUnitSpecific_Base_CLI
@@ -15,7 +15,7 @@ class TFCPS_CodeUnitSpecific_Python_Functions(TFCPS_CodeUnitSpecific_Base):
15
15
  codeunit_folder = self.get_codeunit_folder()
16
16
  target_directory = GeneralUtilities.resolve_relative_path("../Artifacts/BuildResult_Wheel", os.path.join(self.get_artifacts_folder()))
17
17
  GeneralUtilities.ensure_directory_exists(target_directory)
18
- self._protected_sc.run_program("python", f"-m build --wheel --outdir {target_directory}", codeunit_folder,print_live_output=self.get_verbosity()==LogLevel.Debug)
18
+ self._protected_sc.run_program(GeneralUtilities.get_python_executable(), f"-m build --wheel --outdir {target_directory}", codeunit_folder,print_live_output=self.get_verbosity()==LogLevel.Debug)
19
19
  self.generate_bom_for_python_project( )
20
20
  self.copy_source_files_to_output_directory()
21
21
 
@@ -1,4 +1,3 @@
1
- import os
2
1
  from ...GeneralUtilities import GeneralUtilities
3
2
  from ...SCLog import LogLevel
4
3
  from ..TFCPS_CodeUnitSpecific_Base import TFCPS_CodeUnitSpecific_Base, TFCPS_CodeUnitSpecific_Base_CLI
@@ -52,21 +52,21 @@ class TFCPS_CodeUnit_BuildCodeUnit:
52
52
  arguments = f"{arguments} --ispremerge"
53
53
 
54
54
  self.sc.log.log("Do common tasks...")
55
- self.sc.run_program("python", f"CommonTasks.py {arguments}", os.path.join(self.codeunit_folder, "Other"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
55
+ self.sc.run_program(GeneralUtilities.get_python_executable(), f"CommonTasks.py {arguments}", os.path.join(self.codeunit_folder, "Other"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
56
56
  self.verify_artifact_exists(self.codeunit_folder, dict[str, bool]({"License": True, "DiffReport": True}))
57
57
 
58
58
  self.sc.log.log("Build...")
59
- self.sc.run_program("python", f"Build.py {arguments}", os.path.join(self.codeunit_folder, "Other", "Build"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
59
+ self.sc.run_program(GeneralUtilities.get_python_executable(), f"Build.py {arguments}", os.path.join(self.codeunit_folder, "Other", "Build"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
60
60
  artifacts = {"BuildResult_.+": True, "BOM": False, "SourceCode": self.tFCPS_Tools.codeunit_has_testable_sourcecode(codeunit_file)}
61
61
  self.verify_artifact_exists(self.codeunit_folder, dict[str, bool](artifacts))
62
62
 
63
63
  if self.tFCPS_Tools.codeunit_has_testable_sourcecode(codeunit_file):
64
64
  self.sc.log.log("Run testcases...")
65
- self.sc.run_program("python", f"RunTestcases.py {arguments}", os.path.join(self.codeunit_folder, "Other", "QualityCheck"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
65
+ self.sc.run_program(GeneralUtilities.get_python_executable(), f"RunTestcases.py {arguments}", os.path.join(self.codeunit_folder, "Other", "QualityCheck"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
66
66
  self.verify_artifact_exists(self.codeunit_folder, dict[str, bool]({"TestCoverage": True, "TestCoverageReport": False}))
67
67
 
68
68
  self.sc.log.log("Check for linting-issues...")
69
- linting_result = self.sc.run_program("python", f"Linting.py {arguments}", os.path.join(self.codeunit_folder, "Other", "QualityCheck"), print_live_output=self.sc.log.loglevel==LogLevel.Quiet, throw_exception_if_exitcode_is_not_zero=False)
69
+ linting_result = self.sc.run_program(GeneralUtilities.get_python_executable(), f"Linting.py {arguments}", os.path.join(self.codeunit_folder, "Other", "QualityCheck"), print_live_output=self.sc.log.loglevel==LogLevel.Quiet, throw_exception_if_exitcode_is_not_zero=False)
70
70
  if linting_result[0] != 0:
71
71
  self.sc.log.log("Linting-issues were found.", LogLevel.Warning)
72
72
  for line in GeneralUtilities.string_to_lines(linting_result[1]):
@@ -76,14 +76,14 @@ class TFCPS_CodeUnit_BuildCodeUnit:
76
76
 
77
77
  self.sc.log.log("Generate reference...")
78
78
  try:
79
- self.sc.run_program("python", "GenerateReference.py", os.path.join(self.codeunit_folder, "Other", "Reference"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
79
+ self.sc.run_program(GeneralUtilities.get_python_executable(), "GenerateReference.py", os.path.join(self.codeunit_folder, "Other", "Reference"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
80
80
  except Exception as e:
81
81
  self.sc.log.log_exception(f"Generating reference failed with the following error",e, LogLevel.Warning)
82
82
  self.verify_artifact_exists(self.codeunit_folder, dict[str, bool]({"Reference": True}))
83
83
 
84
84
  if os.path.isfile(os.path.join(self.codeunit_folder, "Other", "OnBuildingFinished.py")):
85
85
  self.sc.log.log('Finalize building codeunits...')
86
- self.sc.run_program("python", f"OnBuildingFinished.py {arguments}", os.path.join(self.codeunit_folder, "Other"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
86
+ self.sc.run_program(GeneralUtilities.get_python_executable(), f"OnBuildingFinished.py {arguments}", os.path.join(self.codeunit_folder, "Other"), print_live_output=self.sc.log.loglevel==LogLevel.Debug)
87
87
 
88
88
  artifacts_folder = os.path.join(self.codeunit_folder, "Other", "Artifacts")
89
89
  artifactsinformation_file = os.path.join(artifacts_folder, f"{self.codeunit_name}.artifactsinformation.xml")
@@ -132,4 +132,4 @@ class TFCPS_CodeUnit_BuildCodeUnit:
132
132
  @GeneralUtilities.check_arguments
133
133
  def update_dependencies(self) -> None:
134
134
  self.sc.log.log("Update dependencies...")
135
- self.sc.run_program("python", "UpdateDependencies.py", os.path.join(self.codeunit_folder, "Other"),print_live_output=True)
135
+ self.sc.run_program(GeneralUtilities.get_python_executable(), "UpdateDependencies.py", os.path.join(self.codeunit_folder, "Other"),print_live_output=True)
@@ -81,7 +81,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
81
81
  args=["--repository",self.repository,"--targetenvironmenttype",self.target_environment_type,"--verbosity",str(int(self.sc.log.loglevel))]
82
82
  if GeneralUtilities.string_has_content(self.additionalargumentsfile):
83
83
  args=args+["--additionalargumentsfile", self.additionalargumentsfile]
84
- if not self.__use_cache:
84
+ if not self.__use_cache:
85
85
  if self.sc.git_repository_has_uncommitted_changes(self.repository):
86
86
  self.sc.log.log("No-cache-option can not be applied because there are uncommited changes in the repository.",LogLevel.Warning)
87
87
  else:
@@ -89,11 +89,11 @@ class TFCPS_CodeUnit_BuildCodeUnits:
89
89
 
90
90
  if os.path.isfile( os.path.join( self.sc.get_scriptcollection_configuration_folder(),"TFCPS","CustomPreCodeUnitBuildScript.py")):
91
91
  self.sc.log.log("Run custom pre-codeunitbuild script...")
92
- self.sc.run_program_argsasarray("python",["CustomPreCodeUnitBuildScript.py"]+args, os.path.join( self.sc.get_scriptcollection_configuration_folder(),"TFCPS"),print_live_output=True)
92
+ self.sc.run_program_argsasarray(GeneralUtilities.get_python_executable(),["CustomPreCodeUnitBuildScript.py"]+args, os.path.join( self.sc.get_scriptcollection_configuration_folder(),"TFCPS"),print_live_output=True)
93
93
 
94
94
  if os.path.isfile( os.path.join(self.repository,"Other","Scripts","PrepareBuildCodeunits.py")):
95
95
  self.sc.log.log("Prepare build codeunits...")
96
- self.sc.run_program_argsasarray("python",["PrepareBuildCodeunits.py"]+args, os.path.join(self.repository,"Other","Scripts"),print_live_output=True)
96
+ self.sc.run_program_argsasarray(GeneralUtilities.get_python_executable(),["PrepareBuildCodeunits.py"]+args, os.path.join(self.repository,"Other","Scripts"),print_live_output=True)
97
97
 
98
98
  @GeneralUtilities.check_arguments
99
99
  def build_codeunits_in_container(self) -> None:
@@ -264,7 +264,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
264
264
  self.sc.assert_no_uncommitted_changes(repository)
265
265
  self.run_prepare_script()
266
266
  if os.path.isfile(os.path.join(repository,"Other","Scripts","UpdateDependencies.py")):
267
- self.sc.run_program("python","UpdateDependencies.py",os.path.join(repository,"Other","Scripts"))
267
+ self.sc.run_program(GeneralUtilities.get_python_executable(),"UpdateDependencies.py",os.path.join(repository,"Other","Scripts"))
268
268
  codeunits:list[str]=self.tfcps_tools_general.get_codeunits(repository)
269
269
  for codeunit_name in codeunits:
270
270
  self.sc.log.log(f"Update dependencies of codeunit {codeunit_name}...")
@@ -272,7 +272,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
272
272
  tFCPS_CodeUnit_BuildCodeUnit:TFCPS_CodeUnit_BuildCodeUnit = TFCPS_CodeUnit_BuildCodeUnit(codeunit_folder,self.sc.log.loglevel,"QualityCheck",None,True,False)
273
273
  tFCPS_CodeUnit_BuildCodeUnit.build_codeunit()#ensure requirements for updating are there (some programming-languages needs this)
274
274
  if self.tfcps_tools_general.codeunit_has_updatable_dependencies(os.path.join(codeunit_folder,f"{codeunit_name}.codeunit.xml")):
275
- self.sc.run_program("python","UpdateDependencies.py",os.path.join(codeunit_folder,"Other"))
275
+ self.sc.run_program(GeneralUtilities.get_python_executable(),"UpdateDependencies.py",os.path.join(codeunit_folder,"Other"))
276
276
  tFCPS_CodeUnit_BuildCodeUnit.build_codeunit()#check if codeunit is still buildable
277
277
  if self.sc.git_repository_has_uncommitted_changes(repository):
278
278
  changelog_folder = os.path.join(repository, "Other", "Resources", "Changelog")
@@ -103,7 +103,7 @@ class TFCPS_MergeToStable:
103
103
  push_script:str=os.path.join( self.createRelease_configuration.build_repo,"Scripts","CreateRelease",f"PushArtifacts.{codeunit}.py")
104
104
  if os.path.isfile(push_script):
105
105
  self.sc.log.log(f"Push artifacts of codeunit {codeunit}...")
106
- self.sc.run_program("python",os.path.basename(push_script),os.path.dirname(push_script))
106
+ self.sc.run_program(GeneralUtilities.get_python_executable(),os.path.basename(push_script),os.path.dirname(push_script))
107
107
  else:
108
108
  self.sc.log.log(f"Codeunit {codeunit} does not have artifacts to push. (Scriptfile \"{push_script}\" does not exist.)",LogLevel.Debug)
109
109
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
- Name: ScriptCollection
3
- Version: 4.2.80
2
+ Name: scriptcollection
3
+ Version: 4.2.81
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Home-page: https://github.com/anionDev/ScriptCollection
6
6
  Author: Marius Göcke
@@ -23,7 +23,7 @@ Classifier: Topic :: Utilities
23
23
  Requires-Python: >=3.10
24
24
  Description-Content-Type: text/markdown
25
25
  Requires-Dist: build>=1.5.0
26
- Requires-Dist: coverage>=7.13.5
26
+ Requires-Dist: coverage>=7.14.0
27
27
  Requires-Dist: cyclonedx-bom>=7.1.0
28
28
  Requires-Dist: defusedxml>=0.7.1
29
29
  Requires-Dist: keyboard>=0.13.5
@@ -36,7 +36,7 @@ Requires-Dist: pycdlib>=1.16.0
36
36
  Requires-Dist: Pygments>=2.20.0
37
37
  Requires-Dist: pylint>=4.0.5
38
38
  Requires-Dist: pyOpenSSL>=25.3.0
39
- Requires-Dist: PyPDF>=6.10.2
39
+ Requires-Dist: PyPDF>=6.11.0
40
40
  Requires-Dist: pytest>=8.4.2
41
41
  Requires-Dist: PyYAML>=6.0.3
42
42
  Requires-Dist: qrcode>=8.2.0
@@ -1,7 +1,7 @@
1
- ScriptCollection/AnionBuildPlatform.py,sha256=K-PHarX802A0PU8uRu0GNcEZiXujFoXHACe-X9YJsAQ,11711
1
+ ScriptCollection/AnionBuildPlatform.py,sha256=UcE3uy_Vm9__QVTlP6V4Y7BrhQPQG6hGYrmQ-6rXSPA,11775
2
2
  ScriptCollection/CertificateUpdater.py,sha256=Pa6eyjQSx7IIvj4PQVMI0IwMs01KQrNSB7Qa-7lRfBs,9375
3
- ScriptCollection/Executables.py,sha256=RXEm_fbfO4VuPj-OS0YbRgbUHYL4Xr4PD599kaXINBA,44783
4
- ScriptCollection/GeneralUtilities.py,sha256=JYcsEad4LA_kdlUVECk21wX8MtOv4AeIbD95_Hco2hk,65522
3
+ ScriptCollection/Executables.py,sha256=5xa9IJ_jsUCQ2qhoSuEghAQwp3F2PTJ7QW5zJwZbEZ8,44815
4
+ ScriptCollection/GeneralUtilities.py,sha256=eOFB0Te-oLPsAxIIt3y-VZ7YIW5ZBxSvR-fa0eTCq0o,66782
5
5
  ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
6
6
  ScriptCollection/ProcessesRunner.py,sha256=o5raxIt3lknNPoPrjNzJ2bprRPJ3SnL0rrR7crraD7E,1523
7
7
  ScriptCollection/ProgramRunnerBase.py,sha256=4A2eQgSg_rRgQcgSi-LYtUlM-uSQEpS7qFWn0tWt4uo,2171
@@ -9,10 +9,10 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
9
9
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
10
10
  ScriptCollection/ProgramRunnerSudo.py,sha256=_khC3xuTdrPoLluBJZWfldltmmuKltABJPcbjZSFW-4,4835
11
11
  ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
12
- ScriptCollection/ScriptCollectionCore.py,sha256=VogS7MakwfAyqmY35dHCoLIcU0vzKHTTzpKHDNImrY0,188192
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=iA8bv2CGbGg0xBFZCybyf0YkJLPpck5cjT69MIZADcw,188468
13
13
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
15
- ScriptCollection/OCIImages/OCIImageManager.py,sha256=xZBXxq9hO3Sen777z9xytv2ybb5pG5IMknrqT3E-QgY,10627
15
+ ScriptCollection/OCIImages/OCIImageManager.py,sha256=2muW4hJ_a7EfavY3WVnafqZ0HC87RcZsoTuNvA3c0To,11175
16
16
  ScriptCollection/OCIImages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py,sha256=rty9SnftreYWLIwvdUn4LhiHqCTevb_tWuYWoOnRJuo,732
18
18
  ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py,sha256=M-4qxKWBZRtKdYQ-uXgfrxRBoZTXEjgqCxFXyFxTyzc,736
@@ -25,12 +25,12 @@ ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=5-4pwGDq5j1Un
25
25
  ScriptCollection/Resources/CultureChooser/index.html,sha256=gxQzbrSp4WU52TqN-gcBEtz2gJXmmM14OwTSFtFVRvw,276
26
26
  ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz6xU2aGfr03tJRGczQrlpn-IeODc15d5kc0,232
27
27
  ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=EMNDgkUem87aH1csz7eoSBBEKkiZMLZqZhnxKSPQWe0,27845
28
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=MieeAAKm1y58qXp1cCUN5mj5vwpq4Pc1uusUjPQzpvc,8237
29
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=2CNCmngOgygvhJrBdMbrq5W6LZ-xxchlxeThaDQZ-TA,15792
28
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=SWuYcQ6-dx4HxQ_YaD4MB6VS_5Wv6RVWtfWHcxP3KZw,8461
29
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=vwFN7hVo77TIWeEPI6St2BBSTb6MNu_WhXX6YgkuMhI,15908
30
30
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=yqGstRjRfVVGbqrcBgtYStqth2x2SvBb3y2Ht8GsuMQ,6554
31
31
  ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=Tpzgiz6m3-cYCkObZOG5Uu7oM-EMoWFzzRpLl3Lblqo,2023
32
32
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=-Ev9D3bZDlUk2WFQhcmvzQ3FCS97OdsVUd0koAdmpZc,7474
33
- ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=Ajfy2pLajTuU6UpwItHt4C2a-gLF3gPc4z6BktL3Cio,22163
33
+ ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=DL8JrYp4j7cqrhfr7FmRqJ3LWC2Om8nH4eNwQenOLfQ,22195
34
34
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=f0Uq1cA_4LvmL72cal0crrbKF6PcxL13D9wBKuQ1YBw,2328
35
35
  ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=ydRDpWmU-smCphGyTNuaQeiabWaWOUgzIVtuPRoia1s,101274
36
36
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -39,24 +39,24 @@ ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
39
39
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
40
40
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
41
41
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
42
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=0Jd-Sik8dY8KMdTsMIpedvYmgsuiyCcoL1VhT5ePQd8,34200
42
+ ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=2SiZZEhJGRLA5QgVCon0ctaIqyF9YuLaNqOCSgVvGUE,35620
43
43
  ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
44
  ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=KAjyFyEjpkghsVPskfsHD68k4Z92gRCT_q6BXfikRwE,7660
45
45
  ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py,sha256=kyx26AnT1-LySFA46wfJ9yZUKYdMWTD0U2XZfSQbuB0,3497
47
47
  ScriptCollection/TFCPS/Go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py,sha256=nwlofbDhKmFdOZ0Gt8AXqoEl8u-5qfoh9URGYbMJ9C4,1695
48
+ ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py,sha256=WcWWtCV3GkAk53RIN_6rjXNvkKZ5i5hBEMCmPQo6j30,1685
49
49
  ScriptCollection/TFCPS/Maven/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=57I7xbLtCtH-Edt1QKCSXF7wnGyAhbGMdghD_VFZIIY,13184
51
51
  ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
- ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=9XK7XnbeOnq_4siVoWovogStoKFiZLhGh3C_f2YaznI,13621
52
+ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=v1BcBzYENUssnXMA_liFOrpVmNJtqYUGB43--Q5LVu0,13653
53
53
  ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
- ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=S_9g9IliQzBBqTQquYj6gI1E3OlGfGZsxXw-mSEe-iA,1690
54
+ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
55
55
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  ScriptCollection/__pycache__/GeneralUtilities.cpython-311.pyc,sha256=iI6i3FO1gmSXHqXjPpgy79Kc1--Y1uSK5CNCEOf_g9I,110241
57
57
  ScriptCollection/__pycache__/__init__.cpython-311.pyc,sha256=eahP76xKGeVhw7p6P0oYe0ukpe_1L5fkFgXjMBuXPgQ,231
58
- scriptcollection-4.2.80.dist-info/METADATA,sha256=0xj685cVKy652WgFSCZwYFuZo9STlZQUlj-MbRJnamI,7691
59
- scriptcollection-4.2.80.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
60
- scriptcollection-4.2.80.dist-info/entry_points.txt,sha256=27XwAJEcaMEc1be0Ec1vKHCbiU4Ziu8jKL-SqsrYOIQ,4680
61
- scriptcollection-4.2.80.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
62
- scriptcollection-4.2.80.dist-info/RECORD,,
58
+ scriptcollection-4.2.81.dist-info/METADATA,sha256=E9ufHcXA-6NEm6xdDBAIkCd35mYyP3s4Qlw1dz9ZeEQ,7691
59
+ scriptcollection-4.2.81.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
60
+ scriptcollection-4.2.81.dist-info/entry_points.txt,sha256=27XwAJEcaMEc1be0Ec1vKHCbiU4Ziu8jKL-SqsrYOIQ,4680
61
+ scriptcollection-4.2.81.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
62
+ scriptcollection-4.2.81.dist-info/RECORD,,