ScriptCollection 4.4.8__py3-none-any.whl → 4.4.9__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.
@@ -39,7 +39,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
39
39
  from .ProgramRunnerPopen import ProgramRunnerPopen
40
40
  from .SCLog import SCLog, LogLevel
41
41
 
42
- version = "4.4.8"
42
+ version = "4.4.9"
43
43
  __version__ = version
44
44
 
45
45
  class VSCodeWorkspaceShellTask:
@@ -270,6 +270,19 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
270
270
  shutil.copyfile(source_version_file, target_version_file)
271
271
 
272
272
 
273
+ @staticmethod
274
+ @GeneralUtilities.check_arguments
275
+ def __docfx_configuration_declares_metadata(docfx_configuration_file: str) -> bool:
276
+ # States whether the given docfx-configuration declares something to generate metadata from. The metadata-step is
277
+ # only executed in that case, because docfx aborts with a NullReferenceException when the "metadata"-section is
278
+ # missing, while the default-command tolerates its absence. A codeunit which is not implemented in a language docfx
279
+ # can read (a python- or a docker-codeunit for example) has no such section.
280
+ # The trailing commas are removed before the content is parsed: docfx accepts them, but they are not valid json, so
281
+ # without removing them a configuration which docfx itself reads without complaining would be rejected here.
282
+ content: str = GeneralUtilities.read_text_from_file(docfx_configuration_file)
283
+ content_without_trailing_commas: str = re.sub(r",(\s*[}\]])", r"\1", content)
284
+ return 0 < len(json.loads(content_without_trailing_commas).get("metadata", []))
285
+
273
286
  @GeneralUtilities.check_arguments
274
287
  def generate_reference_using_docfx(self, generate_class_reference:bool=False):
275
288
  reference_folder =os.path.join( self.get_codeunit_folder(),"Other","Reference")
@@ -283,7 +296,17 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
283
296
  GeneralUtilities.ensure_directory_exists(generated_reference_folder)
284
297
  obj_folder = os.path.join(reference_folder, "obj")
285
298
  GeneralUtilities.ensure_folder_exists_and_is_empty(obj_folder)
286
- self._protected_sc.run_program("docfx", "-t default,templates/darkfx docfx.json", reference_folder)
299
+ # The metadata-step and the build-step are executed separately instead of using the default-command which runs both
300
+ # of them at once, because only the metadata-command accepts "--property". That property is required because docfx
301
+ # restores the project before it reads it (which is what its option "--noRestore" switches off): that restore does
302
+ # not know the name of the lock-file which belongs to the runtime the build restored for, so it would write one
303
+ # under the default-name besides them (see
304
+ # TFCPS_CodeUnitSpecific_DotNet.__get_arguments_which_prevent_writing_a_lock_file). The restore itself is kept
305
+ # (instead of passing "--noRestore"), because the reference of a codeunit can also be generated on its own, without
306
+ # a build before it.
307
+ if self.__docfx_configuration_declares_metadata(os.path.join(reference_folder, "docfx.json")):
308
+ self._protected_sc.run_program("docfx", "metadata docfx.json --property RestorePackagesWithLockFile=false", reference_folder)
309
+ self._protected_sc.run_program("docfx", "build -t default,templates/darkfx docfx.json", reference_folder)
287
310
  GeneralUtilities.ensure_directory_does_not_exist(obj_folder)
288
311
 
289
312
  if generate_class_reference:# this codeunit has a class-reference, so a human-readable table-of-content can be generated for it
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.4.8
3
+ Version: 4.4.9
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Author-email: Marius Göcke <marius.goecke@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
9
9
  ScriptCollection/ProgramRunnerPopen.py,sha256=zVD-gZY85o8wiGFcpYAGNDl-tXaKzipl1Bkhqy2ois4,4681
10
10
  ScriptCollection/ProgramRunnerSudo.py,sha256=ot9Ib-plQ8wejR9M2XXfnx6GR-va9k8SH1gAC5kjaJ0,5123
11
11
  ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
12
- ScriptCollection/ScriptCollectionCore.py,sha256=o5CYHDYwXRt25TEgmN994-f_H1HSeSZv-YSfK_x994o,261810
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=rldvIi9zD5BgzRFqgmou-1P0alxEEouWky3w-PV46Pw,261810
13
13
  ScriptCollection/TestKind.py,sha256=EBTLR8yBz5VmWA2NZIpDTbQNg6tkfv_kAsIzEJ--mCI,1756
14
14
  ScriptCollection/UnassignedVariablesCheck.py,sha256=v59qLQ5RRvx31ouuCW7NWZj3McWENvGBPkV5ZGBmqJE,4344
15
15
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -37,7 +37,7 @@ ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz
37
37
  ScriptCollection/TFCPS/PackageSource.py,sha256=tQoMbxrIbV3mYHKH2wgOoGzIHY1TvBH8EAFpWGhryrQ,1311
38
38
  ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=rpuwSsQ6YQfZS2LGnvOH5ql8zs_-cHU4LQttS7XNT60,11272
39
39
  ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW1NOCMiLMzOy48OqlJX-KY,1744
40
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=ahRpBESHO9CMqjy6jGFTiPluUmt9biHlO6Wa0VEftJw,36835
40
+ ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=N6hOkfts6g61dhrQyrWx64Nxe0nInMtzyVNKyqHvUfk,38992
41
41
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Mj9t1SyRpkYZE74cLsGWYv4xB89gXL2ld-RX3xvvGdw,9835
42
42
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=PHu13UCn3xj3UBneGk5DDkYZ9iGdJ80IKIte3ewwKfI,49143
43
43
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=kpEmSnfzfgB4OjcCuS_X6jgW_ftcphxEnjjoLoAHTLY,6582
@@ -71,8 +71,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
71
71
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
72
  ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=5z990qyO5durX07xRWRwju1hl6wpjQAy2f-yRwJ-7s0,11856
73
73
  ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
- scriptcollection-4.4.8.dist-info/METADATA,sha256=5Mrm_a1r6igFqkt0dpgC4Vq8xKLORnMRgqYCSDEL2QA,7647
75
- scriptcollection-4.4.8.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
76
- scriptcollection-4.4.8.dist-info/entry_points.txt,sha256=Aj6CHuJxASMe52fK_O6-bNJ_uhxcDb-AgRxFOeTojyE,6069
77
- scriptcollection-4.4.8.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
78
- scriptcollection-4.4.8.dist-info/RECORD,,
74
+ scriptcollection-4.4.9.dist-info/METADATA,sha256=h2-_3VwdzABZM0Qyi5VJvL_Ret6DA_KiVFyDzpd6MXo,7647
75
+ scriptcollection-4.4.9.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
76
+ scriptcollection-4.4.9.dist-info/entry_points.txt,sha256=Aj6CHuJxASMe52fK_O6-bNJ_uhxcDb-AgRxFOeTojyE,6069
77
+ scriptcollection-4.4.9.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
78
+ scriptcollection-4.4.9.dist-info/RECORD,,