ScriptCollection 3.5.18__py3-none-any.whl → 3.5.20__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.
@@ -362,10 +362,11 @@ def GenerateARC42ReferenceTemplate() -> int:
362
362
  parser = argparse.ArgumentParser()
363
363
  parser.add_argument('-f', '--folder', required=False)
364
364
  parser.add_argument('-p', '--productname', required=False)
365
+ parser.add_argument('-s', '--subfolder', required=False)
365
366
  args = parser.parse_args()
366
367
 
367
368
  folder = args.folder
368
369
  if folder is None:
369
370
  folder = os.getcwd()
370
- ScriptCollectionCore().generate_arc42_reference_template(folder, args.productname)
371
+ ScriptCollectionCore().generate_arc42_reference_template(folder, args.productname, args.subfolder)
371
372
  return 0
@@ -30,7 +30,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
30
30
  from .ProgramRunnerPopen import ProgramRunnerPopen
31
31
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
32
32
 
33
- version = "3.5.18"
33
+ version = "3.5.20"
34
34
  __version__ = version
35
35
 
36
36
 
@@ -414,8 +414,8 @@ class ScriptCollectionCore:
414
414
  args.append("-m")
415
415
  args.append(commit_message)
416
416
  args.append(sourcebranch)
417
- self.run_program_argsasarray(
418
- "git", args, directory, throw_exception_if_exitcode_is_not_zero=True, verbosity=0)
417
+ self.run_program_argsasarray("git", args, directory, throw_exception_if_exitcode_is_not_zero=True, verbosity=0)
418
+ self.run_program_argsasarray("git", ["submodule", "update"], directory, throw_exception_if_exitcode_is_not_zero=True, verbosity=0)
419
419
  return self.git_get_commit_id(directory)
420
420
 
421
421
  @GeneralUtilities.check_arguments
@@ -1757,11 +1757,13 @@ chmod {permission} {link_file}
1757
1757
  """.replace("XDX", "ODO"))
1758
1758
 
1759
1759
  @GeneralUtilities.check_arguments
1760
- def generate_arc42_reference_template(self, repository: str, productname: str = None):
1760
+ def generate_arc42_reference_template(self, repository: str, productname: str = None, subfolder: str = None):
1761
1761
  productname: str
1762
1762
  if productname is None:
1763
1763
  productname = os.path.basename(repository)
1764
- reference_root_folder = f"{repository}/Other/Resources/Reference"
1764
+ if subfolder is None:
1765
+ subfolder = "Other/Resources/Reference"
1766
+ reference_root_folder = f"{repository}/{subfolder}"
1765
1767
  reference_content_folder = reference_root_folder + "/Technical"
1766
1768
  if os.path.isdir(reference_root_folder):
1767
1769
  raise ValueError(f"The folder '{reference_root_folder}' does already exist.")
@@ -1780,11 +1782,11 @@ TXDX add minimal service-description here.
1780
1782
 
1781
1783
  TXDX
1782
1784
 
1783
- # Quality goals
1785
+ ## Quality goals
1784
1786
 
1785
- TXDX
1787
+ TXDX
1786
1788
 
1787
- # Stakeholder
1789
+ ## Stakeholder
1788
1790
 
1789
1791
  | Name | How to contact | Reason |
1790
1792
  | ---- | -------------- | ------ |""")
@@ -1803,7 +1805,7 @@ TXDX
1803
1805
 
1804
1806
  ## Scope
1805
1807
 
1806
- TXDX""")
1808
+ TXDX""")
1807
1809
  self.__add_chapter(main_reference_file, reference_content_folder, 4, 'Solution Strategy', """TXDX""")
1808
1810
  self.__add_chapter(main_reference_file, reference_content_folder, 5, 'Building Block View', """TXDX""")
1809
1811
  self.__add_chapter(main_reference_file, reference_content_folder, 6, 'Runtime View', """TXDX""")
@@ -1840,6 +1840,74 @@ class TasksForCommonProjectStructure:
1840
1840
  self.__sc.run_program("swagger", f"tofile --output {versioned_api_spec_file} BuildResult_DotNet_{runtime}/{codeunitname}.dll {swagger_document_name}", artifacts_folder, verbosity=verbosity)
1841
1841
  shutil.copyfile(os.path.join(artifacts_folder, versioned_api_spec_file), os.path.join(artifacts_folder, f"APISpecification/{codeunitname}.latest.api.json"))
1842
1842
 
1843
+ @GeneralUtilities.check_arguments
1844
+ def ensure_openapigenerator_is_available(self, codeunit_folder: str) -> None:
1845
+ openapigenerator_folder = os.path.join(codeunit_folder, "Other", "Resources", "OpenAPIGenerator")
1846
+ internet_connection_is_available = GeneralUtilities.internet_connection_is_available()
1847
+ filename = "open-api-generator.jar"
1848
+ jar_file = f"{openapigenerator_folder}/{filename}"
1849
+ jar_file_exists = os.path.isfile(jar_file)
1850
+ if internet_connection_is_available: # Load/Update
1851
+ github_api_releases_link = "https://api.github.com/repos/OpenAPITools/openapi-generator/releases"
1852
+ with urllib.request.urlopen(github_api_releases_link) as release_information_url:
1853
+ latest_release_infos = json.load(release_information_url)[0]
1854
+ latest_version = latest_release_infos["tag_name"][1:]
1855
+ download_link = f"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/{latest_version}/openapi-generator-cli-{latest_version}.jar"
1856
+ GeneralUtilities.ensure_directory_does_not_exist(openapigenerator_folder)
1857
+ GeneralUtilities.ensure_directory_exists(openapigenerator_folder)
1858
+ urllib.request.urlretrieve(download_link, jar_file)
1859
+ else:
1860
+ if jar_file_exists:
1861
+ GeneralUtilities.write_message_to_stdout("Warning: Can not check for updates of OpenAPIGenerator due to missing internet-connection.")
1862
+ else:
1863
+ raise ValueError("Can not download OpenAPIGenerator.")
1864
+
1865
+ def generate_api_client_from_dependent_codeunit_in_dotnet(self, file: str, name_of_api_providing_codeunit: str, base_namespace: str) -> None:
1866
+ codeunit_folder = GeneralUtilities.resolve_relative_path("../..", file)
1867
+ codeunit_name = os.path.basename(codeunit_folder)
1868
+ client_subpath = f"{codeunit_name}/APIClients/{name_of_api_providing_codeunit}"
1869
+ namespace = f"{base_namespace}.APIClients.{name_of_api_providing_codeunit}"
1870
+ self.generate_api_client_from_dependent_codeunit(file, name_of_api_providing_codeunit, client_subpath, "csharp", f"--additional-properties packageName={namespace}")
1871
+
1872
+ def generate_api_client_from_dependent_codeunit(self, file: str, name_of_api_providing_codeunit: str, target_subfolder_in_codeunit: str, language: str, additional_properties: str) -> None:
1873
+ codeunit_folder = GeneralUtilities.resolve_relative_path("../..", file)
1874
+ self.ensure_openapigenerator_is_available(codeunit_folder)
1875
+ openapigenerator_jar_file = os.path.join(codeunit_folder, "Other", "Resources", "OpenAPIGenerator", "open-api-generator.jar")
1876
+ openapi_spec_file = os.path.join(codeunit_folder, "Other", "Resources", "DependentCodeUnits", name_of_api_providing_codeunit, "APISpecification", f"{name_of_api_providing_codeunit}.latest.api.json")
1877
+ target_folder = os.path.join(codeunit_folder, target_subfolder_in_codeunit)
1878
+ GeneralUtilities.ensure_directory_exists(target_folder)
1879
+ ScriptCollectionCore().run_program("java", f'-jar {openapigenerator_jar_file} generate -i {openapi_spec_file} -g {language} -o {target_folder} --global-property supportingFiles --global-property models --global-property apis {additional_properties}', codeunit_folder)
1880
+
1881
+ # move docs to correct folder
1882
+ target_folder_docs = os.path.join(target_folder, "docs")
1883
+ target_folder_docs_correct = os.path.join(codeunit_folder, "Other", "Reference", "ReferenceContent", f"{name_of_api_providing_codeunit}-API")
1884
+ GeneralUtilities.ensure_directory_does_not_exist(target_folder_docs_correct)
1885
+ GeneralUtilities.ensure_directory_exists(target_folder_docs_correct)
1886
+ GeneralUtilities.move_content_of_folder(target_folder_docs, target_folder_docs_correct)
1887
+ GeneralUtilities.ensure_directory_does_not_exist(target_folder_docs)
1888
+
1889
+ code_folders = GeneralUtilities.get_direct_folders_of_folder(os.path.join(target_folder, "src"))
1890
+
1891
+ # remove test-folder
1892
+ tests_folder = [x for x in code_folders if x.endswith(".Test")][0]
1893
+ GeneralUtilities.ensure_directory_does_not_exist(tests_folder)
1894
+
1895
+ # move source to correct folder
1896
+ src_folder = [x for x in code_folders if not x.endswith(".Test")][0]
1897
+ target_folder_src = GeneralUtilities.resolve_relative_path("../..", src_folder)
1898
+
1899
+ for targetfile in GeneralUtilities.get_direct_files_of_folder(target_folder_src):
1900
+ GeneralUtilities.ensure_file_does_not_exist(targetfile)
1901
+ for folder in GeneralUtilities.get_direct_folders_of_folder(target_folder_src):
1902
+ f = folder.replace("\\", "/")
1903
+ if not f.endswith("/.openapi-generator") and not f.endswith("/src"):
1904
+ GeneralUtilities.ensure_directory_does_not_exist(f)
1905
+ GeneralUtilities.ensure_directory_exists(target_folder_src)
1906
+ GeneralUtilities.move_content_of_folder(src_folder, target_folder_src)
1907
+ GeneralUtilities.ensure_directory_does_not_exist(src_folder)
1908
+ for targetfile in GeneralUtilities.get_direct_files_of_folder(target_folder_src):
1909
+ GeneralUtilities.ensure_file_does_not_exist(targetfile)
1910
+
1843
1911
  @GeneralUtilities.check_arguments
1844
1912
  def replace_version_in_packagejson_file(self, packagejson_file: str, codeunit_version: str) -> None:
1845
1913
  encoding = "utf-8"
@@ -2507,7 +2575,7 @@ class TasksForCommonProjectStructure:
2507
2575
  else:
2508
2576
  GeneralUtilities.write_message_to_stdout(f"There are no dependencies to update in codeunit {codeunit}.")
2509
2577
  if updated_dependencies:
2510
- self.__sc.run_program("scbuildcodeunits", "--targetenvironment QualityCheck", repository_folder) # TODO set verbosity
2578
+ self.__sc.run_program("scbuildcodeunits", "--targetenvironment QualityCheck", repository_folder, verbosity=verbosity) # TODO set timeout
2511
2579
  self.__sc.git_commit(repository_folder, "Updated dependencies")
2512
2580
 
2513
2581
  class GenericPrepareNewReleaseArguments:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ScriptCollection
3
- Version: 3.5.18
3
+ Version: 3.5.20
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
@@ -22,26 +22,26 @@ Classifier: Topic :: Terminals
22
22
  Classifier: Topic :: Utilities
23
23
  Requires-Python: >=3.10
24
24
  Description-Content-Type: text/markdown
25
- Requires-Dist: build >=1.2.1
26
- Requires-Dist: coverage >=7.6.0
27
- Requires-Dist: cyclonedx-bom >=4.5.0
25
+ Requires-Dist: build >=1.2.2
26
+ Requires-Dist: coverage >=7.6.1
27
+ Requires-Dist: cyclonedx-bom >=4.6.1
28
28
  Requires-Dist: defusedxml >=0.7.1
29
29
  Requires-Dist: keyboard >=0.13.5
30
30
  Requires-Dist: lcov-cobertura >=2.0.2
31
- Requires-Dist: lxml >=5.2.2
31
+ Requires-Dist: lxml >=5.3.0
32
32
  Requires-Dist: ntplib >=0.4.0
33
33
  Requires-Dist: Pillow >=10.4.0
34
34
  Requires-Dist: pycdlib >=1.14.0
35
35
  Requires-Dist: Pygments >=2.18.0
36
- Requires-Dist: pylint >=3.2.6
36
+ Requires-Dist: pylint >=3.3.1
37
37
  Requires-Dist: pyOpenSSL >=24.2.1
38
38
  Requires-Dist: PyPDF2 >=3.0.1
39
- Requires-Dist: pytest >=8.3.2
40
- Requires-Dist: PyYAML >=6.0.1
41
- Requires-Dist: qrcode >=7.4.2
39
+ Requires-Dist: pytest >=8.3.3
40
+ Requires-Dist: PyYAML >=6.0.2
41
+ Requires-Dist: qrcode >=8.0
42
42
  Requires-Dist: send2trash >=1.8.3
43
43
  Requires-Dist: twine >=5.1.1
44
- Requires-Dist: xmlschema >=3.3.2
44
+ Requires-Dist: xmlschema >=3.4.2
45
45
 
46
46
  # ScriptCollection
47
47
 
@@ -1,16 +1,16 @@
1
- ScriptCollection/Executables.py,sha256=Ui9omPvmBjnsgFZXpeXMoZXmk17sjPyO1mS_7B7w8aY,19951
1
+ ScriptCollection/Executables.py,sha256=rdyVf_rWHIHeAeOngTeyohYYIimb0BqtZxUBDDpQSDQ,20028
2
2
  ScriptCollection/GeneralUtilities.py,sha256=AElXv2NO30cTw-Qs3qVmO-YCOQ5FvBQM3RZMywuKQ_Y,35121
3
3
  ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
4
4
  ScriptCollection/ProgramRunnerBase.py,sha256=7QAjoqOz6XPmJH19F2k-Z1fFQB_uZnPFvn-T54IJcHQ,2324
5
5
  ScriptCollection/ProgramRunnerEpew.py,sha256=C2Rs3YWOWWWJct7XmKphp5CF1tf0j4Fp-ljV2drLTfs,6349
6
6
  ScriptCollection/ProgramRunnerPopen.py,sha256=G3LgQUVCfaq7XjBsGzalElH31Hbr0etttGR2_H87YzA,3512
7
7
  ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
8
- ScriptCollection/ScriptCollectionCore.py,sha256=5As77GOFsK0QWvwQW49rPh-KRVugq7RTkeSmhcmV61o,100035
9
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=QWUusRX-iMI96V7D41I8u3at1HYR9Fv1BPdTvkvFF8s,185366
8
+ ScriptCollection/ScriptCollectionCore.py,sha256=a0v9sXIrZ2ymtcwcZUFsBUKsrhzYFOUAhzd28s9I1KQ,100252
9
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=9Nm7btdvikTOCOQaSXRV7sadaIi2aVqTWVCvUcYclK8,190588
10
10
  ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
11
11
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- ScriptCollection-3.5.18.dist-info/METADATA,sha256=DKfaIJ6HfmBFP_ql4-E8tur2iBPQkucg4gaHLtyPK70,7680
13
- ScriptCollection-3.5.18.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
14
- ScriptCollection-3.5.18.dist-info/entry_points.txt,sha256=yASwR6hWZ_b5d4W49YeX1htD8ngfWbwgjpfQiJdtUAU,2322
15
- ScriptCollection-3.5.18.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
- ScriptCollection-3.5.18.dist-info/RECORD,,
12
+ ScriptCollection-3.5.20.dist-info/METADATA,sha256=H0PzPBf00yKeONM1Mer8i5AbyoDpZeEfiqzg5r1T-5E,7678
13
+ ScriptCollection-3.5.20.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
14
+ ScriptCollection-3.5.20.dist-info/entry_points.txt,sha256=yASwR6hWZ_b5d4W49YeX1htD8ngfWbwgjpfQiJdtUAU,2322
15
+ ScriptCollection-3.5.20.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
16
+ ScriptCollection-3.5.20.dist-info/RECORD,,