ScriptCollection 4.4.58__py3-none-any.whl → 4.4.60__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.
@@ -40,7 +40,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
40
40
  from .ProgramRunnerPopen import ProgramRunnerPopen
41
41
  from .SCLog import SCLog, LogLevel
42
42
 
43
- version = "4.4.58"
43
+ version = "4.4.60"
44
44
  __version__ = version
45
45
 
46
46
  class VSCodeWorkspaceShellTask:
@@ -888,7 +888,7 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
888
888
  the caller turns into an empty version-list and therefore into the misleading error "Version-list can not be empty"
889
889
  for a dependency whose registry actually offers usable versions."""
890
890
  three_part_versions = [version for version in versions if re.match(r"^\d+\.\d+\.\d+$", version)]
891
- return sorted(three_part_versions, key=lambda version: Version(version), reverse=True)
891
+ return sorted(three_part_versions, key=Version, reverse=True)
892
892
 
893
893
  @GeneralUtilities.check_arguments
894
894
  def update_dependencies_with_specific_echolon(self, echolon: VersionEcholon) -> None:
@@ -12,7 +12,7 @@ from lxml import etree
12
12
  from ..GeneralUtilities import GeneralUtilities, VersionEcholon
13
13
  from ..ScriptCollectionCore import ScriptCollectionCore
14
14
  from ..SCLog import LogLevel
15
- from .TFCPS_Tools_General import TFCPS_Tools_General
15
+ from .TFCPS_Tools_General import TFCPS_Tools_General, CommonProjectStructureVersion
16
16
  from .TFCPS_RemoteBuild import TFCPS_RemoteBuild, RunnerOperatingSystem
17
17
 
18
18
 
@@ -30,7 +30,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
30
30
  _protected_sc:ScriptCollectionCore = None
31
31
  __is_pre_merge:bool=False
32
32
  __validate_developers_of_repository:bool=True#TODO must be settable to false
33
- codeunit_namespace:str="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure"
33
+ codeunit_namespace:str= TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)
34
34
 
35
35
  def __init__(self,current_file:str,verbosity:LogLevel,target_envionment_type:str,use_cache:bool,is_pre_merge:bool):
36
36
  self.__verbosity=verbosity
@@ -141,7 +141,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
141
141
  GeneralUtilities.assert_condition(len(codeunit_files_in_folder) == 1, f'The codeunit-folder "{codeunit_folder}" must contain exactly one codeunit-file (matching "*{codeunit_filename_suffix}") but contains {len(codeunit_files_in_folder)}.')
142
142
  codeunit_name_in_codeunit_filename = codeunit_files_in_folder[0][:-len(codeunit_filename_suffix)]
143
143
  GeneralUtilities.assert_condition(codeunit_name_in_codeunit_filename == codeunit_name, f'The codeunit-file "{codeunit_files_in_folder[0]}" must be named "{codeunit_name}{codeunit_filename_suffix}" to match its folder-name ("{codeunit_name}").')
144
- supported_codeunitspecificationversion = "3.0.0" # should always be the latest version of the ProjectTemplates-repository
144
+ supported_codeunitspecificationversion = CommonProjectStructureVersion # should always be the latest version of the ProjectTemplates-repository
145
145
  codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}{codeunit_filename_suffix}")
146
146
  if not os.path.isfile(codeunit_file):
147
147
  raise ValueError(f'Codeunitfile "{codeunit_file}" does not exist.')
@@ -401,7 +401,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
401
401
  product_information_file = os.path.join(self.get_repository_folder(), ".ScriptCollection", "ProductInformation.xml")
402
402
  GeneralUtilities.assert_file_exists(product_information_file)
403
403
  root: etree._ElementTree = etree.parse(product_information_file)
404
- return str(root.xpath(f'/cps:productinformation/cps:{property_name}/text()', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0])
404
+ return str(root.xpath(f'/cps:productinformation/cps:{property_name}/text()', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0])
405
405
 
406
406
  @GeneralUtilities.check_arguments
407
407
  def get_current_folder(self)->str:
@@ -562,7 +562,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
562
562
  @GeneralUtilities.check_arguments
563
563
  def get_testcoverage_threshold_from_codeunit_file(self):
564
564
  root: etree._ElementTree = etree.parse(self.get_codeunit_file())
565
- return float(str(root.xpath('//cps:properties/cps:testsettings/@minimalcodecoverageinpercent', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0]))
565
+ return float(str(root.xpath('//cps:properties/cps:testsettings/@minimalcodecoverageinpercent', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0]))
566
566
 
567
567
 
568
568
  @GeneralUtilities.check_arguments
@@ -3,7 +3,7 @@ import re
3
3
  from ..GeneralUtilities import GeneralUtilities
4
4
  from ..ScriptCollectionCore import ScriptCollectionCore
5
5
  from ..SCLog import LogLevel
6
- from .TFCPS_Tools_General import TFCPS_Tools_General
6
+ from .TFCPS_Tools_General import TFCPS_Tools_General, CommonProjectStructureVersion
7
7
 
8
8
 
9
9
  class TFCPS_CodeUnit_BuildCodeUnit:
@@ -106,8 +106,8 @@ class TFCPS_CodeUnit_BuildCodeUnit:
106
106
  commit_id = self.sc.git_get_commit_id(self.repository_folder) # the actual commit-id (not the branch-name) which was checked-out while building this codeunit
107
107
  # TODO implement usage of reference_latest_version_of_xsd_when_generating_xml
108
108
  GeneralUtilities.write_text_to_file(artifactsinformation_file, f"""<?xml version="1.0" encoding="UTF-8" ?>
109
- <cps:artifactsinformation xmlns:cps="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure" artifactsinformationspecificationversion="1.0.0"
110
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/main/Conventions/RepositoryStructure/CommonProjectStructure/artifactsinformation.xsd">
109
+ <cps:artifactsinformation xmlns:cps="{TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)}" artifactsinformationspecificationversion="1.0.0"
110
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="{TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)} {TFCPS_Tools_General.get_common_project_structure_xsd_base_url(CommonProjectStructureVersion)}/artifactsinformation.xsd">
111
111
  <cps:name>{self.codeunit_name}</cps:name>
112
112
  <cps:version>{codeunit_version}</cps:version>
113
113
  <cps:timestamp>{moment}</cps:timestamp>
@@ -11,7 +11,7 @@ from .TFCPS_BuildCodeUnitsHook import TFCPS_BuildCodeUnitsHook
11
11
  from .TFCPS_CodeUnit_BuildCodeUnit import TFCPS_CodeUnit_BuildCodeUnit
12
12
  from .TFCPS_CodeSpellCheck import TFCPS_CodeSpellCheck
13
13
  from .TFCPS_OCIImageSecretScan import TFCPS_OCIImageSecretScan
14
- from .TFCPS_Tools_General import TFCPS_Tools_General
14
+ from .TFCPS_Tools_General import TFCPS_Tools_General, CommonProjectStructureVersion
15
15
 
16
16
 
17
17
  class TFCPS_UpdateDependenciesHook(TFCPS_BuildCodeUnitsHook):
@@ -158,7 +158,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
158
158
  self.__run_custom_pre_codeunit_build_script()
159
159
 
160
160
  try:
161
- xmlschema.validate(product_information_file, "https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/main/Conventions/RepositoryStructure/CommonProjectStructure/productinformation.xsd")
161
+ xmlschema.validate(product_information_file, f"{TFCPS_Tools_General.get_common_project_structure_xsd_base_url(CommonProjectStructureVersion)}/productinformation.xsd")
162
162
  except Exception as exception:
163
163
  self.sc.log.log_exception(f"'{product_information_file}' could not be validated against the XSD:", exception, LogLevel.Warning)
164
164
 
@@ -25,6 +25,13 @@ from ..OCIImages.OCIImageManager import OCIImageManager
25
25
  from .PackageSource import PackageSource
26
26
  from .PlantUMLRenderer import PlantUMLRenderer
27
27
 
28
+ # Central definition of the common-project-structure-version. This is the single place which has to be updated to bump the
29
+ # whole repository (and all common-project-structure-files which are generated or validated by ScriptCollection) to a new
30
+ # common-project-structure-version. Both the namespace and the xsd-base-url are derived from this version (see
31
+ # TFCPS_Tools_General.get_common_project_structure_namespace and TFCPS_Tools_General.get_common_project_structure_xsd_base_url).
32
+ CommonProjectStructureVersion: str = "3.0.4"
33
+ SupportedCommonProjectStructureVersions: list[str] = ["3.0.4"]
34
+
28
35
  class TFCPS_Tools_General:
29
36
 
30
37
  __sc:ScriptCollectionCore=None
@@ -37,6 +44,16 @@ class TFCPS_Tools_General:
37
44
  # own version in '<repo>/Other/Resources/Dependencies/JRE/Version.txt'. The file contains a build like "21.0.6+7".
38
45
  __jre_version_resource_relative_path:str="Dependencies/JRE/Version.txt"
39
46
 
47
+ @staticmethod
48
+ @GeneralUtilities.check_arguments
49
+ def get_common_project_structure_namespace(common_project_structure_version: str) -> str:
50
+ return f"https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/v{common_project_structure_version}/Conventions/RepositoryStructure/CommonProjectStructure"
51
+
52
+ @staticmethod
53
+ @GeneralUtilities.check_arguments
54
+ def get_common_project_structure_xsd_base_url(common_project_structure_version: str) -> str:
55
+ return f"https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/v{common_project_structure_version}/Conventions/RepositoryStructure/CommonProjectStructure"
56
+
40
57
  def __init__(self,sc:ScriptCollectionCore):
41
58
  self.__sc=sc
42
59
  self.oci_image_manager=OCIImageManager(self.__sc)
@@ -45,7 +62,7 @@ class TFCPS_Tools_General:
45
62
  @GeneralUtilities.check_arguments
46
63
  def codeunit_is_enabled(self, codeunit_file: str) -> bool:
47
64
  root: etree._ElementTree = etree.parse(codeunit_file)
48
- return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:codeunit/@enabled', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0]))
65
+ return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:codeunit/@enabled', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0]))
49
66
 
50
67
  @GeneralUtilities.check_arguments
51
68
  def ensure_cyclonedxcli_is_available(self,enforce_update:bool) -> str:
@@ -178,12 +195,7 @@ class TFCPS_Tools_General:
178
195
  version_to_download = pinned_version
179
196
  self.__sc.log.log(f"Using pinned version '{version_to_download}' for {local_resource_name}.", LogLevel.Debug)
180
197
  else:
181
- url = f"https://api.github.com/repos/{githubuser}/{githubprojectname}/releases/latest"
182
- self.__sc.log.log(f"Download \"{url}\"...", LogLevel.Debug)
183
- time.sleep(2)
184
- response = requests.get(url, headers=headers, allow_redirects=True, timeout=(10, 10))
185
- response_json=response.json()
186
- version_to_download = response_json["tag_name"]
198
+ version_to_download = self.get_tag_of_latest_github_release(githubuser, githubprojectname)
187
199
  filename_on_github = get_filename_on_github(version_to_download)
188
200
  link = f"https://github.com/{githubuser}/{githubprojectname}/releases/download/{version_to_download}/{filename_on_github}"
189
201
  time.sleep(2)
@@ -212,6 +224,19 @@ class TFCPS_Tools_General:
212
224
  GeneralUtilities.assert_file_exists(file)
213
225
  return file
214
226
 
227
+ @GeneralUtilities.check_arguments
228
+ def get_tag_of_latest_github_release(self, githubuser: str, githubprojectname: str) -> str:
229
+ """Returns the tag-name (for example "v1.2.3") of the latest release of the given GitHub-repository."""
230
+ headers = { 'User-Agent': 'Mozilla/5.0'}
231
+ self.__add_github_api_key_if_available(headers)
232
+ url = f"https://api.github.com/repos/{githubuser}/{githubprojectname}/releases/latest"
233
+ self.__sc.log.log(f"Download \"{url}\"...", LogLevel.Debug)
234
+ time.sleep(2)
235
+ response = requests.get(url, headers=headers, allow_redirects=True, timeout=(10, 10))
236
+ response.raise_for_status()
237
+ response_json=response.json()
238
+ return response_json["tag_name"]
239
+
215
240
  def __add_github_api_key_if_available(self, headers: dict):
216
241
  token = os.getenv("GITHUB_TOKEN")
217
242
  if token is not None:
@@ -286,7 +311,7 @@ class TFCPS_Tools_General:
286
311
  @GeneralUtilities.check_arguments
287
312
  def get_dependent_code_units(self, codeunit_file: str) -> list[str]:
288
313
  root: etree._ElementTree = etree.parse(codeunit_file)
289
- result = set(root.xpath('//cps:dependentcodeunit/text()', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'}))
314
+ result = set(root.xpath('//cps:dependentcodeunit/text()', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)}))
290
315
  result = sorted(result)
291
316
  return result
292
317
 
@@ -393,7 +418,7 @@ class TFCPS_Tools_General:
393
418
  versiononlyregex = f"^{versionregex}$"
394
419
  if re.match(versiononlyregex, current_version) is None:
395
420
  raise ValueError(f"Version '{current_version}' does not match version-regex '{versiononlyregex}'.")
396
- namespace = 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'
421
+ namespace = TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)
397
422
  #the namespace is registered as default-namespace, otherwise every tag of the file would be written with an invented prefix ("ns0:version") instead of the form the file uses.
398
423
  ET.register_namespace("", namespace)
399
424
  tree: ET.ElementTree = ET.parse(codeunit_file)
@@ -469,11 +494,11 @@ class TFCPS_Tools_General:
469
494
  def get_version_of_codeunit(self,codeunit_file:str) -> None:
470
495
  codeunit_file_content:str=GeneralUtilities.read_text_from_file(codeunit_file)
471
496
  return self.get_version_of_codeunit_filecontent(codeunit_file_content)
472
-
497
+
473
498
  @GeneralUtilities.check_arguments
474
499
  def get_version_of_codeunit_filecontent(self,file_content:str) -> None:
475
500
  root: etree._ElementTree = etree.fromstring(file_content.encode("utf-8"))
476
- result = str(root.xpath('//cps:version/text()', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0])
501
+ result = str(root.xpath('//cps:version/text()', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0])
477
502
  return result
478
503
 
479
504
  @GeneralUtilities.check_arguments
@@ -486,14 +511,14 @@ class TFCPS_Tools_General:
486
511
  @GeneralUtilities.check_arguments
487
512
  def get_codeunit_description(self,codeunit_file:str) -> bool:
488
513
  root: etree._ElementTree = etree.parse(codeunit_file)
489
- return str(root.xpath('//cps:properties/@description', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0])
514
+ return str(root.xpath('//cps:properties/@description', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0])
490
515
 
491
516
  @GeneralUtilities.check_arguments
492
517
  def get_product_name(self, repository_folder: str) -> str:
493
518
  product_information_file = os.path.join(repository_folder, ".ScriptCollection", "ProductInformation.xml")
494
519
  GeneralUtilities.assert_file_exists(product_information_file)
495
520
  root: etree._ElementTree = etree.parse(product_information_file)
496
- return str(root.xpath('/cps:productinformation/cps:producttitle/text()', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0])
521
+ return str(root.xpath('/cps:productinformation/cps:producttitle/text()', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0])
497
522
 
498
523
  @GeneralUtilities.check_arguments
499
524
  def get_required_environment_variable_names(self, repository: str) -> list[str]:
@@ -510,7 +535,7 @@ class TFCPS_Tools_General:
510
535
  product_information_file = os.path.join(repository, ".ScriptCollection", "ProductInformation.xml")
511
536
  GeneralUtilities.assert_file_exists(product_information_file)
512
537
  root: etree._ElementTree = etree.parse(product_information_file)
513
- namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'}
538
+ namespaces = {'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)}
514
539
  declaration_elements = root.xpath('/cps:productinformation/cps:requiredenvironmentvariables', namespaces=namespaces)
515
540
  GeneralUtilities.assert_condition(1 == len(declaration_elements), f"'{product_information_file}' must contain exactly one 'requiredenvironmentvariables'-element but it contains {len(declaration_elements)}. Add '<cps:requiredenvironmentvariables></cps:requiredenvironmentvariables>' (empty if the build of this product does not need any environment-variable) to that file.")
516
541
  result: list[str] = []
@@ -687,8 +712,8 @@ class TFCPS_Tools_General:
687
712
 
688
713
  # TODO implement usage of self.reference_latest_version_of_xsd_when_generating_xml
689
714
  GeneralUtilities.write_text_to_file(constants_metafile, f"""<?xml version="1.0" encoding="UTF-8" ?>
690
- <cps:constant xmlns:cps="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure" constantspecificationversion="1.1.0"
691
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/main/Conventions/RepositoryStructure/CommonProjectStructure/constant.xsd">
715
+ <cps:constant xmlns:cps="{TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)}" constantspecificationversion="1.1.0"
716
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="{TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)} {TFCPS_Tools_General.get_common_project_structure_xsd_base_url(CommonProjectStructureVersion)}/constant.xsd">
692
717
  <cps:name>{constantname}</cps:name>
693
718
  <cps:documentationsummary>{documentationsummary}</cps:documentationsummary>
694
719
  <cps:path>{constants_valuefiler_reference}</cps:path>
@@ -713,7 +738,7 @@ class TFCPS_Tools_General:
713
738
  self.assert_is_codeunit_folder(source_codeunit_folder)
714
739
  root: etree._ElementTree = etree.parse(os.path.join(source_codeunit_folder, "Other", "Resources", "Constants", f"{constant_name}.constant.xml"))
715
740
  results = root.xpath(f'//cps:{propertyname}/text()', namespaces={
716
- 'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'
741
+ 'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)
717
742
  })
718
743
  length = len(results)
719
744
  if (length == 0):
@@ -822,18 +847,18 @@ class TFCPS_Tools_General:
822
847
  def codeunit_has_testable_sourcecode(self,codeunit_file:str) -> bool:
823
848
  self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
824
849
  root: etree._ElementTree = etree.parse(codeunit_file)
825
- return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithastestablesourcecode', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0]))
850
+ return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithastestablesourcecode', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0]))
826
851
 
827
852
  @GeneralUtilities.check_arguments
828
853
  def codeunit_has_updatable_dependencies(self,codeunit_file:str) -> bool:
829
854
  self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
830
855
  root: etree._ElementTree = etree.parse(codeunit_file)
831
- return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithasupdatabledependencies', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0]))
856
+ return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithasupdatabledependencies', namespaces={'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)})[0]))
832
857
 
833
858
  @GeneralUtilities.check_arguments
834
859
  def get_codeunit_owner_emailaddress(self,codeunit_file:str) -> None:
835
860
  self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
836
- namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
861
+ namespaces = {'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion), 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
837
862
  root: etree._ElementTree = etree.parse(codeunit_file)
838
863
  result = root.xpath('//cps:codeunit/cps:codeunitowneremailaddress/text()', namespaces=namespaces)[0]
839
864
  return result
@@ -841,7 +866,7 @@ class TFCPS_Tools_General:
841
866
  @GeneralUtilities.check_arguments
842
867
  def get_codeunit_owner_name(self,codeunit_file:str) -> None:
843
868
  self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
844
- namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
869
+ namespaces = {'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion), 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
845
870
  root: etree._ElementTree = etree.parse(codeunit_file)
846
871
  result = root.xpath('//cps:codeunit/cps:codeunitownername/text()', namespaces=namespaces)[0]
847
872
  return result
@@ -1372,23 +1397,23 @@ class TFCPS_Tools_General:
1372
1397
  @GeneralUtilities.check_arguments
1373
1398
  def __ensure_grylibrary_is_available(self, use_cache:bool) -> None:
1374
1399
  grylibrary_folder =os.path.join( self.__sc.get_global_cache_folder(),"Tools","GRYLibrary")
1375
- grylibrary_dll_file = os.path.join(grylibrary_folder, "BuildResult_DotNet_win-x64", "GRYLibrary.dll")
1400
+ #the artifacts-archive of a GRYLibrary-release contains the folder "GRYLibrary" as root-folder
1401
+ grylibrary_dll_file = os.path.join(grylibrary_folder, "GRYLibrary", "BuildResult_DotNet_win-x64", "GRYLibrary.dll")
1376
1402
  grylibrary_dll_file_exists = os.path.isfile(grylibrary_dll_file)
1377
1403
  if not os.path.isfile(grylibrary_dll_file):
1378
1404
  self.__sc.log.log("Download GRYLibrary to global cache...",LogLevel.Information)
1379
- #TODO make version configurable instead of always using "latest"
1380
- grylibrary_latest_codeunit_file = "https://raw.githubusercontent.com/anionDevelopment/GRYLibrary/stable/GRYLibrary/GRYLibrary.codeunit.xml"
1381
- with urllib.request.urlopen(grylibrary_latest_codeunit_file) as url_result:
1382
- grylibrary_latest_version = self.get_version_of_codeunit_filecontent(url_result.read().decode("utf-8"))
1405
+ grylibrary_latest_tag = self.get_tag_of_latest_github_release("anionDevelopment", "GRYLibrary")
1406
+ GeneralUtilities.assert_condition(grylibrary_latest_tag.startswith("v"), f"The tag '{grylibrary_latest_tag}' of the latest GRYLibrary-release does not have the expected format 'v<version>'.")
1407
+ grylibrary_latest_version = grylibrary_latest_tag[1:]
1383
1408
  if grylibrary_dll_file_exists:
1384
- grylibrary_existing_codeunit_file = os.path.join(grylibrary_folder, "SourceCode", "GRYLibrary.codeunit.xml")
1409
+ grylibrary_existing_codeunit_file = os.path.join(grylibrary_folder, "GRYLibrary", "SourceCode", "GRYLibrary.codeunit.xml")
1385
1410
  grylibrary_existing_codeunit_version = self.get_version_of_codeunit(grylibrary_existing_codeunit_file)
1386
1411
  if grylibrary_existing_codeunit_version != grylibrary_latest_version:
1387
1412
  GeneralUtilities.ensure_directory_does_not_exist(grylibrary_folder)
1388
1413
  GeneralUtilities.ensure_directory_does_not_exist(grylibrary_folder)
1389
1414
  GeneralUtilities.ensure_directory_exists(grylibrary_folder)
1390
- archive_name = f"GRYLibrary.v{grylibrary_latest_version}.Artifacts.zip"
1391
- archive_download_link = f"https://github.com/anionDevelopment/GRYLibrary/releases/download/v{grylibrary_latest_version}/{archive_name}"
1415
+ archive_name = f"GRYLibrary_Artifacts_v{grylibrary_latest_version}.zip"
1416
+ archive_download_link = f"https://github.com/anionDevelopment/GRYLibrary/releases/download/{grylibrary_latest_tag}/{archive_name}"
1392
1417
  archive_file = os.path.join(grylibrary_folder, archive_name)
1393
1418
  urllib.request.urlretrieve(archive_download_link, archive_file)
1394
1419
  with zipfile.ZipFile(archive_file, 'r') as zip_ref:
@@ -2085,7 +2110,7 @@ class TFCPS_Tools_General:
2085
2110
  @GeneralUtilities.check_arguments
2086
2111
  def get_dependencies_which_are_ignored_from_updates(self, codeunit_folder: str) -> list[str]:
2087
2112
  self.assert_is_codeunit_folder(codeunit_folder)
2088
- namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
2113
+ namespaces = {'cps': TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion), 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
2089
2114
  codeunit_name = os.path.basename(codeunit_folder)
2090
2115
  codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
2091
2116
  root: etree._ElementTree = etree.parse(codeunit_file)
@@ -2253,3 +2278,9 @@ class TFCPS_Tools_General:
2253
2278
  languages_file = os.path.join(languages_folder, "Languages.txt")
2254
2279
  GeneralUtilities.ensure_file_exists(languages_file)
2255
2280
  GeneralUtilities.write_lines_to_file(languages_file, languages)
2281
+
2282
+ # Kept for compatibility with callers outside of ScriptCollection which use these values directly. Both are derived from
2283
+ # CommonProjectStructureVersion via TFCPS_Tools_General.get_common_project_structure_namespace and
2284
+ # TFCPS_Tools_General.get_common_project_structure_xsd_base_url, so the version still has to be updated only in one place.
2285
+ CommonProjectStructureNamespace: str = TFCPS_Tools_General.get_common_project_structure_namespace(CommonProjectStructureVersion)
2286
+ CommonProjectStructureXSDBaseURL: str = TFCPS_Tools_General.get_common_project_structure_xsd_base_url(CommonProjectStructureVersion)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.4.58
3
+ Version: 4.4.60
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Author-email: Marius Göcke <marius.goecke@gmail.com>
6
6
  License-Expression: GPL-3.0-only
@@ -35,9 +35,9 @@ Requires-Dist: Pillow>=11.3.0
35
35
  Requires-Dist: psutil>=7.2.2
36
36
  Requires-Dist: pycdlib>=1.22.0
37
37
  Requires-Dist: Pygments>=2.21.0
38
- Requires-Dist: pylint>=4.1.2
38
+ Requires-Dist: pylint>=4.1.3
39
39
  Requires-Dist: pyOpenSSL>=25.3.0
40
- Requires-Dist: PyPDF>=6.20.0
40
+ Requires-Dist: PyPDF>=6.21.1
41
41
  Requires-Dist: pytest>=8.4.2
42
42
  Requires-Dist: PyYAML>=6.0.3
43
43
  Requires-Dist: qrcode>=8.2.0
@@ -11,7 +11,7 @@ ScriptCollection/ProgramRunnerSudo.py,sha256=vwKq-MOcqsgiKhSf-MBUDBC_UyaU8evP3Ro
11
11
  ScriptCollection/RepositoryDiagramGenerator.py,sha256=K_u2NW_p4ozdWD50irJEkkcDVa70TcUJpZN63TeXSLw,7092
12
12
  ScriptCollection/RepositoryHistoryAnalyzer.py,sha256=u9141B9D-Kef-9uo3yR7BXKUMzIKLVsesnYk7H-cWm4,6157
13
13
  ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
14
- ScriptCollection/ScriptCollectionCore.py,sha256=VYrCeryVrs20r0_EQLe9Nw_cBTdBmRoDCuZXebfYiMk,310633
14
+ ScriptCollection/ScriptCollectionCore.py,sha256=9Th5XXyQIGQWQ7ZwXwVhhYKD9_REr3RzU8X5mjylSOs,310633
15
15
  ScriptCollection/TestKind.py,sha256=jqLJwNvQeyea7SZf-UFzMC9pM0znv4do7FIC1xq8u9M,1672
16
16
  ScriptCollection/UnassignedVariablesCheck.py,sha256=8xNcp1D5HeOLO1a1NEerq2TsnpFhw7yzYPkaay-oisY,3804
17
17
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -37,9 +37,9 @@ ScriptCollection/TFCPS/PubDependencies.py,sha256=hl6BfYjzb0-esO-pqyV_sxBLbHBi55G
37
37
  ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=mmtpxrFn36GlW9ZdmEb_oigsQZBqJ85awJb9BOP3tGI,31089
38
38
  ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW1NOCMiLMzOy48OqlJX-KY,1744
39
39
  ScriptCollection/TFCPS/TFCPS_CodeSpellCheck.py,sha256=zV62O7UiGjewx1yQUIWmUJ9D-5ipkV_f28uNhp-JWUs,5306
40
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=yosafTfbB0LBMKomZvLnFJpgJpJOMHsGKLirVjG1slk,40501
41
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Mj9t1SyRpkYZE74cLsGWYv4xB89gXL2ld-RX3xvvGdw,9835
42
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=V76EF-Dd2sqnmZPMeJt_Z9QKsY5o1cLS7dz42g3N4SU,63647
40
+ ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=Rh7S84B8QbeWn5qJxRItoI7jquJYvFnNRi_WiX3FjWo,40414
41
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=CB0K8OZNtQESdS2pqX9RQqN-lI5M-cbmXYOR0rbuRlk,9741
42
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=j7HMOG0kttgmnsUNMZErpyufjsrm3gF8Cm-5luEQFZk,63640
43
43
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=BVK3fpEyjcXYVHIb6YYLH7bWe6iKRaCtPrJ3tXAemYw,6582
44
44
  ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=mRBcf7XuNWOSXbZYc3NuJow18AMZ30D6Z-BtyNYfNcM,2072
45
45
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Krt5oyGNcRAN3szsgU7LoTh8yVTOdHW-Kq7R9MDDV-Q,7673
@@ -47,7 +47,7 @@ ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=oYEhz5ZWMnbu97_CcYEqdDxakUF
47
47
  ScriptCollection/TFCPS/TFCPS_OCIImageSecretScan.py,sha256=Jb7AaMcJDW-gYEYBUVZAG3QLTTNWmXlvVEW-lZsykws,14821
48
48
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=XLVsFTA1jvfDbZ7wYJgIdEByZhF_bYVbA5jkisuvK4k,2322
49
49
  ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=2Tx5HLk1ZftBWDCTiGZdP2QiiGNyWsEuTCSt33dNQjc,23891
50
- ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=eGmKZSoS2EQin-qrHTewJrvm-2VzdZhw6d0LceIonF0,158891
50
+ ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=x14mMI8MAL1IkfVb8fXgRL4OVlQgLA4s9ed5UEGJGhM,160522
51
51
  ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=F90CF5kLCgV_M3yN696xWzF1cglWLXecau9My2ZyGxw,42230
52
52
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  ScriptCollection/TFCPS/CPP/TFCPS_CodeUnitSpecific_CPP.py,sha256=BNZPMjGiWLMBH7QDtP06WEVLMnI38NLX4Dpd13bSbi4,16614
@@ -57,7 +57,7 @@ ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
57
57
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
58
58
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
59
59
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
60
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=78i5ImH9JzBgbhKIls-K9jXNfLAHv-6rn1IOpI9x4BU,71196
60
+ ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=RfvRHlB_sQFmnV-NYdluz8OstROMVczTSBzvcYOxLCc,71171
61
61
  ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=9PMxJFB4nyKGzl916UOCvHB5toIyLcWk-ZAM8vPdLxw,64571
63
63
  ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -73,8 +73,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
73
73
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
74
  ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=ILVhJHvwG5TvPBBqSvyACYb7W9QnWrJpxKgHu8IQu4g,9249
75
75
  ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
- scriptcollection-4.4.58.dist-info/METADATA,sha256=HTvSlWdrzMPoIIpvzNGA5BL9zdSKKKEpMLod2rzbDlI,8032
77
- scriptcollection-4.4.58.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
78
- scriptcollection-4.4.58.dist-info/entry_points.txt,sha256=--Xk3EcTa14uk1YnUD8CQ2naQjNKJFohScd1ONy4CeY,6135
79
- scriptcollection-4.4.58.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
80
- scriptcollection-4.4.58.dist-info/RECORD,,
76
+ scriptcollection-4.4.60.dist-info/METADATA,sha256=n0nNo0P5YP-odhwwCQu41xz-IwmQ-se0JItkM7AyZnU,8032
77
+ scriptcollection-4.4.60.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
78
+ scriptcollection-4.4.60.dist-info/entry_points.txt,sha256=--Xk3EcTa14uk1YnUD8CQ2naQjNKJFohScd1ONy4CeY,6135
79
+ scriptcollection-4.4.60.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
80
+ scriptcollection-4.4.60.dist-info/RECORD,,