ScriptCollection 3.5.97__py3-none-any.whl → 3.5.99__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 .ProgramRunnerBase import ProgramRunnerBase
33
33
  from .ProgramRunnerPopen import ProgramRunnerPopen
34
34
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
35
35
 
36
- version = "3.5.97"
36
+ version = "3.5.99"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -875,6 +875,10 @@ class TasksForCommonProjectStructure:
875
875
  content = re.sub("filename=\"([^\"]+)\"", lambda match: self.__standardized_tasks_run_testcases_for_dotnet_project_helper(source_base_path_in_coverage_file, codeunit_folder, match), content)
876
876
  GeneralUtilities.write_text_to_file(target_file, content)
877
877
  self.run_testcases_common_post_task(repository_folder, codeunit_name, verbosity, generate_badges, targetenvironmenttype, commandline_arguments)
878
+ artifacts_folder = os.path.join(repository_folder, codeunit_name, "Other", "Artifacts")
879
+ for subfolder in GeneralUtilities.get_direct_folders_of_folder(artifacts_folder):
880
+ if os.path.basename(subfolder).startswith("BuildResultTests_DotNet_"):
881
+ GeneralUtilities.ensure_directory_does_not_exist(subfolder)
878
882
 
879
883
  @GeneralUtilities.check_arguments
880
884
  def run_testcases_common_post_task(self, repository_folder: str, codeunit_name: str, verbosity: int, generate_badges: bool, targetenvironmenttype: str, commandline_arguments: list[str]) -> None:
@@ -1486,7 +1490,7 @@ class TasksForCommonProjectStructure:
1486
1490
  @GeneralUtilities.check_arguments
1487
1491
  def standardized_tasks_do_common_tasks(self, common_tasks_scripts_file: str, codeunit_version: str, verbosity: int, targetenvironmenttype: str, clear_artifacts_folder: bool, additional_arguments_file: str, assume_dependent_codeunits_are_already_built: bool, commandline_arguments: list[str]) -> None:
1488
1492
  additional_arguments_file = self.get_additionalargumentsfile_from_commandline_arguments(commandline_arguments, additional_arguments_file)
1489
- target_environmenttype = self.get_targetenvironmenttype_from_commandline_arguments(commandline_arguments, targetenvironmenttype)#pylint: disable=unused-variable
1493
+ target_environmenttype = self.get_targetenvironmenttype_from_commandline_arguments(commandline_arguments, targetenvironmenttype) # pylint: disable=unused-variable
1490
1494
  # assume_dependent_codeunits_are_already_built = self.get_assume_dependent_codeunits_are_already_built_from_commandline_arguments(commandline_arguments, assume_dependent_codeunits_are_already_built)
1491
1495
  if commandline_arguments is None:
1492
1496
  raise ValueError('The "commandline_arguments"-parameter is not defined.')
@@ -2227,7 +2231,7 @@ class TasksForCommonProjectStructure:
2227
2231
  shutil.copytree(artifacts_folder, target_folder)
2228
2232
 
2229
2233
  @GeneralUtilities.check_arguments
2230
- def add_github_release(self, productname: str, projectversion: str, build_artifacts_folder: str, github_username: str, repository_folder: str, commandline_arguments: list[str]) -> None:
2234
+ def add_github_release(self, productname: str, projectversion: str, build_artifacts_folder: str, github_username: str, repository_folder: str, commandline_arguments: list[str], additional_attached_files: list[str]) -> None:
2231
2235
  self.__sc.assert_is_git_repository(repository_folder)
2232
2236
  GeneralUtilities.write_message_to_stdout(f"Create GitHub-release for {productname}...")
2233
2237
  verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, 1)
@@ -2236,6 +2240,9 @@ class TasksForCommonProjectStructure:
2236
2240
  codeunits = self.get_codeunits(repository_folder)
2237
2241
  for codeunit in codeunits:
2238
2242
  artifact_files.append(self.__sc.find_file_by_extension(f"{build_artifacts_folder}\\{productname}\\{projectversion}\\{codeunit}", "Productive.Artifacts.zip"))
2243
+ if additional_attached_files is not None:
2244
+ for additional_attached_file in additional_attached_files:
2245
+ artifact_files.append(additional_attached_file)
2239
2246
  changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{projectversion}.md")
2240
2247
  self.__sc.run_program_argsasarray("gh", ["release", "create", f"v{projectversion}", "--repo", github_repo, "--notes-file", changelog_file, "--title", f"Release v{projectversion}"]+artifact_files, verbosity=verbosity)
2241
2248
 
@@ -2517,7 +2524,7 @@ class TasksForCommonProjectStructure:
2517
2524
  project_resources_folder = os.path.join(repository_folder, "Other", "Scripts")
2518
2525
  PrepareBuildCodeunits_script_name = "PrepareBuildCodeunits.py"
2519
2526
  prepare_build_codeunits_scripts = os.path.join(project_resources_folder, PrepareBuildCodeunits_script_name)
2520
-
2527
+
2521
2528
  if do_git_clean_when_no_changes:
2522
2529
  self.__sc.run_program("git", "clean -dfx", repository_folder)
2523
2530
  if os.path.isfile(prepare_build_codeunits_scripts):
@@ -2742,9 +2749,9 @@ class TasksForCommonProjectStructure:
2742
2749
  self.ensure_file_from_github_assets_is_available_with_retry(target_folder, "CycloneDX", "cyclonedx-cli", "CycloneDXCLI", local_filename, lambda latest_version: filename_on_github)
2743
2750
 
2744
2751
  @GeneralUtilities.check_arguments
2745
- def ensure_file_from_github_assets_is_available_with_retry(self, target_folder: str, githubuser: str, githubprojectname: str, resource_name: str, local_filename: str, get_filename_on_github,amount_of_attempts:int=5) -> None:
2752
+ def ensure_file_from_github_assets_is_available_with_retry(self, target_folder: str, githubuser: str, githubprojectname: str, resource_name: str, local_filename: str, get_filename_on_github, amount_of_attempts: int = 5) -> None:
2746
2753
  GeneralUtilities.retry_action(lambda: self.ensure_file_from_github_assets_is_available(target_folder, githubuser, githubprojectname, resource_name, local_filename, get_filename_on_github), amount_of_attempts)
2747
-
2754
+
2748
2755
  @GeneralUtilities.check_arguments
2749
2756
  def ensure_file_from_github_assets_is_available(self, target_folder: str, githubuser: str, githubprojectname: str, resource_name: str, local_filename: str, get_filename_on_github) -> None:
2750
2757
  resource_folder = os.path.join(target_folder, "Other", "Resources", resource_name)
@@ -2871,6 +2878,17 @@ class TasksForCommonProjectStructure:
2871
2878
  control_file_content = self.load_deb_control_file_content(control_file, codeunit_name, self.get_version_of_codeunit_folder(codeunit_folder), installedsize, maintainername, maintaineremail, description)
2872
2879
  self.__sc.create_deb_package(codeunit_name, binary_folder, control_file_content, deb_output_folder, verbosity, 555)
2873
2880
 
2881
+ @GeneralUtilities.check_arguments
2882
+ def create_zip_file_for_artifact(self, codeunit_folder: str, artifact_source_name: str, name_of_new_artifact: str, verbosity: int, cmd_arguments: list[str]) -> None:
2883
+ self.assert_is_codeunit_folder(codeunit_folder)
2884
+ verbosity = self.get_verbosity_from_commandline_arguments(cmd_arguments, verbosity)
2885
+ src_artifact_folder = GeneralUtilities.resolve_relative_path(f"Other/Artifacts/{artifact_source_name}", codeunit_folder)
2886
+ shutil.make_archive(name_of_new_artifact, 'zip', src_artifact_folder)
2887
+ archive_file = os.path.join(os.getcwd(), f"{name_of_new_artifact}.zip")
2888
+ target_folder = GeneralUtilities.resolve_relative_path(f"Other/Artifacts/{name_of_new_artifact}", codeunit_folder)
2889
+ GeneralUtilities.ensure_directory_exists(target_folder)
2890
+ shutil.move(archive_file, target_folder)
2891
+
2874
2892
  @GeneralUtilities.check_arguments
2875
2893
  def update_year_in_license_file_in_common_scripts_file(self, common_tasks_scripts_file: str) -> None:
2876
2894
  self.update_year_in_license_file(GeneralUtilities.resolve_relative_path("../../..", common_tasks_scripts_file))
@@ -3062,7 +3080,6 @@ class TasksForCommonProjectStructure:
3062
3080
  update_dependencies_script_folder = os.path.join(codeunit_folder, "Other")
3063
3081
  GeneralUtilities.ensure_directory_exists(os.path.join(update_dependencies_script_folder, "Resources", "CodeAnalysisResult"))
3064
3082
  self.__sc.run_program("python", update_dependencies_script_filename, update_dependencies_script_folder, verbosity, print_live_output=True)
3065
- self.build_specific_codeunits(repository_folder, [codeunit], 0, target_environmenttype, None, False, None, True, [], False, "Build due to updated dependencies", False)
3066
3083
  if self.__sc.git_repository_has_uncommitted_changes(repository_folder):
3067
3084
  version_of_project = self.get_version_of_project(repository_folder)
3068
3085
  changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{version_of_project}.md")
@@ -3076,7 +3093,7 @@ class TasksForCommonProjectStructure:
3076
3093
  GeneralUtilities.write_message_to_stdout(f"Updated dependencies in codeunit {codeunit}.")
3077
3094
  else:
3078
3095
  GeneralUtilities.write_message_to_stdout(f"There are no dependencies to update in codeunit {codeunit}.")
3079
- self.build_codeunits(repository_folder, target_environmenttype="QualityCheck", do_git_clean_when_no_changes=True, note="Check if product is buildable after dependency-update")
3096
+ self.build_specific_codeunits(repository_folder, [codeunit], 0, target_environmenttype, None, False, None, True, [], False, f"Build codeunit {codeunit} due to updated dependencies", False)
3080
3097
  self.__sc.git_commit(repository_folder, "Updated dependencies")
3081
3098
 
3082
3099
  class GenericPrepareNewReleaseArguments:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ScriptCollection
3
- Version: 3.5.97
3
+ Version: 3.5.99
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
@@ -6,12 +6,12 @@ ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1
6
6
  ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
7
7
  ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
8
8
  ScriptCollection/SCLog.py,sha256=l4aekBiGoNkKGtvO_Er3NY_K7ts4ZWtIGlhq07I-4LY,30
9
- ScriptCollection/ScriptCollectionCore.py,sha256=by7RgObb1zbzjFVTFV_Sqwm-r7jNUDKk7QP946RrWPo,123983
10
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=sOhSXZYziEdqdsEcPmP1r7WBkhujriDAHP9vJJYflmM,227414
9
+ ScriptCollection/ScriptCollectionCore.py,sha256=MMI2hq9f3ngB0Q3qq_qmNe-fr171PbjEgTfSJnZn7qQ,123983
10
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=eyISK2aLZRDhWdBn3NQnHN2NDb0N9_eMn9QoalsMZJw,228697
11
11
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.97.dist-info/METADATA,sha256=zSfLVXJxOZM3FuwT_nYgsZKQUg8aNU_Lt7-zi20HAOU,7664
14
- scriptcollection-3.5.97.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
15
- scriptcollection-3.5.97.dist-info/entry_points.txt,sha256=fYCGWGNGijBQHhFe6UAO-BEpfEOxLyNJemukt5ElSzs,3644
16
- scriptcollection-3.5.97.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.97.dist-info/RECORD,,
13
+ scriptcollection-3.5.99.dist-info/METADATA,sha256=dr6d328OTfDsRq5sqhHLaHwlkvLxS9lr7-1THPvuVas,7664
14
+ scriptcollection-3.5.99.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
15
+ scriptcollection-3.5.99.dist-info/entry_points.txt,sha256=fYCGWGNGijBQHhFe6UAO-BEpfEOxLyNJemukt5ElSzs,3644
16
+ scriptcollection-3.5.99.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.99.dist-info/RECORD,,