ScriptCollection 3.5.162__py3-none-any.whl → 3.5.164__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.
@@ -36,7 +36,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
36
36
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
37
37
  from .SCLog import SCLog, LogLevel
38
38
 
39
- version = "3.5.162"
39
+ version = "3.5.164"
40
40
  __version__ = version
41
41
 
42
42
 
@@ -532,17 +532,19 @@ class TasksForCommonProjectStructure:
532
532
 
533
533
  csproj_project_name = codeunit_name
534
534
  csproj_file = os.path.join(codeunit_folder, csproj_project_name, csproj_project_name+".csproj")
535
- result1: tuple[bool, str] = self.__standardized_task_verify_standard_format_for_project_csproj_file(csproj_file, codeunit_folder, codeunit_name, codeunit_version)
535
+ result1: tuple[bool, str, list[str]] = self.__standardized_task_verify_standard_format_for_project_csproj_file(csproj_file, codeunit_folder, codeunit_name, codeunit_version)
536
536
  if not result1[0]:
537
- raise ValueError(f"'{csproj_file}' with content '{GeneralUtilities.read_text_from_file(csproj_file)}' does not match the standardized .csproj-file-format which is defined by the regex '{result1[1]}'.")
537
+ hints: str = "\n".join(result1[2])
538
+ raise ValueError(f"'{csproj_file}' with content '{GeneralUtilities.read_text_from_file(csproj_file)}' does not match the standardized .csproj-file-format which is defined by the regex '{result1[1]}'.\n{hints}")
538
539
 
539
540
  test_csproj_project_name = csproj_project_name+"Tests"
540
541
  test_csproj_file = os.path.join(codeunit_folder, test_csproj_project_name, test_csproj_project_name+".csproj")
541
- result2: tuple[bool, str] = self.__standardized_task_verify_standard_format_for_test_csproj_file(test_csproj_file, codeunit_name, codeunit_version)
542
+ result2: tuple[bool, str, list[str]] = self.__standardized_task_verify_standard_format_for_test_csproj_file(test_csproj_file, codeunit_name, codeunit_version)
542
543
  if not result2[0]:
543
- raise ValueError(f"'{test_csproj_file}' with content '{GeneralUtilities.read_text_from_file(test_csproj_file)}' does not match the standardized .csproj-file-format which is defined by the regex '{result2[1]}'.")
544
+ hints: str = "\n".join(result2[2])
545
+ raise ValueError(f"'{test_csproj_file}' with content '{GeneralUtilities.read_text_from_file(test_csproj_file)}' does not match the standardized .csproj-file-format which is defined by the regex '{result2[1]}'.\n{hints}")
544
546
 
545
- def __standardized_task_verify_standard_format_for_project_csproj_file(self, csproj_file: str, codeunit_folder: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str]:
547
+ def __standardized_task_verify_standard_format_for_project_csproj_file(self, csproj_file: str, codeunit_folder: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str, str]:
546
548
  self.assert_is_codeunit_folder(codeunit_folder)
547
549
  codeunit_name_regex = re.escape(codeunit_name)
548
550
  codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
@@ -573,7 +575,7 @@ class TasksForCommonProjectStructure:
573
575
  <PackageRequireLicenseAcceptance>true<\\/PackageRequireLicenseAcceptance>
574
576
  <GenerateSerializationAssemblies>Off<\\/GenerateSerializationAssemblies>
575
577
  <AppendTargetFrameworkToOutputPath>false<\\/AppendTargetFrameworkToOutputPath>
576
- <OutputPath>\\.\\.\\\\Other\\\\Artifacts\\\\BuildResult_DotNet_win-x64<\\/OutputPath>
578
+ <OutputPath>\\.\\.\\\\Other\\\\Artifacts\\\\BuildResult_DotNet_win\\-x64<\\/OutputPath>
577
579
  <PlatformTarget>([^<]+)<\\/PlatformTarget>
578
580
  <WarningLevel>\\d<\\/WarningLevel>
579
581
  <Prefer32Bit>false<\\/Prefer32Bit>
@@ -608,9 +610,10 @@ class TasksForCommonProjectStructure:
608
610
  <ErrorReport>none<\\/ErrorReport>
609
611
  <\\/PropertyGroup>(\\n|.)*
610
612
  <\\/Project>$"""
611
- return (self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file), regex)
613
+ result = self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file)
614
+ return (result[0], regex, result[1])
612
615
 
613
- def __standardized_task_verify_standard_format_for_test_csproj_file(self, csproj_file: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str]:
616
+ def __standardized_task_verify_standard_format_for_test_csproj_file(self, csproj_file: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str, str]:
614
617
  codeunit_name_regex = re.escape(codeunit_name)
615
618
  codeunit_version_regex = re.escape(codeunit_version)
616
619
  regex = f"""^<Project Sdk=\\"Microsoft\\.NET\\.Sdk\\">
@@ -637,13 +640,13 @@ class TasksForCommonProjectStructure:
637
640
  <PackageRequireLicenseAcceptance>true<\\/PackageRequireLicenseAcceptance>
638
641
  <GenerateSerializationAssemblies>Off<\\/GenerateSerializationAssemblies>
639
642
  <AppendTargetFrameworkToOutputPath>false<\\/AppendTargetFrameworkToOutputPath>
640
- <OutputPath>\\.\\.\\\\Other\\\\Artifacts\\\\BuildResultTests_DotNet_win-x64<\\/OutputPath>
643
+ <OutputPath>\\.\\.\\\\Other\\\\Artifacts\\\\BuildResultTests_DotNet_win\\-x64<\\/OutputPath>
641
644
  <PlatformTarget>([^<]+)<\\/PlatformTarget>
642
645
  <WarningLevel>\\d<\\/WarningLevel>
643
646
  <Prefer32Bit>false<\\/Prefer32Bit>
644
- <SignAssembly>True<\\/SignAssembly>
647
+ <SignAssembly>true<\\/SignAssembly>
645
648
  <AssemblyOriginatorKeyFile>\\.\\.\\\\\\.\\.\\\\Other\\\\Resources\\\\PublicKeys\\\\StronglyNamedKey\\\\([^<]+)PublicKey\\.snk<\\/AssemblyOriginatorKeyFile>
646
- <DelaySign>True<\\/DelaySign>
649
+ <DelaySign>true<\\/DelaySign>
647
650
  <NoWarn>([^<]+)<\\/NoWarn>
648
651
  <WarningsAsErrors>([^<]+)<\\/WarningsAsErrors>
649
652
  <ErrorLog>\\.\\.\\\\Other\\\\Resources\\\\CodeAnalysisResult\\\\{codeunit_name_regex}Tests\\.sarif<\\/ErrorLog>
@@ -671,16 +674,41 @@ class TasksForCommonProjectStructure:
671
674
  <ErrorReport>none<\\/ErrorReport>
672
675
  <\\/PropertyGroup>(\\n|.)*
673
676
  <\\/Project>$"""
674
- return (self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file), regex)
677
+ result = self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file)
678
+ return (result[0], regex, result[1])
675
679
 
676
- def __standardized_task_verify_standard_format_for_csproj_files(self, regex: str, csproj_file: str) -> bool:
680
+ def __standardized_task_verify_standard_format_for_csproj_files(self, regex: str, csproj_file: str) -> tuple[bool, list[str]]:
677
681
  filename = os.path.basename(csproj_file)
678
682
  GeneralUtilities.write_message_to_stdout(f"Check {filename}...")
679
683
  file_content = GeneralUtilities.read_text_from_file(csproj_file)
680
684
  regex = regex.replace("\r", GeneralUtilities.empty_string).replace("\n", "\\n")
681
685
  file_content = file_content.replace("\r", GeneralUtilities.empty_string)
682
686
  match = re.match(regex, file_content)
683
- return match is not None
687
+ result = match is not None
688
+ hints = None
689
+ if not result:
690
+ hints = self.get_hints_for_csproj()
691
+ return (result, hints)
692
+
693
+ @GeneralUtilities.check_arguments
694
+ def get_hints_for_csproj(self) -> list[str]:
695
+ result: list[str] = []
696
+ with open("string.txt", "r", encoding="utf-8") as f:
697
+ strings = [line.rstrip("\n") for line in f]
698
+
699
+ with open("regex.txt", "r", encoding="utf-8") as f:
700
+ regexes = [line.rstrip("\n") for line in f]
701
+
702
+ amount_of_lines = len(regexes)
703
+ if len(strings) < amount_of_lines:
704
+ result.append("csproj-file has less lines than the regex requires.")
705
+ return result
706
+ for i in range(amount_of_lines - 1):
707
+ s = strings[i]
708
+ r = regexes[i]
709
+ if not re.match(r, s):
710
+ result.append(f"Line {i+1} does not match: Regex='{r}' String='{s}'")
711
+ return result
684
712
 
685
713
  @GeneralUtilities.check_arguments
686
714
  def __standardized_tasks_build_for_dotnet_build(self, csproj_file: str, originaloutputfolder: str, files_to_sign: dict[str, str], commitid: str, verbosity: int, runtimes: list[str], target_environmenttype: str, target_environmenttype_mapping: dict[str, str], copy_license_file_to_target_folder: bool, repository_folder: str, codeunit_name: str, commandline_arguments: list[str]) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.162
3
+ Version: 3.5.164
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
@@ -31,7 +31,7 @@ Requires-Dist: lcov-cobertura>=2.1.1
31
31
  Requires-Dist: lxml>=6.0.1
32
32
  Requires-Dist: ntplib>=0.4.0
33
33
  Requires-Dist: Pillow>=11.3.0
34
- Requires-Dist: psutil>=7.0.0
34
+ Requires-Dist: psutil>=7.1.0
35
35
  Requires-Dist: pycdlib>=1.14.0
36
36
  Requires-Dist: Pygments>=2.19.2
37
37
  Requires-Dist: pylint>=3.3.8
@@ -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=rMdrEzBKQZBdObPJ9nZ5XCEXRoIFqPh8fAoiX6ZOVuw,4493
10
- ScriptCollection/ScriptCollectionCore.py,sha256=7axjJZ3kMYVeO4dvOINbIf-W9CRZs2SGIWn1_hRjyPI,141742
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=bVq2XIEz1Z8bXOW1WJIVN2YW9vMCcR2FCTuqEyzFG_I,250542
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=TwbQyNauisK5iRVRQt5JVDPM7xSPR1-XGv-0-BHY_3I,141742
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=l3ZBmN60S-rJySg7rA5ShQmtAb6DbWxeJsQsypfd8Z4,251694
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.162.dist-info/METADATA,sha256=lvHNFsWWWMeMxh4qeIH8mLPAGhiMlXBnuwPHaq_cv5o,7689
14
- scriptcollection-3.5.162.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- scriptcollection-3.5.162.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
16
- scriptcollection-3.5.162.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.162.dist-info/RECORD,,
13
+ scriptcollection-3.5.164.dist-info/METADATA,sha256=BOZUlLK1m1PR87cMyub9vd0e78vc3qePhkpQBuY3Uec,7689
14
+ scriptcollection-3.5.164.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ scriptcollection-3.5.164.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
16
+ scriptcollection-3.5.164.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.164.dist-info/RECORD,,