ScriptCollection 3.5.125__py3-none-any.whl → 3.5.127__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.
@@ -33,7 +33,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
33
33
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
34
34
  from .SCLog import SCLog, LogLevel
35
35
 
36
- version = "3.5.125"
36
+ version = "3.5.127"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -1543,7 +1543,11 @@ class ScriptCollectionCore:
1543
1543
  reading_stdout_last_time_resulted_in_exception = False
1544
1544
  if print_live_output:
1545
1545
  # print(out_line, end='\n', file=sys.stdout, flush=False)
1546
- log.log(out_line, LogLevel.Information)
1546
+ loglevel = LogLevel.Information
1547
+ if out_line.startswith("Debug: "):
1548
+ loglevel = LogLevel.Debug
1549
+ out_line = out_line[len("Debug: "):]
1550
+ log.log(out_line, loglevel)
1547
1551
  # if print_live_output:
1548
1552
  # sys.stdout.flush()
1549
1553
  except Empty:
@@ -1558,7 +1562,13 @@ class ScriptCollectionCore:
1558
1562
  reading_stderr_last_time_resulted_in_exception = False
1559
1563
  if print_live_output:
1560
1564
  # print(err_line, end='\n', file=sys.stdout if print_errors_as_information else sys.stderr, flush=False)
1561
- log.log(err_line, LogLevel.Error if print_errors_as_information else LogLevel.Information)
1565
+ loglevel = LogLevel.Error
1566
+ if out_line.startswith("Warning: "):
1567
+ loglevel = LogLevel.Warning
1568
+ out_line = out_line[len("Warning: "):]
1569
+ if print_errors_as_information: # "errors" in "print_errors_as_information" means: all what is written to std-err
1570
+ loglevel = LogLevel.Information
1571
+ log.log(err_line, loglevel)
1562
1572
  # if print_live_output:
1563
1573
  # if print_errors_as_information:
1564
1574
  # sys.stdout.flush()
@@ -1423,7 +1423,7 @@ class TasksForCommonProjectStructure:
1423
1423
  self.__sc.format_xml_file(sbom_folder+f"/{codeunitname}.{codeunitversion}.sbom.xml")
1424
1424
 
1425
1425
  @GeneralUtilities.check_arguments
1426
- def push_docker_build_artifact(self, push_artifacts_file: str, registry: str, verbosity: int, push_readme: bool, commandline_arguments: list[str], repository_folder_name: str,image_name:str=None) -> None:
1426
+ def push_docker_build_artifact(self, push_artifacts_file: str, registry: str, verbosity: int, push_readme: bool, commandline_arguments: list[str], repository_folder_name: str, image_name: str = None) -> None:
1427
1427
  folder_of_this_file = os.path.dirname(push_artifacts_file)
1428
1428
  filename = os.path.basename(push_artifacts_file)
1429
1429
  codeunitname_regex: str = "([a-zA-Z0-9]+)"
@@ -1443,7 +1443,7 @@ class TasksForCommonProjectStructure:
1443
1443
  codeunit_version = self.get_version_of_codeunit(os.path.join(codeunit_folder, f"{codeunitname}.codeunit.xml"))
1444
1444
  if image_name is None:
1445
1445
  image_name = codeunitname
1446
- image_name=image_name.lower()
1446
+ image_name = image_name.lower()
1447
1447
  repo = f"{registry}/{image_name}"
1448
1448
  image_latest = f"{repo}:latest"
1449
1449
  image_version = f"{repo}:{codeunit_version}"
@@ -3110,6 +3110,17 @@ class TasksForCommonProjectStructure:
3110
3110
  # TODO validate artifactsinformation_file against xsd
3111
3111
  GeneralUtilities.write_message_to_stdout(f"Finished building codeunit {codeunit_name} without errors.")
3112
3112
 
3113
+ def __add_changelog_file(self, repository_folder: str, version_of_project: str):
3114
+ changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{version_of_project}.md")
3115
+ if not os.path.isfile(changelog_file):
3116
+ GeneralUtilities.ensure_file_exists(changelog_file)
3117
+ GeneralUtilities.write_text_to_file(changelog_file, """# Release notes
3118
+
3119
+ ## Changes
3120
+
3121
+ - Updated dependencies.
3122
+ """)
3123
+
3113
3124
  @GeneralUtilities.check_arguments
3114
3125
  def generic_update_dependencies(self, repository_folder: str, verbosity: int = 1):
3115
3126
  # Prepare
@@ -3118,42 +3129,35 @@ class TasksForCommonProjectStructure:
3118
3129
  codeunits = self.get_codeunits(repository_folder)
3119
3130
  update_dependencies_script_filename = "UpdateDependencies.py"
3120
3131
  target_environmenttype = "QualityCheck"
3132
+ project_name: str = os.path.basename(repository_folder)
3133
+ GeneralUtilities.assert_condition(not self.__sc.git_repository_has_uncommitted_changes(repository_folder), "There are uncommitted changes in the repository.")
3121
3134
 
3122
3135
  # update dependencies of resources
3123
3136
  global_scripts_folder = os.path.join(repository_folder, "Other", "Scripts")
3124
3137
  if os.path.isfile(os.path.join(global_scripts_folder, update_dependencies_script_filename)):
3125
3138
  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)
3126
- GeneralUtilities.assert_condition(not self.__sc.git_repository_has_uncommitted_changes(repository_folder), "There are uncommitted changes in the repository.")
3127
3139
  self.__sc.run_program("python", update_dependencies_script_filename, global_scripts_folder, print_live_output=True)
3140
+ version_of_project = self.get_version_of_project(repository_folder)
3141
+ self.__add_changelog_file(repository_folder, version_of_project)
3142
+ GeneralUtilities.write_message_to_stdout(f"Updated global dependencies of {project_name}.")
3143
+ self.build_codeunits(repository_folder, verbosity, "QualityCheck", None, False, None, [], False, "Build codeunits due to updated dependencies")
3128
3144
 
3129
- # update dependencies of codeunits
3130
- something_was_updated = False
3131
- for codeunit in codeunits:
3132
- codeunit_file = os.path.join(repository_folder, codeunit, f"{codeunit}.codeunit.xml")
3133
- codeunit_has_updatable_dependencies = self.codeunit_has_updatable_dependencies(codeunit_file)
3134
- if codeunit_has_updatable_dependencies:
3135
- codeunit_folder = os.path.join(repository_folder, codeunit)
3136
- update_dependencies_script_folder = os.path.join(codeunit_folder, "Other")
3137
- GeneralUtilities.ensure_directory_exists(os.path.join(update_dependencies_script_folder, "Resources", "CodeAnalysisResult"))
3138
- self.__sc.run_program("python", update_dependencies_script_filename, update_dependencies_script_folder, verbosity, print_live_output=True)
3139
- if self.__sc.git_repository_has_uncommitted_changes(repository_folder):
3140
- something_was_updated = True
3141
- version_of_project = self.get_version_of_project(repository_folder)
3142
- changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{version_of_project}.md")
3143
- if not os.path.isfile(changelog_file):
3144
- GeneralUtilities.write_text_to_file(changelog_file, """# Release notes
3145
-
3146
- ## Changes
3147
-
3148
- - Updated dependencies.
3149
- """)
3150
- GeneralUtilities.write_message_to_stdout(f"Updated dependencies in codeunit {codeunit}.")
3151
- else:
3152
- GeneralUtilities.write_message_to_stdout(f"There are no dependencies to update in codeunit {codeunit}.")
3153
-
3154
- if something_was_updated:
3155
- self.build_codeunits(repository_folder, verbosity, "QualityCheck", None, False, None, [], False, f"Build codeunits due to updated dependencies")
3156
- self.__sc.git_commit(repository_folder, "Updated dependencies")
3145
+ # update dependencies of codeunits
3146
+ for codeunit in codeunits:
3147
+ codeunit_file = os.path.join(repository_folder, codeunit, f"{codeunit}.codeunit.xml")
3148
+ codeunit_has_updatable_dependencies = self.codeunit_has_updatable_dependencies(codeunit_file)
3149
+ if codeunit_has_updatable_dependencies:
3150
+ codeunit_folder = os.path.join(repository_folder, codeunit)
3151
+ update_dependencies_script_folder = os.path.join(codeunit_folder, "Other")
3152
+ GeneralUtilities.ensure_directory_exists(os.path.join(update_dependencies_script_folder, "Resources", "CodeAnalysisResult"))
3153
+ self.__sc.run_program("python", update_dependencies_script_filename, update_dependencies_script_folder, verbosity, print_live_output=True)
3154
+ if self.__sc.git_repository_has_uncommitted_changes(repository_folder):
3155
+ version_of_project = self.get_version_of_project(repository_folder)
3156
+ self.__add_changelog_file(repository_folder, version_of_project)
3157
+ GeneralUtilities.write_message_to_stdout(f"Updated dependencies in codeunit {codeunit}.")
3158
+ self.build_codeunits(repository_folder, verbosity, "QualityCheck", None, False, None, [], False, "Build codeunits due to updated dependencies")
3159
+
3160
+ self.__sc.git_commit(repository_folder, "Updated dependencies")
3157
3161
 
3158
3162
  class GenericPrepareNewReleaseArguments:
3159
3163
  current_file: str
@@ -3195,8 +3199,11 @@ class TasksForCommonProjectStructure:
3195
3199
  self.__sc.git_commit(build_repository_folder, "Updated submodules")
3196
3200
 
3197
3201
  if "--dependencyupdate" in generic_prepare_new_release_arguments.commandline_arguments:
3202
+ GeneralUtilities.write_message_to_stdout("Debug: Update dependencies...")
3198
3203
  self.generic_update_dependencies(repository_folder)
3199
3204
  self.assert_no_uncommitted_changes(repository_folder)
3205
+ else:
3206
+ GeneralUtilities.write_message_to_stdout("Debug: Dependency-update skipped.")
3200
3207
 
3201
3208
  GeneralUtilities.write_message_to_stdout(f"Check reference-repository...")
3202
3209
  now = datetime.now()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.125
3
+ Version: 3.5.127
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
@@ -7,11 +7,11 @@ ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4b
7
7
  ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
8
8
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
9
9
  ScriptCollection/SCLog.py,sha256=2oWISBU4RhAWBPtsM_nPWiOJ6UZEY1T4O9iXtjhRZ24,3685
10
- ScriptCollection/ScriptCollectionCore.py,sha256=xH-pJ0DFOy8ibXQiyduDBGnjIhfiZPbiOqF5RTQjrrg,127849
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=4aEuIf89jbgKE4uMYm4DlPDe9Iu1Zujo8wPOzDld09w,234867
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=CFsuljhoVFonD1hi0mV2K1xemYY5v1DUcKM_P1R5_sc,128521
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=R3jy7P_LcqiY1vGruZW6VYupaNlWKXtBFE5pVGRVC4Y,235370
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.125.dist-info/METADATA,sha256=zO67ZgggA-XAv_JgNChnCtvTUM_x8CwaXVlgCXSLIGE,7694
14
- scriptcollection-3.5.125.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
- scriptcollection-3.5.125.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
16
- scriptcollection-3.5.125.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.125.dist-info/RECORD,,
13
+ scriptcollection-3.5.127.dist-info/METADATA,sha256=K8nyMjZzOUUQf8WRxFQTCy1pcPvz4MFsNRgx-lEWTvA,7694
14
+ scriptcollection-3.5.127.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
+ scriptcollection-3.5.127.dist-info/entry_points.txt,sha256=3qMbfZEMhc_VTJj-bcLwB8AWcn9iXSB3l0AWpuu52Bs,3689
16
+ scriptcollection-3.5.127.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.127.dist-info/RECORD,,