ScriptCollection 3.5.159__py3-none-any.whl → 3.5.161__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.159"
39
+ version = "3.5.161"
40
40
  __version__ = version
41
41
 
42
42
 
@@ -2046,6 +2046,7 @@ DNS = {domain}
2046
2046
  package_name = line.replace(">", GeneralUtilities.empty_string).strip().split(" ")[0]
2047
2047
  if not (package_name in ignored_dependencies):
2048
2048
  self.log.log(f"Update package {package_name}...", LogLevel.Debug)
2049
+ time.sleep(1.1) # attempt to prevent rate-limit
2049
2050
  self.run_program("dotnet", f"add {csproj_filename} package {package_name}", folder, print_errors_as_information=True)
2050
2051
 
2051
2052
  @GeneralUtilities.check_arguments
@@ -256,10 +256,14 @@ class TasksForCommonProjectStructure:
256
256
  shutil.copyfile(full_source_file, target_file)
257
257
 
258
258
  @GeneralUtilities.check_arguments
259
- def standardized_tasks_build_for_dart_project_in_common_project_structure(self, build_script_file: str, verbosity: int, targets: list[str], args: list[str], package_name: str):
259
+ def standardized_tasks_build_for_dart_project_in_common_project_structure(self, build_script_file: str, verbosity: int, targets: list[str], args: list[str], package_name: str = None):
260
260
  codeunit_folder = GeneralUtilities.resolve_relative_path("../../..", build_script_file)
261
261
  codeunit_name = os.path.basename(codeunit_folder)
262
- src_folder = GeneralUtilities.resolve_relative_path(package_name, codeunit_folder) # TODO replace packagename
262
+ src_folder: str = None
263
+ if package_name is None:
264
+ src_folder=codeunit_folder
265
+ else:
266
+ src_folder = GeneralUtilities.resolve_relative_path(package_name, codeunit_folder) # TODO replace packagename
263
267
  artifacts_folder = os.path.join(codeunit_folder, "Other", "Artifacts")
264
268
  verbosity = self.get_verbosity_from_commandline_arguments(args, verbosity)
265
269
  target_names: dict[str, str] = {
@@ -269,7 +273,7 @@ class TasksForCommonProjectStructure:
269
273
  "appbundle": "Android",
270
274
  }
271
275
  for target in targets:
272
- GeneralUtilities.write_message_to_stdout(f"Build package {package_name} for target {target_names[target]}...")
276
+ GeneralUtilities.write_message_to_stdout(f"Build flutter-codeunit {codeunit_name} for target {target_names[target]}...")
273
277
  self.run_with_epew("flutter", f"build {target}", src_folder, verbosity)
274
278
  if target == "web":
275
279
  web_relase_folder = os.path.join(src_folder, "build/web")
@@ -1827,15 +1831,60 @@ class TasksForCommonProjectStructure:
1827
1831
  coverage_file_relative = f"{test_coverage_folder_relative}/TestCoverage.xml"
1828
1832
  coverage_file = GeneralUtilities.resolve_relative_path(coverage_file_relative, codeunit_folder)
1829
1833
  self.run_with_epew("lcov_cobertura", f"coverage/lcov.info --base-dir . --excludes test --output ../{coverage_file_relative} --demangle", src_folder, verbosity)
1834
+
1835
+ # format correctly
1830
1836
  content = GeneralUtilities.read_text_from_file(coverage_file)
1831
1837
  content = re.sub('<![^<]+>', '', content)
1832
1838
  content = re.sub('\\\\', '/', content)
1833
1839
  content = re.sub('\\ name=\\"lib\\"', '', content)
1834
- content = re.sub('<package ', f'<package name="{codeunit_name}" ', content)
1835
1840
  content = re.sub('\\ filename=\\"lib/', f' filename="{package_name}/lib/', content)
1836
1841
  GeneralUtilities.write_text_to_file(coverage_file, content)
1842
+ self.__testcoverage_for_flutter_project_merge_packages(coverage_file)
1843
+ self.__testcoverage_for_flutter_project_calculate_line_rate(coverage_file)
1844
+
1837
1845
  self.run_testcases_common_post_task(repository_folder, codeunit_name, verbosity, generate_badges, build_environment_target_type, args)
1838
1846
 
1847
+ def __testcoverage_for_flutter_project_merge_packages(self, coverage_file: str):
1848
+ tree = etree.parse(coverage_file)
1849
+ root = tree.getroot()
1850
+
1851
+ packages = root.findall("./packages/package")
1852
+
1853
+ all_classes = []
1854
+ for pkg in packages:
1855
+ classes = pkg.find("classes")
1856
+ if classes is not None:
1857
+ all_classes.extend(classes.findall("class"))
1858
+ new_package = etree.Element("package", name="Malno")
1859
+ new_classes = etree.SubElement(new_package, "classes")
1860
+ for cls in all_classes:
1861
+ new_classes.append(cls)
1862
+ packages_node = root.find("./packages")
1863
+ packages_node.clear()
1864
+ packages_node.append(new_package)
1865
+ tree.write(coverage_file, pretty_print=True, xml_declaration=True, encoding="UTF-8")
1866
+
1867
+ def __testcoverage_for_flutter_project_calculate_line_rate(self, coverage_file: str):
1868
+ tree = etree.parse(coverage_file)
1869
+ root = tree.getroot()
1870
+ package = root.find("./packages/package")
1871
+ if package is None:
1872
+ raise RuntimeError("No <package>-Element found")
1873
+
1874
+ line_elements = package.findall(".//line")
1875
+
1876
+ amount_of_lines = 0
1877
+ amount_of_hited_lines = 0
1878
+
1879
+ for line in line_elements:
1880
+ amount_of_lines += 1
1881
+ hits = int(line.get("hits", "0"))
1882
+ if hits > 0:
1883
+ amount_of_hited_lines += 1
1884
+ line_rate = amount_of_hited_lines / amount_of_lines if amount_of_lines > 0 else 0.0
1885
+ package.set("line-rate", str(line_rate))
1886
+ tree.write(coverage_file, pretty_print=True, xml_declaration=True, encoding="UTF-8")
1887
+
1839
1888
  @GeneralUtilities.check_arguments
1840
1889
  def standardized_tasks_run_testcases_for_angular_codeunit(self, runtestcases_script_file: str, build_environment_target_type: str, generate_badges: bool, verbosity: int, commandline_arguments: list[str]) -> None:
1841
1890
  # prepare
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ScriptCollection
3
- Version: 3.5.159
3
+ Version: 3.5.161
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
@@ -35,7 +35,7 @@ Requires-Dist: psutil>=7.0.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
38
- Requires-Dist: pyOpenSSL>=25.1.0
38
+ Requires-Dist: pyOpenSSL>=25.2.0
39
39
  Requires-Dist: PyPDF>=6.0.0
40
40
  Requires-Dist: pytest>=8.4.2
41
41
  Requires-Dist: PyYAML>=6.0.2
@@ -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=Rges2qebK89CwmNwUPKMXVlrYa-OCAJUA1bUSQE9S7E,141662
11
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=nXhwH6rfA-XXdQVXYQoxXUQ5sA82d1bDF2EVKdZIfo8,248595
10
+ ScriptCollection/ScriptCollectionCore.py,sha256=DPbTCj2wGkX2kLuv8pIg8qMvJwtgOJAPm4b7LSq7Q0A,141731
11
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=TfRpYvL8svDkKHcX2aoj1v3R8nGGxwnoEXqm3OcLK_Q,250485
12
12
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- scriptcollection-3.5.159.dist-info/METADATA,sha256=cgDT6oojuA4Pc_eDYFFTMO_k79xHPo39_9VpMi0e5ok,7689
14
- scriptcollection-3.5.159.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- scriptcollection-3.5.159.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
16
- scriptcollection-3.5.159.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
- scriptcollection-3.5.159.dist-info/RECORD,,
13
+ scriptcollection-3.5.161.dist-info/METADATA,sha256=5rzT3Iy0_wucfGtf_PtLCH4X6pu1fno5r08dROgfBjw,7689
14
+ scriptcollection-3.5.161.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ scriptcollection-3.5.161.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
16
+ scriptcollection-3.5.161.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
17
+ scriptcollection-3.5.161.dist-info/RECORD,,