ScriptCollection 3.5.142__py3-none-any.whl → 3.5.143__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.142"
36
+ version = "3.5.143"
37
37
  __version__ = version
38
38
 
39
39
 
@@ -5,6 +5,7 @@ from pathlib import Path
5
5
  from functools import cmp_to_key
6
6
  import shutil
7
7
  import math
8
+ import tarfile
8
9
  import re
9
10
  import urllib.request
10
11
  import zipfile
@@ -22,6 +23,7 @@ from .GeneralUtilities import GeneralUtilities
22
23
  from .ScriptCollectionCore import ScriptCollectionCore
23
24
  from .SCLog import SCLog, LogLevel
24
25
  from .ProgramRunnerEpew import ProgramRunnerEpew
26
+ from .ImageUpdater import ImageUpdater, VersionEcholon
25
27
 
26
28
 
27
29
  class CreateReleaseConfiguration():
@@ -2132,6 +2134,27 @@ class TasksForCommonProjectStructure:
2132
2134
  GeneralUtilities.ensure_file_does_not_exist(yamlfile3)
2133
2135
  shutil.copyfile(yamlfile1, yamlfile3)
2134
2136
 
2137
+ @GeneralUtilities.check_arguments
2138
+ def get_latest_version_of_openapigenerator(self) -> None:
2139
+ github_api_releases_link = "https://api.github.com/repos/OpenAPITools/openapi-generator/releases"
2140
+ with urllib.request.urlopen(github_api_releases_link) as release_information_url:
2141
+ latest_release_infos = json.load(release_information_url)[0]
2142
+ latest_version = latest_release_infos["tag_name"][1:]
2143
+ return latest_version
2144
+
2145
+ @GeneralUtilities.check_arguments
2146
+ def set_version_of_openapigenerator_by_update_dependencies_file(self, update_dependencies_script_file: str, used_version: str = None) -> None:
2147
+ codeunit_folder: str = GeneralUtilities.resolve_relative_path("../..", update_dependencies_script_file)
2148
+ self.set_version_of_openapigenerator(codeunit_folder, used_version)
2149
+
2150
+ @GeneralUtilities.check_arguments
2151
+ def set_version_of_openapigenerator(self, codeunit_folder: str, used_version: str = None) -> None:
2152
+ version_file = os.path.join(codeunit_folder, "Other", "Resources", "Dependencies", "OpenAPIGenerator", "Version.txt")
2153
+ if used_version is None:
2154
+ used_version = self.get_latest_version_of_openapigenerator()
2155
+ GeneralUtilities.ensure_file_exists(version_file)
2156
+ GeneralUtilities.write_text_to_file(version_file, used_version)
2157
+
2135
2158
  @GeneralUtilities.check_arguments
2136
2159
  def ensure_openapigenerator_is_available(self, codeunit_folder: str) -> None:
2137
2160
  self.assert_is_codeunit_folder(codeunit_folder)
@@ -2141,14 +2164,12 @@ class TasksForCommonProjectStructure:
2141
2164
  jar_file = f"{openapigenerator_folder}/{filename}"
2142
2165
  jar_file_exists = os.path.isfile(jar_file)
2143
2166
  if internet_connection_is_available: # Load/Update
2144
- github_api_releases_link = "https://api.github.com/repos/OpenAPITools/openapi-generator/releases"
2145
- with urllib.request.urlopen(github_api_releases_link) as release_information_url:
2146
- latest_release_infos = json.load(release_information_url)[0]
2147
- latest_version = latest_release_infos["tag_name"][1:]
2148
- download_link = f"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/{latest_version}/openapi-generator-cli-{latest_version}.jar"
2149
- GeneralUtilities.ensure_directory_does_not_exist(openapigenerator_folder)
2150
- GeneralUtilities.ensure_directory_exists(openapigenerator_folder)
2151
- urllib.request.urlretrieve(download_link, jar_file)
2167
+ version_file = os.path.join(codeunit_folder, "Other", "Resources", "Dependencies", "OpenAPIGenerator", "Version.txt")
2168
+ used_version = GeneralUtilities.read_text_from_file(version_file)
2169
+ download_link = f"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/{used_version}/openapi-generator-cli-{used_version}.jar"
2170
+ GeneralUtilities.ensure_directory_does_not_exist(openapigenerator_folder)
2171
+ GeneralUtilities.ensure_directory_exists(openapigenerator_folder)
2172
+ urllib.request.urlretrieve(download_link, jar_file)
2152
2173
  else:
2153
2174
  if jar_file_exists:
2154
2175
  GeneralUtilities.write_message_to_stdout("Warning: Can not check for updates of OpenAPIGenerator due to missing internet-connection.")
@@ -2796,6 +2817,30 @@ class TasksForCommonProjectStructure:
2796
2817
  def ensure_androidappbundletool_is_available(self, target_folder: str) -> None:
2797
2818
  self.ensure_file_from_github_assets_is_available_with_retry(target_folder, "google", "bundletool", "AndroidAppBundleTool", "bundletool.jar", lambda latest_version: f"bundletool-all-{latest_version}.jar")
2798
2819
 
2820
+ @GeneralUtilities.check_arguments
2821
+ def ensure_mediamtx_is_available(self, target_folder: str) -> None:
2822
+ def download_and_extract(osname: str, osname_in_github_asset: str, extension: str):
2823
+ resource_name: str = f"MediaMTX_{osname}"
2824
+ zip_filename: str = f"{resource_name}.{extension}"
2825
+ self.ensure_file_from_github_assets_is_available_with_retry(target_folder, "bluenviron", "mediamtx", resource_name, zip_filename, lambda latest_version: f"mediamtx_{latest_version}_{osname_in_github_asset}_amd64.{extension}")
2826
+ resource_folder: str = os.path.join(target_folder, "Other", "Resources", resource_name)
2827
+ target_folder_extracted = os.path.join(resource_folder, "MediaMTX")
2828
+ local_zip_file: str = os.path.join(resource_folder, f"{resource_name}.{extension}")
2829
+ GeneralUtilities.ensure_folder_exists_and_is_empty(target_folder_extracted)
2830
+ if extension == "zip":
2831
+ with zipfile.ZipFile(local_zip_file, 'r') as zip_ref:
2832
+ zip_ref.extractall(target_folder_extracted)
2833
+ elif extension == "tar.gz":
2834
+ with tarfile.open(local_zip_file, "r:gz") as tar:
2835
+ tar.extractall(path=target_folder_extracted)
2836
+ else:
2837
+ raise ValueError(f"Unknown extension: \"{extension}\"")
2838
+ GeneralUtilities.ensure_file_does_not_exist(local_zip_file)
2839
+
2840
+ download_and_extract("Windows", "windows", "zip")
2841
+ download_and_extract("Linux", "linux", "tar.gz")
2842
+ download_and_extract("MacOS", "darwin", "tar.gz")
2843
+
2799
2844
  @GeneralUtilities.check_arguments
2800
2845
  def ensure_cyclonedxcli_is_available(self, target_folder: str) -> None:
2801
2846
  local_filename = "cyclonedx-cli"
@@ -3381,3 +3426,12 @@ class TasksForCommonProjectStructure:
3381
3426
 
3382
3427
  - Updated geo-ip-database.
3383
3428
  """)
3429
+
3430
+ @GeneralUtilities.check_arguments
3431
+ def update_images_in_example(self, codeunit_folder: str):
3432
+ iu = ImageUpdater()
3433
+ iu.add_default_mapper()
3434
+ dockercomposefile: str = f"{codeunit_folder}\\Other\\Reference\\ReferenceContent\\Examples\\MinimalDockerComposeFile\\docker-compose.yml"
3435
+ excluded = ["opendms"]
3436
+ iu.update_all_services_in_docker_compose_file(dockercomposefile, VersionEcholon.LatestPatchOrLatestMinor, excluded)
3437
+ iu.check_for_newest_version(dockercomposefile, excluded)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.142
3
+ Version: 3.5.143
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
@@ -24,11 +24,11 @@ Requires-Python: >=3.10
24
24
  Description-Content-Type: text/markdown
25
25
  Requires-Dist: build>=1.2.2.post1
26
26
  Requires-Dist: coverage>=7.9.1
27
- Requires-Dist: cyclonedx-bom>=6.1.1
27
+ Requires-Dist: cyclonedx-bom>=6.1.2
28
28
  Requires-Dist: defusedxml>=0.7.1
29
29
  Requires-Dist: keyboard>=0.13.5
30
30
  Requires-Dist: lcov-cobertura>=2.1.1
31
- Requires-Dist: lxml>=5.4.0
31
+ Requires-Dist: lxml>=6.0.0
32
32
  Requires-Dist: ntplib>=0.4.0
33
33
  Requires-Dist: Pillow>=11.2.1
34
34
  Requires-Dist: psutil>=7.0.0
@@ -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=Dd2P8vH2PA830wAv6bchlMHHdGE_7At-F4WQY5w4XdA,4016
10
- ScriptCollection/ScriptCollectionCore.py,sha256=RN10QzaK5EYJ7vw2BHlWxc_1GqBM8sPLCdaSMQQiNCA,136482
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=zBrrzssSXrBptgRaj4R_aA5-t_jEncHcjmR2EoYTqzU,237126
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=pWtZZsQbcjvCTsVEnx19Wr2Az_ClRUv8c1auPLVG5gM,136482
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=AP-hy9fvAZsXvd90r9fhG1wNAL248Rbh7KkmdKg8eJg,240506
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.142.dist-info/METADATA,sha256=VXRsnflOOEDstkfXPdrZJtVFVRaSA33zxSboT_AiOEE,7694
14
- scriptcollection-3.5.142.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- scriptcollection-3.5.142.dist-info/entry_points.txt,sha256=AvmVO9iyWImExpvzL3YYQ9AOEiUIN9guPRRG_W_VNWY,4116
16
- scriptcollection-3.5.142.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.142.dist-info/RECORD,,
13
+ scriptcollection-3.5.143.dist-info/METADATA,sha256=_LIGGGBWhdvyi-HunxH_73o-n4Y0sqBTZTs_s4oT0fQ,7694
14
+ scriptcollection-3.5.143.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ scriptcollection-3.5.143.dist-info/entry_points.txt,sha256=AvmVO9iyWImExpvzL3YYQ9AOEiUIN9guPRRG_W_VNWY,4116
16
+ scriptcollection-3.5.143.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.143.dist-info/RECORD,,