digitalhub 0.14.0b4__py3-none-any.whl → 0.14.0b5__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.
@@ -8,7 +8,10 @@ import os
8
8
  import typing
9
9
  from pathlib import Path
10
10
 
11
+ from digitalhub.entities._commons.enums import EntityTypes
11
12
  from digitalhub.runtimes.enums import RuntimeEnvVar
13
+ from digitalhub.stores.client._base.enums import ApiCategories, BackendOperations
14
+ from digitalhub.utils.exceptions import BackendError
12
15
 
13
16
  if typing.TYPE_CHECKING:
14
17
  from digitalhub.entities.project._base.entity import Project
@@ -58,7 +61,18 @@ class Context:
58
61
  """
59
62
  run_id = os.getenv(RuntimeEnvVar.RUN_ID.value)
60
63
  if run_id is not None:
61
- self.set_run(run_id)
64
+ try:
65
+ api = self.client.build_api(
66
+ category=ApiCategories.CONTEXT.value,
67
+ operation=BackendOperations.READ.value,
68
+ project=self.name,
69
+ entity_type=EntityTypes.RUN.value,
70
+ entity_id=run_id,
71
+ )
72
+ run_key = self.client.read_object(api=api)["key"]
73
+ self.set_run(run_key)
74
+ except BackendError:
75
+ pass
62
76
 
63
77
  def set_run(self, run_ctx: str) -> None:
64
78
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: digitalhub
3
- Version: 0.14.0b4
3
+ Version: 0.14.0b5
4
4
  Summary: Python SDK for Digitalhub
5
5
  Project-URL: Homepage, https://github.com/scc-digitalhub/digitalhub-sdk
6
6
  Author-email: Fondazione Bruno Kessler <digitalhub@fbk.eu>, Matteo Martini <mmartini@fbk.eu>
@@ -1,7 +1,7 @@
1
1
  digitalhub/__init__.py,sha256=6tbbA2AkAzf4lyqTrbxVrw3mVuHje2bZy57NtGevakQ,2475
2
2
  digitalhub/context/api.py,sha256=eIVsYhneu8bEQiUV15sUNlv5WlZu6zV7Dvidvg_0FfA,1500
3
3
  digitalhub/context/builder.py,sha256=_L1R2nas5AqF9XjM-amAsPVupiEvFeSZO-o8YraiDdo,2780
4
- digitalhub/context/context.py,sha256=FBP_3WzsboTJQAbzfLSnd1sp3sWXBh9Hj39agPGa6Hk,2477
4
+ digitalhub/context/context.py,sha256=AC6JF3vz4PGeB4OJT9XIrllrJ3lZ1wA-knuVgA1tWOY,3126
5
5
  digitalhub/entities/__init__.py,sha256=IRY2i9U97wptE3OcC_NO-EBmcAH6-Q36gMCspKetQ0k,107
6
6
  digitalhub/entities/builders.py,sha256=I-RVAFNgnZGmx7Dyz8_n7gfsG-BVgbgfraJal5NWipE,2054
7
7
  digitalhub/entities/_base/__init__.py,sha256=IRY2i9U97wptE3OcC_NO-EBmcAH6-Q36gMCspKetQ0k,107
@@ -265,8 +265,8 @@ digitalhub/utils/logger.py,sha256=hH3gGE35L8jRxrg8EPXGZZAK1OA5-CvWnayuBZzteBM,54
265
265
  digitalhub/utils/store_utils.py,sha256=X6pUywqENNdM-kpPwm67w7qx5-VtTHHIdkCdEwL29AI,1023
266
266
  digitalhub/utils/types.py,sha256=orCxY43zXMJfKZsOj6FUR85u9wRBPJ0wdkzrBHTnVW8,217
267
267
  digitalhub/utils/uri_utils.py,sha256=Go787CxAOo2MMjFIEt8XssomtyV8vTdIrpyjSQK3gAM,4408
268
- digitalhub-0.14.0b4.dist-info/METADATA,sha256=jdHQzB2YD2tB9bpS_xWAD_4WRF-U_S4XPdATclbJPgw,18129
269
- digitalhub-0.14.0b4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
270
- digitalhub-0.14.0b4.dist-info/licenses/AUTHORS,sha256=iDleK_2EAMmh0o8Te_E9mdXQCP4rBfFr9dW9d0-pCno,301
271
- digitalhub-0.14.0b4.dist-info/licenses/LICENSE,sha256=z3xQCHfGmTnigfoUe3uidW_GUSVeFBdos30w9VNTRec,11361
272
- digitalhub-0.14.0b4.dist-info/RECORD,,
268
+ digitalhub-0.14.0b5.dist-info/METADATA,sha256=T-Jit-0nhOgsRyLq4Bz5hopr8KnyKnsDqqJBAYjCvHY,18129
269
+ digitalhub-0.14.0b5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
270
+ digitalhub-0.14.0b5.dist-info/licenses/AUTHORS,sha256=iDleK_2EAMmh0o8Te_E9mdXQCP4rBfFr9dW9d0-pCno,301
271
+ digitalhub-0.14.0b5.dist-info/licenses/LICENSE,sha256=z3xQCHfGmTnigfoUe3uidW_GUSVeFBdos30w9VNTRec,11361
272
+ digitalhub-0.14.0b5.dist-info/RECORD,,