ScriptCollection 4.4.43__py3-none-any.whl → 4.4.44__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.
@@ -270,7 +270,7 @@ def BuildCodeUnits() -> int:
270
270
  if args.runincontainer:
271
271
  base_mount_folder:str=args.basemountfolder
272
272
  if base_mount_folder is None:
273
- base_mount_folder=repo
273
+ base_mount_folder=t.get_default_base_mount_folder()
274
274
  base_mount_folder:str=GeneralUtilities.resolve_relative_path(base_mount_folder,os.getcwd())
275
275
  success, _ = t.build_codeunits_in_container(base_mount_folder)
276
276
  return 0 if success else 1
@@ -297,11 +297,11 @@ def BuildCodeUnitsC() -> int:
297
297
  GeneralUtilities.reconfigure_standard_input_and_outputs()
298
298
  repo:str=GeneralUtilities.resolve_relative_path(args.repositoryfolder,os.getcwd())
299
299
  verbosity=LogLevel(int(args.verbosity))
300
+ t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,args.ispremerge,args.assertnonewchanges,args.addreadytomergeflag,args.fastlane)
300
301
  base_mount_folder:str=args.basemountfolder
301
302
  if base_mount_folder is None:
302
- base_mount_folder=repo
303
+ base_mount_folder=t.get_default_base_mount_folder()
303
304
  base_mount_folder:str=GeneralUtilities.resolve_relative_path(base_mount_folder,os.getcwd())
304
- t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,args.ispremerge,args.assertnonewchanges,args.addreadytomergeflag,args.fastlane)
305
305
  success, _ = t.build_codeunits_in_container(base_mount_folder)
306
306
  return 0 if success else 1
307
307
 
@@ -323,7 +323,7 @@ def UpdateDependencies() -> int:
323
323
  if args.runincontainer:
324
324
  base_mount_folder:str=args.basemountfolder
325
325
  if base_mount_folder is None:
326
- base_mount_folder=repo
326
+ base_mount_folder=t.get_default_base_mount_folder()
327
327
  base_mount_folder:str=GeneralUtilities.resolve_relative_path(base_mount_folder,os.getcwd())
328
328
  success, _ = t.update_dependencies_in_container(base_mount_folder)
329
329
  return 0 if success else 1
@@ -366,11 +366,11 @@ def UpdateDependenciesC() -> int:
366
366
  GeneralUtilities.reconfigure_standard_input_and_outputs()
367
367
  repo:str=GeneralUtilities.resolve_relative_path(args.repositoryfolder,os.getcwd())
368
368
  verbosity=LogLevel(int(args.verbosity))
369
+ t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,False,False)
369
370
  base_mount_folder:str=args.basemountfolder
370
371
  if base_mount_folder is None:
371
- base_mount_folder=repo
372
+ base_mount_folder=t.get_default_base_mount_folder()
372
373
  base_mount_folder:str=GeneralUtilities.resolve_relative_path(base_mount_folder,os.getcwd())
373
- t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,False,False)
374
374
  success, _ = t.update_dependencies_in_container(base_mount_folder)
375
375
  return 0 if success else 1
376
376
 
@@ -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.43"
43
+ version = "4.4.44"
44
44
  __version__ = version
45
45
 
46
46
  class VSCodeWorkspaceShellTask:
@@ -1275,6 +1275,20 @@ class ScriptCollectionCore:
1275
1275
  result = self.run_program_argsasarray("git", ["rev-parse", "--abbrev-ref", "HEAD"], repository, throw_exception_if_exitcode_is_not_zero=True)
1276
1276
  return result[1].replace("\r", GeneralUtilities.empty_string).replace("\n", GeneralUtilities.empty_string)
1277
1277
 
1278
+ @GeneralUtilities.check_arguments
1279
+ def git_get_outermost_superproject_working_tree(self, repository: str) -> str:
1280
+ """Returns the working-tree of the outermost repository which contains the given repository as (possibly nested) submodule.
1281
+ If the given repository is not a submodule, the repository itself is returned.
1282
+ This is the smallest folder which contains the real git-folder of a submodule (which is located in the git-folder of its superproject)."""
1283
+ self.assert_is_git_repository(repository)
1284
+ result: str = repository
1285
+ while True:
1286
+ stdout: str = self.run_program_argsasarray("git", ["rev-parse", "--show-superproject-working-tree"], result, throw_exception_if_exitcode_is_not_zero=True)[1]
1287
+ superproject: str = stdout.replace("\r", GeneralUtilities.empty_string).replace("\n", GeneralUtilities.empty_string)
1288
+ if not GeneralUtilities.string_has_content(superproject):
1289
+ return os.path.normpath(result)
1290
+ result = superproject
1291
+
1278
1292
  @GeneralUtilities.check_arguments
1279
1293
  def git_set_local_configuration_value(self, repository: str, key: str, value: str) -> None:
1280
1294
  """Sets a git-configuration-value in the local configuration of the given repository (does not modify the global or system configuration)."""
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import glob
2
3
  import re
3
4
  import shutil
4
5
  import uuid
@@ -764,7 +765,8 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
764
765
  # temp_folder) instead of a relative "./TestResults" inside the codeunit-folder. The relative path would otherwise
765
766
  # leave a folder behind in the codeunit-folder (visible e.g. when building inside the mounted Debian-build-container).
766
767
  # The whole temp_folder - including these results - is removed in the finally-block below.
767
- args += ["--results-directory", os.path.join(temp_folder, "TestResults")]
768
+ results_directory = os.path.join(temp_folder, "TestResults")
769
+ args += ["--results-directory", results_directory]
768
770
  # Run dotnet-test from an absolute working-directory (a subfolder of temp_folder) with node-reuse disabled, for the
769
771
  # same reason as in get_dotnet_build_diagnostics: building the solution with "-o" makes MSBuild create an additional
770
772
  # relative "tmp/<guid>"-output-folder, which a reused worker-node would otherwise create inside the codeunit-folder
@@ -775,10 +777,12 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
775
777
  try:
776
778
  program_output=self._protected_sc.run_program_argsasarray("dotnet", args, test_working_directory, print_live_output=self.get_verbosity()==LogLevel.Debug, timeoutInSeconds=timeoutInSeconds, env_vars={"MSBUILDDISABLENODEREUSE": "1"})
777
779
  test_output:str=program_output[1]
778
- output_lines=program_output[1].split("\n")
779
- output_lines=[line for line in output_lines if GeneralUtilities.string_has_content(line)]
780
- generated_coverage_file: str = output_lines[-1].strip()#the cobertura file is printed in the end of the output by the xplat collector
781
- GeneralUtilities.assert_file_exists(generated_coverage_file)
780
+ # The coverage-file is searched in the results-directory instead of taking the last line of the output: dotnet-test
781
+ # can print further lines (for example the warning NETSDK1194 because of "-o" on a solution) after the path of the
782
+ # coverage-file which is printed by the xplat collector, so the last line is not reliably the path of that file.
783
+ generated_coverage_files: list[str] = glob.glob(os.path.join(results_directory, "**", "coverage.cobertura.xml"), recursive=True)
784
+ GeneralUtilities.assert_condition(len(generated_coverage_files) == 1, f"Expected exactly one coverage-file in \"{results_directory}\" but found {len(generated_coverage_files)}. Output of dotnet test:\n{test_output}")
785
+ generated_coverage_file: str = generated_coverage_files[0]
782
786
  shutil.copyfile(generated_coverage_file, target_file)
783
787
  finally:
784
788
  GeneralUtilities.ensure_directory_does_not_exist(temp_folder)
@@ -371,6 +371,13 @@ class TFCPS_CodeUnit_BuildCodeUnits:
371
371
  self.sc.log.log("Validate openspec-specifications...")
372
372
  self.sc.run_with_epew("openspec", "validate --all --strict", self.repository)
373
373
 
374
+ @GeneralUtilities.check_arguments
375
+ def get_default_base_mount_folder(self) -> str:
376
+ """Returns the folder which is mounted into the container when the caller does not specify one: the repository itself or,
377
+ if it is a submodule, the outermost repository which contains it. Mounting only a submodule would make its git-folder
378
+ unavailable inside the container, because the real git-folder of a submodule is located in the git-folder of its superproject."""
379
+ return self.sc.git_get_outermost_superproject_working_tree(self.repository)
380
+
374
381
  @GeneralUtilities.check_arguments
375
382
  def build_codeunits_in_container(self,base_mount_folder:str) -> tuple[bool, str]:
376
383
  """Runs scbuildcodeunits (with the options of this object) inside the SCBuilder-image and returns whether it succeeded and
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.4.43
3
+ Version: 4.4.44
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
@@ -1,6 +1,6 @@
1
1
  ScriptCollection/ArbTranslationsOrganizer.py,sha256=3TO4fjkYADcHGyUXdiQk-RtfCxtf9ojuBS3CbZtgXBE,12218
2
2
  ScriptCollection/CertificateUpdater.py,sha256=yZc7KESc1F_Mc6HP2UfLmNHRc2MvtVqp0t60J_CqY3s,9755
3
- ScriptCollection/Executables.py,sha256=n0j_k3YKVV_3uwf1LLotl_s1I0PI5MbV-MqNM8ZJtOk,74741
3
+ ScriptCollection/Executables.py,sha256=YczSDzT4HEV9aTlYGuk6TIjQSwHMsg2MKZ9SVncOfsY,74857
4
4
  ScriptCollection/GeneralUtilities.py,sha256=NeWHC-wl4sb4j6NXQUS7sM2OW7UR4VmJu4qtE0TvYY4,73440
5
5
  ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
6
6
  ScriptCollection/ProcessesRunner.py,sha256=EYW927zu3QGmkCoHoYLkofmQZd7Tt1RIyVuhP3UYGho,1496
@@ -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=QwYTdrLKTEoebYTfatZpfB2sQOFjgguNzi-doZQpwPM,307814
14
+ ScriptCollection/ScriptCollectionCore.py,sha256=PO6qcn5x3WmAiQ-meIAaaWGVjQVdDE_90GsocZziV0g,308856
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
@@ -38,7 +38,7 @@ ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=tub8_1QBu0nWAaGnBWp2nErOW-SO
38
38
  ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW1NOCMiLMzOy48OqlJX-KY,1744
39
39
  ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=yosafTfbB0LBMKomZvLnFJpgJpJOMHsGKLirVjG1slk,40501
40
40
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Mj9t1SyRpkYZE74cLsGWYv4xB89gXL2ld-RX3xvvGdw,9835
41
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=eHJ-SzZkBytWudFBmhqRZyxMFdOb4XyuEja4uWBGpZU,54331
41
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=0ovTBfEklKUwUQHUAwxch2Lcir-t0mil1xUxq2Kc4Fo,54900
42
42
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=BVK3fpEyjcXYVHIb6YYLH7bWe6iKRaCtPrJ3tXAemYw,6582
43
43
  ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=mRBcf7XuNWOSXbZYc3NuJow18AMZ30D6Z-BtyNYfNcM,2072
44
44
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Krt5oyGNcRAN3szsgU7LoTh8yVTOdHW-Kq7R9MDDV-Q,7673
@@ -56,7 +56,7 @@ ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
56
56
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
57
57
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
58
58
  ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
59
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=eUFm4UJREEmFXe7O-lqrjUqHR-6yk_cBpRLlQgZf1rs,62667
59
+ ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=40rQxsTzRwWHPX3yCU9fAFpyqzn_3ZFrAI6VEeYwR2k,63170
60
60
  ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
61
  ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=4z6Az3I_qhd-l7EGFYiBllKZUWD3HppZpwurNA_u15U,58484
62
62
  ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -72,8 +72,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
72
72
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=ILVhJHvwG5TvPBBqSvyACYb7W9QnWrJpxKgHu8IQu4g,9249
74
74
  ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
- scriptcollection-4.4.43.dist-info/METADATA,sha256=9JgeRymlu_hkBqj23g1uE1GfWei_m_x5PAtVTKSnU-4,8000
76
- scriptcollection-4.4.43.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
77
- scriptcollection-4.4.43.dist-info/entry_points.txt,sha256=1nA5gUD0Y9L105JGIfTnnqDZhFjzKcFpFaUSrLn-Sw0,5991
78
- scriptcollection-4.4.43.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
79
- scriptcollection-4.4.43.dist-info/RECORD,,
75
+ scriptcollection-4.4.44.dist-info/METADATA,sha256=eGFtwg1_gydfP4O3Q16XROuLrhdJon4FNe1q0zAcrDQ,8000
76
+ scriptcollection-4.4.44.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
77
+ scriptcollection-4.4.44.dist-info/entry_points.txt,sha256=1nA5gUD0Y9L105JGIfTnnqDZhFjzKcFpFaUSrLn-Sw0,5991
78
+ scriptcollection-4.4.44.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
79
+ scriptcollection-4.4.44.dist-info/RECORD,,