ScriptCollection 4.3.54__py3-none-any.whl → 4.3.55__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.3.54"
42
+ version = "4.3.55"
43
43
  __version__ = version
44
44
 
45
45
  class VSCodeWorkspaceShellTask:
@@ -245,6 +245,16 @@ class TFCPS_CodeUnit_BuildCodeUnits:
245
245
  if test:
246
246
  scbuildcodeunits_arguments=["bash","-c", "pip3 install scriptcollection --upgrade && scshowversion && "+" ".join(scbuildcodeunits_arguments)]
247
247
 
248
+ args=["--repository",self.repository,"--targetenvironmenttype",self.target_environment_type,"--verbosity",str(int(self.sc.log.loglevel))]
249
+
250
+ if os.path.isfile( os.path.join( GeneralUtilities.get_scriptcollection_configuration_folder(),"TFCPS","CustomPreCodeUnitBuildScriptForContainer.py")):
251
+ self.sc.log.log("Run custom pre-codeunitbuild script for container...")
252
+ self.sc.run_program_argsasarray(GeneralUtilities.get_python_executable(),["CustomPreCodeUnitBuildScriptForContainer.py"]+args, os.path.join( GeneralUtilities.get_scriptcollection_configuration_folder(),"TFCPS"),print_live_output=True)
253
+
254
+ if os.path.isfile( os.path.join(self.repository,"Other","Scripts","CustomPreCodeUnitBuildScriptForContainer.py")):
255
+ self.sc.log.log("Prepare build codeunits for container...")
256
+ self.sc.run_program_argsasarray(GeneralUtilities.get_python_executable(),["CustomPreCodeUnitBuildScriptForContainer.py"]+args, os.path.join(self.repository,"Other","Scripts"),print_live_output=True)
257
+
248
258
  #pass the env-variables defined in <repository>/.ScriptCollection/RequiredEnvVariables.csv (if any) into the container so they do not have to be specified explicitly on every scbuildcodeunitsc-call.
249
259
  env_arguments: list[str] = []
250
260
  for env_variable_name, env_variable_value in self.tfcps_tools_general.get_required_env_variables(self.repository).items():
@@ -458,10 +458,6 @@ class TFCPS_Tools_General:
458
458
  root: etree._ElementTree = etree.parse(product_information_file)
459
459
  return str(root.xpath('/cps:productinformation/cps:producttitle/text()', namespaces={'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'})[0])
460
460
 
461
- @GeneralUtilities.check_arguments
462
- def get_required_env_variables_file(self, repository: str) -> str:
463
- return os.path.join(repository, ".ScriptCollection", "RequiredEnvVariables.csv")
464
-
465
461
  @GeneralUtilities.check_arguments
466
462
  def get_required_env_variables(self, repository: str) -> dict[str, str]:
467
463
  """Reads '<repository>/.ScriptCollection/RequiredEnvVariables.csv' and resolves the value of each environment-variable
@@ -472,25 +468,32 @@ class TFCPS_Tools_General:
472
468
  caller which needs these environment-variables (for example to pass them into a build-container) obtains identical
473
469
  values instead of re-implementing the resolution-logic."""
474
470
  result: dict[str, str] = {}
475
- file = self.get_required_env_variables_file(repository)
476
- if not os.path.isfile(file):
477
- return result
478
- allowed_kinds = ["literal", "hostenvvariable", "file"]
479
- for entry in GeneralUtilities.read_csv_file(file, True):
480
- env_variable_name = entry[0]
481
- kind = entry[1]
482
- value = entry[2]
483
- GeneralUtilities.assert_condition(kind in allowed_kinds, f"Unknown kind '{kind}' for required environment-variable '{env_variable_name}' defined in '{file}'. Allowed values are: {', '.join(allowed_kinds)}.")
484
- if kind == "literal":
485
- resolved_value = value
486
- elif kind == "hostenvvariable":
487
- resolved_value = os.environ.get(value)
488
- GeneralUtilities.assert_condition(resolved_value is not None, f"The environment-variable '{env_variable_name}' defined in '{file}' is supposed to be taken from the host-environment-variable '{value}', but that environment-variable is not set.")
489
- else: # file
490
- value_file = GeneralUtilities.resolve_relative_path(value, repository)
491
- GeneralUtilities.assert_file_exists(value_file, f"The environment-variable '{env_variable_name}' defined in '{file}' is supposed to be taken from the file '{value_file}', but that file does not exist.")
492
- resolved_value = GeneralUtilities.read_text_from_file(value_file).strip()
493
- result[env_variable_name] = resolved_value
471
+ files=[
472
+ os.path.join(repository, ".ScriptCollection", "RequiredEnvVariables.local.csv"),
473
+ os.path.join(repository, ".ScriptCollection", "RequiredEnvVariables.csv")
474
+ ]
475
+ for file in files:
476
+ if not os.path.isfile(file):
477
+ return result
478
+ allowed_kinds = ["literal", "hostenvvariable", "file"]
479
+ for entry in GeneralUtilities.read_csv_file(file, True):
480
+ env_variable_name = entry[0]
481
+ kind = entry[1]
482
+ value = entry[2]
483
+ GeneralUtilities.assert_condition(kind in allowed_kinds, f"Unknown kind '{kind}' for required environment-variable '{env_variable_name}' defined in '{file}'. Allowed values are: {', '.join(allowed_kinds)}.")
484
+ if kind == "literal":
485
+ resolved_value = value
486
+ elif kind == "hostenvvariable":
487
+ resolved_value = os.environ.get(value)
488
+ GeneralUtilities.assert_condition(resolved_value is not None, f"The environment-variable '{env_variable_name}' defined in '{file}' is supposed to be taken from the host-environment-variable '{value}', but that environment-variable is not set.")
489
+ elif kind == "file":
490
+ value = os.path.expanduser(value)
491
+ value_file = GeneralUtilities.resolve_relative_path(value, repository)
492
+ GeneralUtilities.assert_file_exists(value_file, f"The environment-variable '{env_variable_name}' defined in '{file}' is supposed to be taken from the file '{value_file}', but that file does not exist.")
493
+ resolved_value = GeneralUtilities.read_text_from_file(value_file).strip()
494
+ else:
495
+ raise ValueError(f"Unknown kind '{kind}' for required environment-variable '{env_variable_name}' defined in '{file}'. Allowed values are: {', '.join(allowed_kinds)}.")
496
+ result[env_variable_name] = resolved_value
494
497
  return result
495
498
 
496
499
  @GeneralUtilities.check_arguments
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptcollection
3
- Version: 4.3.54
3
+ Version: 4.3.55
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=RXsiceQ8W6a8YDk_2BPscVbIAmDIpIxqe9WHBy2r4CM,5233
11
11
  ScriptCollection/SCLog.py,sha256=LdzSJy3NnnwYCCefz2h4tiTy4BjT8lOz3IBG_bMOg9E,4821
12
- ScriptCollection/ScriptCollectionCore.py,sha256=Eb5lWXd84BSxwhvUgt3fkSol1GEqKnJFEeOWHNkwp4M,248737
12
+ ScriptCollection/ScriptCollectionCore.py,sha256=4NmeOKZ51SnWxMMWqfhBSedaKjrDQCuOw4vCLiUYzT4,248737
13
13
  ScriptCollection/UnassignedVariablesCheck.py,sha256=v59qLQ5RRvx31ouuCW7NWZj3McWENvGBPkV5ZGBmqJE,4344
14
14
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=WO2M28c2tUwsXFNa2L9zqMhdlyObWm3qpPE0LdIs7SE,2315
@@ -36,14 +36,14 @@ ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz
36
36
  ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=rpuwSsQ6YQfZS2LGnvOH5ql8zs_-cHU4LQttS7XNT60,11272
37
37
  ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=H9FWlS6BPK-UWJXdWN686ePky4Hq-Q13T0Kx8HSJu7s,34990
38
38
  ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Ll5EOkpVpPiFrM2mLeQXolaF7075IwgtnHXvfdpkH4k,9904
39
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=7dfPmrr2LkChVTayTv1MBFqHJuV5xdE5nn5yX1-4kLY,35041
39
+ ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=W_-sVAxBrpYZen_1YOGICRHmLvkMyfJ5iqk7FVvieUY,36106
40
40
  ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=X2NgZgbOkJsdZ6wMHB_RuS_rQCuz5oQCqzYrxyXBN9Q,6680
41
41
  ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIuX7XfYE0tvg,2116
42
42
  ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=zp7n0Li7GTi4tERDMgDcJ-o3m6131m31zvkat0lALEc,7781
43
43
  ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=jQ0B3yq45we-8a0KuNFMfXCk9MfzPpTv2QgDWMN34x4,22792
44
44
  ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=JYiDqDsfVJQWS9xWMi_UzfXnXsJRnPRxAzFr82bUEvI,2370
45
45
  ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=Z8Gw-j5I7VPafHEsVeQJ2gTTKVLAnnhwZhY8IVTi2Qk,11867
46
- ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=1lTI_K4pZcwfGy1xtAcp6pvd0cU7i9VUQxBUB_1n0v0,133196
46
+ ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=ETrDZQK2tsVd6PTv0pN2xl4nQnbiS11piNiRbMJ-bmk,133508
47
47
  ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
49
49
  ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -64,8 +64,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=Bd1gxCk9Fb
64
64
  ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
66
66
  ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
- scriptcollection-4.3.54.dist-info/METADATA,sha256=mcG6Nwg-R-s1-owdMWurMadlkH0qSgX4_Cr68tMi0II,7648
68
- scriptcollection-4.3.54.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
69
- scriptcollection-4.3.54.dist-info/entry_points.txt,sha256=SCaysPSowWjcCsPpNgVQIKYfo1I5BMiVI39LTWl4qDI,5915
70
- scriptcollection-4.3.54.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
71
- scriptcollection-4.3.54.dist-info/RECORD,,
67
+ scriptcollection-4.3.55.dist-info/METADATA,sha256=bB4sLm2ipWmSeyUZVk-f8exMUcpSWpD0pU7OtPjiA8M,7648
68
+ scriptcollection-4.3.55.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
69
+ scriptcollection-4.3.55.dist-info/entry_points.txt,sha256=SCaysPSowWjcCsPpNgVQIKYfo1I5BMiVI39LTWl4qDI,5915
70
+ scriptcollection-4.3.55.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
71
+ scriptcollection-4.3.55.dist-info/RECORD,,