ScriptCollection 3.5.68__py3-none-any.whl → 3.5.69__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.
@@ -32,7 +32,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
32
32
  from .ProgramRunnerPopen import ProgramRunnerPopen
33
33
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
34
34
 
35
- version = "3.5.68"
35
+ version = "3.5.69"
36
36
  __version__ = version
37
37
 
38
38
 
@@ -618,8 +618,21 @@ class ScriptCollectionCore:
618
618
  for renamed_item, original_name in renamed_items.items():
619
619
  os.rename(renamed_item, original_name)
620
620
 
621
+ @GeneralUtilities.check_arguments
622
+ def is_git_repository(self, folder: str) -> bool:
623
+ """This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
624
+ combined = f"{folder}/.git"
625
+ # TODO consider check for bare-repositories
626
+ return self.is_folder(combined) or self.is_file(combined)
627
+
628
+ @GeneralUtilities.check_arguments
629
+ def assert_is_git_repository(self, folder: str) -> str:
630
+ """This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
631
+ GeneralUtilities.assert_condition(self.is_git_repository(folder), f"'{folder}' is not a git-repository.")
632
+
621
633
  @GeneralUtilities.check_arguments
622
634
  def list_content(self, path: str,include_files:bool,include_folder:bool) -> list[str]:
635
+ """This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
623
636
  if self.program_runner.will_be_executed_locally():
624
637
  result=[]
625
638
  if include_files:
@@ -645,6 +658,7 @@ class ScriptCollectionCore:
645
658
 
646
659
  @GeneralUtilities.check_arguments
647
660
  def is_file(self, path: str) -> bool:
661
+ """This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
648
662
  if self.program_runner.will_be_executed_locally():
649
663
  return os.path.isfile(path) # works only locally, but much more performant than always running an external program
650
664
  else:
@@ -659,6 +673,7 @@ class ScriptCollectionCore:
659
673
 
660
674
  @GeneralUtilities.check_arguments
661
675
  def is_folder(self, path: str) -> bool:
676
+ """This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
662
677
  if self.program_runner.will_be_executed_locally(): # works only locally, but much more performant than always running an external program
663
678
  return os.path.isdir(path)
664
679
  else:
@@ -672,14 +687,22 @@ class ScriptCollectionCore:
672
687
  raise ValueError(f"Fatal error occurrs while checking whether folder '{path}' exists. StdErr: '{stderr}'")
673
688
 
674
689
  @GeneralUtilities.check_arguments
675
- def is_git_repository(self, folder: str) -> bool:
676
- combined = f"{folder}/.git"
677
- # TODO consider check for bare-repositories
678
- return self.is_file(combined) or self.is_folder(combined)
679
-
680
- @GeneralUtilities.check_arguments
681
- def assert_is_git_repository(self, folder: str) -> str:
682
- GeneralUtilities.assert_condition(self.is_git_repository(folder), f"'{folder}' is not a git-repository.")
690
+ def remove(self, path: str) ->None:
691
+ """This function works platform-independent also for non-local-executions if the ScriptCollection commandline-commands are available as global command on the target-system."""
692
+ if self.program_runner.will_be_executed_locally(): # works only locally, but much more performant than always running an external program
693
+ if os.path.isdir(path):
694
+ GeneralUtilities.ensure_directory_does_not_exist(path)
695
+ if os.path.isfile(path):
696
+ GeneralUtilities.ensure_file_does_not_exist(path)
697
+ else:
698
+ if self.is_file(path):
699
+ exit_code, _, stderr, _ = self.run_program_argsasarray("scremovefile", ["--path", path], throw_exception_if_exitcode_is_not_zero=False) # works platform-indepent
700
+ if exit_code != 0:
701
+ raise ValueError(f"Fatal error occurrs while removing file '{path}'. StdErr: '{stderr}'")
702
+ if self.is_folder(path):
703
+ exit_code, _, stderr, _ = self.run_program_argsasarray("scremovefolder", ["--path", path], throw_exception_if_exitcode_is_not_zero=False) # works platform-indepent
704
+ if exit_code != 0:
705
+ raise ValueError(f"Fatal error occurrs while removing folder '{path}'. StdErr: '{stderr}'")
683
706
 
684
707
  @GeneralUtilities.check_arguments
685
708
  def __sort_fmd(self, line: str):
@@ -1302,7 +1302,9 @@ class TasksForCommonProjectStructure:
1302
1302
  # hint: arguments can be overwritten by commandline_arguments
1303
1303
  folder_of_this_file = os.path.dirname(create_release_file)
1304
1304
  verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
1305
- self.__sc.run_program("python", f"CreateRelease.py --overwrite_verbosity {str(verbosity)}", folder_of_this_file, verbosity=verbosity, log_file=logfile, addLogOverhead=addLogOverhead)
1305
+ result=self.__sc.run_program("python", f"CreateRelease.py --overwrite_verbosity {str(verbosity)}", folder_of_this_file, verbosity=verbosity, log_file=logfile, addLogOverhead=addLogOverhead,print_live_output=True,throw_exception_if_exitcode_is_not_zero=False)
1306
+ if result[0]!=0:
1307
+ raise ValueError(f"CreateRelease.py resulted in exitcode {result[0]}.")
1306
1308
 
1307
1309
  @GeneralUtilities.check_arguments
1308
1310
  def __standardized_tasks_merge_to_stable_branch(self, information: MergeToStableBranchInformationForProjectInCommonProjectFormat) -> str:
@@ -2438,7 +2440,7 @@ class TasksForCommonProjectStructure:
2438
2440
  self.__sc.assert_is_git_repository(repository_folder)
2439
2441
  repository_folder = GeneralUtilities.resolve_relative_path_from_current_working_directory(repository_folder)
2440
2442
  codeunits = self.get_codeunits(repository_folder, False)
2441
- self.build_specific_codeunits(repository_folder, codeunits, verbosity, target_environmenttype, additional_arguments_file, is_pre_merge, export_target_directory, False, commandline_arguments, do_git_clean_when_no_changes)
2443
+ self.build_specific_codeunits(repository_folder, codeunits, verbosity, target_environmenttype, additional_arguments_file, is_pre_merge, export_target_directory, False, commandline_arguments, do_git_clean_when_no_changes,note)
2442
2444
 
2443
2445
  @GeneralUtilities.check_arguments
2444
2446
  def build_specific_codeunits(self, repository_folder: str, codeunits: list[str], verbosity: int = 1, target_environmenttype: str = "QualityCheck", additional_arguments_file: str = None, is_pre_merge: bool = False, export_target_directory: str = None, assume_dependent_codeunits_are_already_built: bool = True, commandline_arguments: list[str] = [], do_git_clean_when_no_changes: bool = False, note: str = None) -> None:
@@ -2463,7 +2465,9 @@ class TasksForCommonProjectStructure:
2463
2465
  prepare_build_codeunits_scripts = os.path.join(project_resources_folder, PrepareBuildCodeunits_script_name)
2464
2466
  if os.path.isfile(prepare_build_codeunits_scripts):
2465
2467
  GeneralUtilities.write_message_to_stdout(f'Run "{PrepareBuildCodeunits_script_name}"')
2466
- self.__sc.run_program("python", f"{PrepareBuildCodeunits_script_name}", project_resources_folder, print_live_output=1 < verbosity)
2468
+ result=self.__sc.run_program("python", f"{PrepareBuildCodeunits_script_name}", project_resources_folder,throw_exception_if_exitcode_is_not_zero=False, print_live_output=True)
2469
+ if result[0]!=0:
2470
+ raise ValueError(f"PrepareBuildCodeunits.py resulted in exitcode {result[0]}.")
2467
2471
 
2468
2472
  for subfolder in subfolders:
2469
2473
  codeunit_name: str = os.path.basename(subfolder)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ScriptCollection
3
- Version: 3.5.68
3
+ Version: 3.5.69
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
@@ -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=Zbc-oWrgLEqz6dB2M0EJORG_9eU1byGaziHI2iFZUSo,114066
9
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=F6e045gUvSxpOcHk61OVnlod_Zn9JSNXrv6I2SzWoVc,214997
8
+ ScriptCollection/ScriptCollectionCore.py,sha256=qrFos1Od9o4paGQwKAKbeFZd72CwMbctYwVr2PI5SqU,116344
9
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=MtbaO3Sgew-cSSapf5XJ_7-ui2w3QGYwpvacX-l2K_w,215356
10
10
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
11
11
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- ScriptCollection-3.5.68.dist-info/METADATA,sha256=z55DUNqZEXZqXwh3pBsCcb5Ha8fy_XXkZa9SwB2tsh0,7664
13
- ScriptCollection-3.5.68.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
- ScriptCollection-3.5.68.dist-info/entry_points.txt,sha256=psYFu5te0W8zF5k444Qi21IZN4UwwGbw-XR22nvKTYE,3545
15
- ScriptCollection-3.5.68.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- ScriptCollection-3.5.68.dist-info/RECORD,,
12
+ ScriptCollection-3.5.69.dist-info/METADATA,sha256=K88GUkBl1Hf3WB0WQ67vdgCEzR4Pn6z3wkkPd5uH0eA,7664
13
+ ScriptCollection-3.5.69.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
14
+ ScriptCollection-3.5.69.dist-info/entry_points.txt,sha256=psYFu5te0W8zF5k444Qi21IZN4UwwGbw-XR22nvKTYE,3545
15
+ ScriptCollection-3.5.69.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ ScriptCollection-3.5.69.dist-info/RECORD,,