ScriptCollection 3.5.62__py3-none-any.whl → 3.5.64__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.
@@ -31,7 +31,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
31
31
  from .ProgramRunnerPopen import ProgramRunnerPopen
32
32
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
33
33
 
34
- version = "3.5.62"
34
+ version = "3.5.64"
35
35
  __version__ = version
36
36
 
37
37
 
@@ -1326,12 +1326,7 @@ class ScriptCollectionCore:
1326
1326
  return (stdout_result, stderr_result)
1327
1327
 
1328
1328
  @GeneralUtilities.check_arguments
1329
- def run_program_argsasarray(self, program: str, arguments_as_array: list[str] = [], working_directory: str = None, verbosity: int = 1, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, throw_exception_if_exitcode_is_not_zero: bool = True, custom_argument: object = None, interactive: bool = False) -> tuple[int, str, str, int]:
1330
- # Return-values program_runner: Exitcode, StdOut, StdErr, Pid
1331
- # verbosity 1: No output will be logged.
1332
- # verbosity 2: If the exitcode of the executed program is not 0 then the StdErr will be logged. This is supposed to be the default verbosity-level.
1333
- # verbosity 3: Logs and prints StdOut and StdErr of the executed program in realtime.
1334
- # verbosity 4: Same as loglevel 3 but with some more overhead-information.
1329
+ def run_program_argsasarray(self, program: str, arguments_as_array: list[str] = [], working_directory: str = None, verbosity: int = 0, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, throw_exception_if_exitcode_is_not_zero: bool = True, custom_argument: object = None, interactive: bool = False, print_live_output: bool = False) -> tuple[int, str, str, int]:
1335
1330
  if self.call_program_runner_directly:
1336
1331
  return self.program_runner.run_program_argsasarray(program, arguments_as_array, working_directory, custom_argument, interactive)
1337
1332
  try:
@@ -1353,11 +1348,10 @@ class ScriptCollectionCore:
1353
1348
  else:
1354
1349
  info_for_log = title
1355
1350
 
1356
- if verbosity >= 3:
1351
+ verbose = verbosity > 2
1352
+ if verbose:
1357
1353
  GeneralUtilities.write_message_to_stdout(f"Run '{info_for_log}'.")
1358
1354
 
1359
- print_live_output = 1 < verbosity
1360
-
1361
1355
  exit_code: int = None
1362
1356
  stdout: str = ""
1363
1357
  stderr: str = ""
@@ -1413,11 +1407,16 @@ class ScriptCollectionCore:
1413
1407
  GeneralUtilities.append_line_to_file(log_file, err_line)
1414
1408
 
1415
1409
  exit_code = process.returncode
1410
+ GeneralUtilities.assert_condition(exit_code is not None, f"Exitcode of program-run of '{info_for_log}' is None.")
1411
+
1412
+ result_message = f"Program '{info_for_log}' resulted in exitcode {exit_code}."
1413
+
1414
+ if verbose:
1415
+ GeneralUtilities.write_message_to_stdout(result_message)
1416
1416
 
1417
1417
  if throw_exception_if_exitcode_is_not_zero and exit_code != 0:
1418
- raise ValueError(f"Program '{working_directory}>{program} {arguments_for_log_as_string}' resulted in exitcode {exit_code}. (StdOut: '{stdout}', StdErr: '{stderr}')")
1418
+ raise ValueError(f"{result_message} (StdOut: '{stdout}', StdErr: '{stderr}')")
1419
1419
 
1420
- GeneralUtilities.assert_condition(exit_code is not None, f"Exitcode of program-run of '{info_for_log}' is None.")
1421
1420
  result = (exit_code, stdout, stderr, pid)
1422
1421
  return result
1423
1422
  except Exception as e:
@@ -1425,10 +1424,10 @@ class ScriptCollectionCore:
1425
1424
 
1426
1425
  # Return-values program_runner: Exitcode, StdOut, StdErr, Pid
1427
1426
  @GeneralUtilities.check_arguments
1428
- def run_program(self, program: str, arguments: str = "", working_directory: str = None, verbosity: int = 1, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, throw_exception_if_exitcode_is_not_zero: bool = True, custom_argument: object = None, interactive: bool = False) -> tuple[int, str, str, int]:
1427
+ def run_program(self, program: str, arguments: str = "", working_directory: str = None, verbosity: int = 1, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, throw_exception_if_exitcode_is_not_zero: bool = True, custom_argument: object = None, interactive: bool = False, print_live_output: bool = False) -> tuple[int, str, str, int]:
1429
1428
  if self.call_program_runner_directly:
1430
1429
  return self.program_runner.run_program(program, arguments, working_directory, custom_argument, interactive)
1431
- return self.run_program_argsasarray(program, GeneralUtilities.arguments_to_array(arguments), working_directory, verbosity, print_errors_as_information, log_file, timeoutInSeconds, addLogOverhead, title, log_namespace, arguments_for_log, throw_exception_if_exitcode_is_not_zero, custom_argument, interactive)
1430
+ return self.run_program_argsasarray(program, GeneralUtilities.arguments_to_array(arguments), working_directory, verbosity, print_errors_as_information, log_file, timeoutInSeconds, addLogOverhead, title, log_namespace, arguments_for_log, throw_exception_if_exitcode_is_not_zero, custom_argument, interactive, print_live_output)
1432
1431
 
1433
1432
  # Return-values program_runner: Pid
1434
1433
  @GeneralUtilities.check_arguments
@@ -2457,7 +2457,7 @@ class TasksForCommonProjectStructure:
2457
2457
  prepare_build_codeunits_scripts = os.path.join(project_resources_folder, PrepareBuildCodeunits_script_name)
2458
2458
  if os.path.isfile(prepare_build_codeunits_scripts):
2459
2459
  GeneralUtilities.write_message_to_stdout(f'Run "{PrepareBuildCodeunits_script_name}"')
2460
- self.__sc.run_program("python", f"{PrepareBuildCodeunits_script_name}", project_resources_folder)
2460
+ self.__sc.run_program("python", f"{PrepareBuildCodeunits_script_name}", project_resources_folder,print_live_output=1<verbosity)
2461
2461
 
2462
2462
  for subfolder in subfolders:
2463
2463
  codeunit_name: str = os.path.basename(subfolder)
@@ -2809,11 +2809,11 @@ class TasksForCommonProjectStructure:
2809
2809
  c_additionalargumentsfile_argument = f' --overwrite_additionalargumentsfile "{additional_arguments_file}"'
2810
2810
 
2811
2811
  GeneralUtilities.write_message_to_stdout('Run "CommonTasks.py"...')
2812
- self.__sc.run_program("python", f"CommonTasks.py{additional_arguments_c}{general_argument}{c_additionalargumentsfile_argument}", other_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True)
2812
+ self.__sc.run_program("python", f"CommonTasks.py{additional_arguments_c}{general_argument}{c_additionalargumentsfile_argument}", other_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True,print_live_output=1<verbosity)
2813
2813
  self.verify_artifact_exists(codeunit_folder, dict[str, bool]({"Changelog": False, "License": True, "DiffReport": True}))
2814
2814
 
2815
2815
  GeneralUtilities.write_message_to_stdout('Run "Build.py"...')
2816
- self.__sc.run_program("python", f"Build.py{additional_arguments_b}{general_argument}", build_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True)
2816
+ self.__sc.run_program("python", f"Build.py{additional_arguments_b}{general_argument}", build_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True,print_live_output=1<verbosity)
2817
2817
 
2818
2818
  artifacts = {"BuildResult_.+": True, "BOM": False, "SourceCode": True}
2819
2819
  if self.codeunit_has_testable_sourcecode(codeunit_file):
@@ -2823,20 +2823,20 @@ class TasksForCommonProjectStructure:
2823
2823
  codeunit_hast_testable_sourcecode = self.codeunit_has_testable_sourcecode(codeunit_file)
2824
2824
  if codeunit_hast_testable_sourcecode:
2825
2825
  GeneralUtilities.write_message_to_stdout('Run "RunTestcases.py"...')
2826
- self.__sc.run_program("python", f"RunTestcases.py{additional_arguments_r}{general_argument}", quality_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True)
2826
+ self.__sc.run_program("python", f"RunTestcases.py{additional_arguments_r}{general_argument}", quality_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True,print_live_output=1<verbosity)
2827
2827
  self.verify_artifact_exists(codeunit_folder, dict[str, bool]({"TestCoverage": True, "TestCoverageReport": False}))
2828
2828
 
2829
2829
  GeneralUtilities.write_message_to_stdout('Run "Linting.py"...')
2830
- self.__sc.run_program("python", f"Linting.py{additional_arguments_l}{general_argument}", quality_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True)
2830
+ self.__sc.run_program("python", f"Linting.py{additional_arguments_l}{general_argument}", quality_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True,print_live_output=1<verbosity)
2831
2831
  self.verify_artifact_exists(codeunit_folder, dict[str, bool]())
2832
2832
 
2833
2833
  GeneralUtilities.write_message_to_stdout('Run "GenerateReference.py"...')
2834
- self.__sc.run_program("python", f"GenerateReference.py{additional_arguments_g}{general_argument}", reference_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True)
2834
+ self.__sc.run_program("python", f"GenerateReference.py{additional_arguments_g}{general_argument}", reference_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True,print_live_output=1<verbosity)
2835
2835
  self.verify_artifact_exists(codeunit_folder, dict[str, bool]({"Reference": True}))
2836
2836
 
2837
2837
  if os.path.isfile(os.path.join(other_folder, "OnBuildingFinished.py")):
2838
2838
  GeneralUtilities.write_message_to_stdout('Run "OnBuildingFinished.py"...')
2839
- self.__sc.run_program("python", f"OnBuildingFinished.py{additional_arguments_f}{general_argument}", other_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True)
2839
+ self.__sc.run_program("python", f"OnBuildingFinished.py{additional_arguments_f}{general_argument}", other_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=True,print_live_output=1<verbosity)
2840
2840
 
2841
2841
  artifactsinformation_file = os.path.join(artifacts_folder, f"{codeunit_name}.artifactsinformation.xml")
2842
2842
  codeunit_version = self.get_version_of_codeunit(codeunit_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ScriptCollection
3
- Version: 3.5.62
3
+ Version: 3.5.64
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.2.2.post1
26
- Requires-Dist: coverage>=7.6.11
26
+ Requires-Dist: coverage>=7.6.12
27
27
  Requires-Dist: cyclonedx-bom>=5.1.2
28
28
  Requires-Dist: defusedxml>=0.7.1
29
29
  Requires-Dist: keyboard>=0.13.5
@@ -5,12 +5,12 @@ ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4b
5
5
  ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
6
6
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
7
7
  ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
8
- ScriptCollection/ScriptCollectionCore.py,sha256=TN3Crb86-lU9YrHV9XFDUUNtX3KhT0Gq9WHyjt2XeKI,111409
9
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=B3-KSAZOR_UKSeLsdAxyZu2ylsRSjDvlj0272TXSEfA,213090
8
+ ScriptCollection/ScriptCollectionCore.py,sha256=9ya2ztbPuuQxQEk4FOqhA7XL-Cwh7osTjEN0GPKHpDM,111127
9
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=byU3N2MdcVCScm2DGuRLFuIomjFL8cjOI7k1sBVVCX8,213300
10
10
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
11
11
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- ScriptCollection-3.5.62.dist-info/METADATA,sha256=zPOBDBekOQ2rDLHvgehw8cB3gWbJUeSWIZbCdZehZJE,7664
13
- ScriptCollection-3.5.62.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
- ScriptCollection-3.5.62.dist-info/entry_points.txt,sha256=wspYVXWH8kon-wRQTAFEO11JoLJ0fEnOIG7tE7R-xtQ,3502
15
- ScriptCollection-3.5.62.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- ScriptCollection-3.5.62.dist-info/RECORD,,
12
+ ScriptCollection-3.5.64.dist-info/METADATA,sha256=8d92Y7ZmlIECWchsTA4hSaU5dqjlw8ffQSE6Pl5QHIo,7664
13
+ ScriptCollection-3.5.64.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
+ ScriptCollection-3.5.64.dist-info/entry_points.txt,sha256=wspYVXWH8kon-wRQTAFEO11JoLJ0fEnOIG7tE7R-xtQ,3502
15
+ ScriptCollection-3.5.64.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ ScriptCollection-3.5.64.dist-info/RECORD,,