ScriptCollection 3.5.111__py3-none-any.whl → 3.5.113__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.
@@ -631,7 +631,6 @@ def CurrentUserHasElevatedPrivileges() -> int:
631
631
 
632
632
 
633
633
  def Espoc() -> int:
634
- GeneralUtilities.write_message_to_stdout("check...")
635
634
  parser = argparse.ArgumentParser(description="Espoc (appreviation for 'exit started programs on close') is a tool to ensure the started processes of your program will also get terminated when the execution of your program is finished.")
636
635
  parser.add_argument('-p', '--processid', required=True)
637
636
  parser.add_argument('-f', '--file', required=True, help='Specifies the file where the process-ids of the started processes are stored (line by line). This file will be deleted when all started processes are terminated.')
ScriptCollection/SCLog.py CHANGED
@@ -38,6 +38,8 @@ class SCLog:
38
38
 
39
39
  if loglevel == LogLevel.Warning:
40
40
  message = f"Warning: {message}"
41
+ if loglevel == LogLevel.Debug:
42
+ message = f"Debug: {message}"
41
43
  if self.add_overhead:
42
44
  if loglevel == LogLevel.Error:
43
45
  message = f"[Error] {message}"
@@ -33,7 +33,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
33
33
  from .ProgramRunnerPopen import ProgramRunnerPopen
34
34
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
35
35
 
36
- version = "3.5.111"
36
+ version = "3.5.113"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -862,7 +862,7 @@ class TasksForCommonProjectStructure:
862
862
  if os.path.isfile(os.path.join(codeunit_folder, runsettings_file)):
863
863
  arg = f"{arg} --settings {runsettings_file}"
864
864
  arg = f"{arg} /p:CollectCoverage=true /p:CoverletOutput=../Other/Artifacts/TestCoverage/Testcoverage /p:CoverletOutputFormat=cobertura"
865
- self.__sc.run_program("dotnet", arg, codeunit_folder, verbosity=verbosity,print_live_output=True)
865
+ self.__sc.run_program("dotnet", arg, codeunit_folder, verbosity=verbosity, print_live_output=True)
866
866
  target_file = os.path.join(coverage_file_folder, "TestCoverage.xml")
867
867
  GeneralUtilities.ensure_file_does_not_exist(target_file)
868
868
  os.rename(os.path.join(coverage_file_folder, "Testcoverage.cobertura.xml"), target_file)
@@ -2422,7 +2422,7 @@ class TasksForCommonProjectStructure:
2422
2422
  GeneralUtilities.write_text_to_file(docker_compose_file, replaced)
2423
2423
 
2424
2424
  @GeneralUtilities.check_arguments
2425
- def start_dockerfile_example(self, current_file: str, verbosity: int, remove_old_container: bool, remove_volumes_folder: bool, commandline_arguments: list[str]) -> None:
2425
+ def start_dockerfile_example(self, current_file: str, verbosity: int, remove_old_container: bool, remove_volumes_folder: bool, commandline_arguments: list[str], env_file: str) -> None:
2426
2426
  verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
2427
2427
  folder = os.path.dirname(current_file)
2428
2428
  example_name = os.path.basename(folder)
@@ -2438,7 +2438,7 @@ class TasksForCommonProjectStructure:
2438
2438
  container_names.append(match.group(1))
2439
2439
  GeneralUtilities.write_message_to_stdout(f"Ensure container of {docker_compose_file} do not exist...")
2440
2440
  for container_name in container_names:
2441
- GeneralUtilities.write_message_to_stdout(f"Ensure container of {container_name} does not exist")
2441
+ GeneralUtilities.write_message_to_stdout(f"Ensure container {container_name} does not exist...")
2442
2442
  self.__sc.run_program("docker", f"container rm -f {container_name}", oci_image_artifacts_folder, verbosity=0, throw_exception_if_exitcode_is_not_zero=False)
2443
2443
  if remove_volumes_folder:
2444
2444
  volumes_folder = os.path.join(folder, "Volumes")
@@ -2449,7 +2449,21 @@ class TasksForCommonProjectStructure:
2449
2449
  self.__sc.run_program("docker", f"load -i {image_filename}", oci_image_artifacts_folder, verbosity=verbosity)
2450
2450
  docker_project_name = f"{codeunit_name}_{example_name}".lower()
2451
2451
  GeneralUtilities.write_message_to_stdout("Start docker-container...")
2452
- self.__sc.run_program("docker", f"compose --project-name {docker_project_name} up --detach", folder, verbosity=verbosity)
2452
+ argument = f"compose --project-name {docker_project_name}"
2453
+ if env_file is not None:
2454
+ argument = f"{argument} --env-file {env_file}"
2455
+ argument = f"{argument} up --detach"
2456
+ self.__sc.run_program("docker", argument, folder, verbosity=verbosity)
2457
+
2458
+ @GeneralUtilities.check_arguments
2459
+ def ensure_env_file_is_generated(self, current_file: str, env_file_name: str, env_values: dict[str, str]):
2460
+ folder = os.path.dirname(current_file)
2461
+ env_file = os.path.join(folder, env_file_name)
2462
+ if not os.path.isfile(env_file):
2463
+ lines = []
2464
+ for key, value in env_values.items():
2465
+ lines.append(f"{key}={value}")
2466
+ GeneralUtilities.write_lines_to_file(env_file, lines)
2453
2467
 
2454
2468
  @GeneralUtilities.check_arguments
2455
2469
  def stop_dockerfile_example(self, current_file: str, verbosity: int, remove_old_container: bool, remove_volumes_folder: bool, commandline_arguments: list[str]) -> None:
@@ -2553,7 +2567,7 @@ class TasksForCommonProjectStructure:
2553
2567
 
2554
2568
  @GeneralUtilities.check_arguments
2555
2569
  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, check_for_new_files: bool = True) -> None:
2556
- codeunits_list = "{"+", ".join(["a","b"])+"}"
2570
+ codeunits_list = "{"+", ".join(["a", "b"])+"}"
2557
2571
  if verbosity > 2:
2558
2572
  GeneralUtilities.write_message_to_stdout(f"Start building codeunits ({codeunits_list}) in repository '{repository_folder}'...")
2559
2573
  self.__sc.assert_is_git_repository(repository_folder)
@@ -3100,6 +3114,7 @@ class TasksForCommonProjectStructure:
3100
3114
  update_dependencies_script_filename = "UpdateDependencies.py"
3101
3115
  target_environmenttype = "QualityCheck"
3102
3116
  self.build_codeunits(repository_folder, target_environmenttype=target_environmenttype, do_git_clean_when_no_changes=True, note="Prepare dependency-update") # Required because update dependencies is not always possible for not-buildet codeunits (depends on the programming language or package manager)
3117
+ GeneralUtilities.assert_condition(not self.__sc.git_repository_has_uncommitted_changes(repository_folder), "There are uncommitted changes in the repository.")
3103
3118
 
3104
3119
  # update dependencies of resources
3105
3120
  global_scripts_folder = os.path.join(repository_folder, "Other", "Scripts")
@@ -3107,6 +3122,7 @@ class TasksForCommonProjectStructure:
3107
3122
  self.__sc.run_program("python", update_dependencies_script_filename, global_scripts_folder, print_live_output=True)
3108
3123
 
3109
3124
  # update dependencies of codeunits
3125
+ something_was_updated = False
3110
3126
  for codeunit in codeunits:
3111
3127
  codeunit_file = os.path.join(repository_folder, codeunit, f"{codeunit}.codeunit.xml")
3112
3128
  codeunit_has_updatable_dependencies = self.codeunit_has_updatable_dependencies(codeunit_file)
@@ -3116,6 +3132,7 @@ class TasksForCommonProjectStructure:
3116
3132
  GeneralUtilities.ensure_directory_exists(os.path.join(update_dependencies_script_folder, "Resources", "CodeAnalysisResult"))
3117
3133
  self.__sc.run_program("python", update_dependencies_script_filename, update_dependencies_script_folder, verbosity, print_live_output=True)
3118
3134
  if self.__sc.git_repository_has_uncommitted_changes(repository_folder):
3135
+ something_was_updated = True
3119
3136
  version_of_project = self.get_version_of_project(repository_folder)
3120
3137
  changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{version_of_project}.md")
3121
3138
  if not os.path.isfile(changelog_file):
@@ -3128,8 +3145,10 @@ class TasksForCommonProjectStructure:
3128
3145
  GeneralUtilities.write_message_to_stdout(f"Updated dependencies in codeunit {codeunit}.")
3129
3146
  else:
3130
3147
  GeneralUtilities.write_message_to_stdout(f"There are no dependencies to update in codeunit {codeunit}.")
3131
- self.build_specific_codeunits(repository_folder, [codeunit], 0, target_environmenttype, None, False, None, True, [], False, f"Build codeunit {codeunit} due to updated dependencies", False)
3132
- self.__sc.git_commit(repository_folder, "Updated dependencies")
3148
+
3149
+ if something_was_updated:
3150
+ self.build_codeunits(repository_folder, verbosity, "QualityCheck", None, False, None, False, f"Build codeunits due to updated dependencies")
3151
+ self.__sc.git_commit(repository_folder, "Updated dependencies")
3133
3152
 
3134
3153
  class GenericPrepareNewReleaseArguments:
3135
3154
  current_file: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.111
3
+ Version: 3.5.113
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
@@ -34,7 +34,7 @@ Requires-Dist: Pillow>=11.2.1
34
34
  Requires-Dist: psutil>=7.0.0
35
35
  Requires-Dist: pycdlib>=1.14.0
36
36
  Requires-Dist: Pygments>=2.19.1
37
- Requires-Dist: pylint>=3.3.6
37
+ Requires-Dist: pylint>=3.3.7
38
38
  Requires-Dist: pyOpenSSL>=25.0.0
39
39
  Requires-Dist: PyPDF>=5.4.0
40
40
  Requires-Dist: pytest>=8.3.5
@@ -0,0 +1,16 @@
1
+ ScriptCollection/CertificateUpdater.py,sha256=pJopWFcwaLAEVljtC4O3SVrlpIpoJNUhT1V4mgiqLvE,8970
2
+ ScriptCollection/Executables.py,sha256=ht-RZFu4g34Sr09b_L0c2QpKcjLWX-wFtKSMDMZYqsw,32266
3
+ ScriptCollection/GeneralUtilities.py,sha256=VO4a7xctkjN5dcBXc32gz0x9U07DEagasjvYVKqLmdM,44173
4
+ ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
5
+ ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
6
+ ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
7
+ ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
8
+ ScriptCollection/SCLog.py,sha256=5qjOBYiliyHV57GY8Y5dgUek512EVI8AzBF288R4fn4,2377
9
+ ScriptCollection/ScriptCollectionCore.py,sha256=T-vQigYR2Hegx1jdJAUmtZQNHNYHh8b5O7eN9HUto8o,130404
10
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=14bNm3n6CFJFy5exs2u7HnmhSAcxoi5rRIxGhcA1GJk,233800
11
+ ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ scriptcollection-3.5.113.dist-info/METADATA,sha256=9hTK1v1KaZuVoFoANgJeBMH4HHJKDU27S_GGbo8DKs8,7694
13
+ scriptcollection-3.5.113.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
14
+ scriptcollection-3.5.113.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
15
+ scriptcollection-3.5.113.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ scriptcollection-3.5.113.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.0)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,16 +0,0 @@
1
- ScriptCollection/CertificateUpdater.py,sha256=pJopWFcwaLAEVljtC4O3SVrlpIpoJNUhT1V4mgiqLvE,8970
2
- ScriptCollection/Executables.py,sha256=0etPIuxWj8sCmlfZbAA_gfWm1SEIj6JH9guOaeAu8tM,32323
3
- ScriptCollection/GeneralUtilities.py,sha256=VO4a7xctkjN5dcBXc32gz0x9U07DEagasjvYVKqLmdM,44173
4
- ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
5
- ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
6
- ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
7
- ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
8
- ScriptCollection/SCLog.py,sha256=Gw27Oclcb0ten7_89PD5CdNMoO-at2hGUOYbF-x1HPQ,2296
9
- ScriptCollection/ScriptCollectionCore.py,sha256=xjnY8CpNteFAsEtMY3Xo-qIsLBRSQZVGiguGt2Nj_I4,130404
10
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=5GnI89wwy8_uJH_pZtd0zgZ1C0ReIrZeePjUIwo2sus,232910
11
- ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- scriptcollection-3.5.111.dist-info/METADATA,sha256=-LRurzfB1ZIFSh09oKjTiDm6PynnxtKk0PGf5uodYGc,7694
13
- scriptcollection-3.5.111.dist-info/WHEEL,sha256=GHB6lJx2juba1wDgXDNlMTyM13ckjBMKf-OnwgKOCtA,91
14
- scriptcollection-3.5.111.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
15
- scriptcollection-3.5.111.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- scriptcollection-3.5.111.dist-info/RECORD,,