ScriptCollection 3.5.99__py3-none-any.whl → 3.5.101__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.
@@ -952,6 +952,7 @@ class GeneralUtilities:
952
952
  @staticmethod
953
953
  @check_arguments
954
954
  def replace_variable_in_string(input_string: str, variable_name: str, variable_value: str) -> None:
955
+ GeneralUtilities.assert_condition(not "__" in variable_name, f"'{variable_name}' is an invalid variable name because it contains '__' which is treated as control-sequence.")
955
956
  return input_string.replace(f"__[{variable_name}]__", variable_value)
956
957
 
957
958
  @staticmethod
@@ -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.99"
36
+ version = "3.5.101"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -2286,10 +2286,10 @@ class TasksForCommonProjectStructure:
2286
2286
  build_folder = os.path.join(codeunit_folder, "Other", "Build")
2287
2287
  self.__sc.run_program("python", "Build.py", build_folder, verbosity)
2288
2288
 
2289
- csproj_file = os.path.join(codeunit_folder, codeunit_name, f"{codeunit_name}.csproj")
2290
- self.__sc.update_dependencies_of_dotnet_project(csproj_file, verbosity, ignored_dependencies)
2291
2289
  test_csproj_file = os.path.join(codeunit_folder, f"{codeunit_name}Tests", f"{codeunit_name}Tests.csproj")
2292
2290
  self.__sc.update_dependencies_of_dotnet_project(test_csproj_file, verbosity, ignored_dependencies)
2291
+ csproj_file = os.path.join(codeunit_folder, codeunit_name, f"{codeunit_name}.csproj")
2292
+ self.__sc.update_dependencies_of_dotnet_project(csproj_file, verbosity, ignored_dependencies)
2293
2293
 
2294
2294
  @GeneralUtilities.check_arguments
2295
2295
  def update_dependencies_of_typical_node_codeunit(self, update_script_file: str, verbosity: int, cmd_args: list[str]) -> None:
@@ -2886,9 +2886,28 @@ class TasksForCommonProjectStructure:
2886
2886
  shutil.make_archive(name_of_new_artifact, 'zip', src_artifact_folder)
2887
2887
  archive_file = os.path.join(os.getcwd(), f"{name_of_new_artifact}.zip")
2888
2888
  target_folder = GeneralUtilities.resolve_relative_path(f"Other/Artifacts/{name_of_new_artifact}", codeunit_folder)
2889
- GeneralUtilities.ensure_directory_exists(target_folder)
2889
+ GeneralUtilities.ensure_folder_exists_and_is_empty(target_folder)
2890
2890
  shutil.move(archive_file, target_folder)
2891
2891
 
2892
+ def generate_winget_zip_manifest(self, codeunit_folder: str, artifact_name_of_zip: str):
2893
+ self.assert_is_codeunit_folder(codeunit_folder)
2894
+ codeunit_version = self.get_version_of_codeunit_folder(codeunit_folder)
2895
+ build_folder = os.path.join(codeunit_folder, "Other", "Build")
2896
+ artifacts_folder = os.path.join(codeunit_folder, "Other", "Artifacts", artifact_name_of_zip)
2897
+ GeneralUtilities.assert_folder_exists(artifacts_folder)
2898
+ artifacts_file = ScriptCollectionCore().find_file_by_extension(artifacts_folder, "zip")
2899
+ winget_template_file = os.path.join(build_folder, "WinGet-Template.yaml")
2900
+ winget_manifest_file = os.path.join(build_folder, "WinGet-Manifest.yaml")
2901
+ GeneralUtilities.assert_file_exists(winget_template_file)
2902
+ GeneralUtilities.ensure_file_exists(winget_manifest_file)
2903
+ manifest_content = GeneralUtilities.read_text_from_file(winget_template_file)
2904
+ manifest_content = GeneralUtilities.replace_variable_in_string(manifest_content, "version", codeunit_version)
2905
+ manifest_content = GeneralUtilities.replace_variable_in_string(manifest_content, "sha256_hashvalue", GeneralUtilities.get_sha256_of_file(artifacts_file))
2906
+ GeneralUtilities.write_text_to_file(winget_manifest_file, manifest_content)
2907
+ target_folder = os.path.join(codeunit_folder, "Other", "Artifacts", "WinGet-Manifest")
2908
+ GeneralUtilities.ensure_folder_exists_and_is_empty(target_folder)
2909
+ shutil.copy(winget_manifest_file, target_folder)
2910
+
2892
2911
  @GeneralUtilities.check_arguments
2893
2912
  def update_year_in_license_file_in_common_scripts_file(self, common_tasks_scripts_file: str) -> None:
2894
2913
  self.update_year_in_license_file(GeneralUtilities.resolve_relative_path("../../..", common_tasks_scripts_file))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ScriptCollection
3
- Version: 3.5.99
3
+ Version: 3.5.101
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.12
26
+ Requires-Dist: coverage>=7.7.0
27
27
  Requires-Dist: cyclonedx-bom>=5.3.0
28
28
  Requires-Dist: defusedxml>=0.7.1
29
29
  Requires-Dist: keyboard>=0.13.5
@@ -1,17 +1,17 @@
1
1
  ScriptCollection/Executables.py,sha256=HI9Pxs5Z9QxPGyqeJU2lWslEggFyGYANCqYVQZp6eJ0,30490
2
- ScriptCollection/GeneralUtilities.py,sha256=q0ikIwmhklCFsaaj9YGPGdrNonibuRmWofvbwOtlxdM,42246
2
+ ScriptCollection/GeneralUtilities.py,sha256=unOZbHDqlxwPHXY1epy4gdGYwDbHEETF1XKZYPGX2hw,42429
3
3
  ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
4
4
  ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4bQNM6RV6Y,2480
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
8
  ScriptCollection/SCLog.py,sha256=l4aekBiGoNkKGtvO_Er3NY_K7ts4ZWtIGlhq07I-4LY,30
9
- ScriptCollection/ScriptCollectionCore.py,sha256=MMI2hq9f3ngB0Q3qq_qmNe-fr171PbjEgTfSJnZn7qQ,123983
10
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=eyISK2aLZRDhWdBn3NQnHN2NDb0N9_eMn9QoalsMZJw,228697
9
+ ScriptCollection/ScriptCollectionCore.py,sha256=yE-keH79iYM7q6VsMvIcCbRt1H77L6yP_yMhcBkdCYE,123984
10
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=FzcMzTiQFYnEcJ-2YVq4GpToJtrc_XGP2d84XlWu8eQ,230241
11
11
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
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,,
13
+ scriptcollection-3.5.101.dist-info/METADATA,sha256=dO-SsS0ZuDt64A3GPkq02PSPxKv8A2bCYo_lMpF7tp0,7664
14
+ scriptcollection-3.5.101.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
15
+ scriptcollection-3.5.101.dist-info/entry_points.txt,sha256=fYCGWGNGijBQHhFe6UAO-BEpfEOxLyNJemukt5ElSzs,3644
16
+ scriptcollection-3.5.101.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.101.dist-info/RECORD,,