digitalhub 0.13.3__py3-none-any.whl → 0.13.4__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.

Potentially problematic release.


This version of digitalhub might be problematic. Click here for more details.

@@ -8,7 +8,9 @@ import os
8
8
  import typing
9
9
  from pathlib import Path
10
10
 
11
+ from digitalhub.entities._commons.enums import EntityTypes, ApiCategories, BackendOperations
11
12
  from digitalhub.runtimes.enums import RuntimeEnvVar
13
+ from digitalhub.utils.exceptions import BackendError
12
14
 
13
15
  if typing.TYPE_CHECKING:
14
16
  from digitalhub.entities.project._base.entity import Project
@@ -58,7 +60,18 @@ class Context:
58
60
  """
59
61
  run_id = os.getenv(RuntimeEnvVar.RUN_ID.value)
60
62
  if run_id is not None:
61
- self.set_run(run_id)
63
+ try:
64
+ api = self.client.build_api(
65
+ category=ApiCategories.CONTEXT.value,
66
+ operation=BackendOperations.READ.value,
67
+ project=self.name,
68
+ entity_type=EntityTypes.RUN.value,
69
+ entity_id=run_id,
70
+ )
71
+ run_key = self.client.read_object(api=api)["key"]
72
+ self.set_run(run_key)
73
+ except BackendError:
74
+ pass
62
75
 
63
76
  def set_run(self, run_ctx: str) -> None:
64
77
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: digitalhub
3
- Version: 0.13.3
3
+ Version: 0.13.4
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=JrwZhABki1rBFSP3uHBJOckWQiF213_UXuJRoX7QFHA,2572
2
2
  digitalhub/context/api.py,sha256=eIVsYhneu8bEQiUV15sUNlv5WlZu6zV7Dvidvg_0FfA,1500
3
3
  digitalhub/context/builder.py,sha256=NM4xcD2n4jXwdTS2hl3MAobf-BVUQH-9LB6U3J_F3pM,2826
4
- digitalhub/context/context.py,sha256=IXgrLtI6nKp0S9XclqiyiMcsbkTVveNVkkVnURBFvFc,2569
4
+ digitalhub/context/context.py,sha256=3_tbJljm2lB2mpR64gzObhpORUSQOZK8kvlCmp84hqI,3170
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
@@ -252,8 +252,8 @@ digitalhub/utils/io_utils.py,sha256=p2K9VFJGzl3PmXc7GfXKZkPyg5hImduvXlfYVpnsMck,
252
252
  digitalhub/utils/logger.py,sha256=hH3gGE35L8jRxrg8EPXGZZAK1OA5-CvWnayuBZzteBM,545
253
253
  digitalhub/utils/types.py,sha256=orCxY43zXMJfKZsOj6FUR85u9wRBPJ0wdkzrBHTnVW8,217
254
254
  digitalhub/utils/uri_utils.py,sha256=Go787CxAOo2MMjFIEt8XssomtyV8vTdIrpyjSQK3gAM,4408
255
- digitalhub-0.13.3.dist-info/METADATA,sha256=tMGK821-isSqCg_7khZzbRbGZlYy2WEe4MmUwM4RWuY,18026
256
- digitalhub-0.13.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
257
- digitalhub-0.13.3.dist-info/licenses/AUTHORS,sha256=iDleK_2EAMmh0o8Te_E9mdXQCP4rBfFr9dW9d0-pCno,301
258
- digitalhub-0.13.3.dist-info/licenses/LICENSE,sha256=z3xQCHfGmTnigfoUe3uidW_GUSVeFBdos30w9VNTRec,11361
259
- digitalhub-0.13.3.dist-info/RECORD,,
255
+ digitalhub-0.13.4.dist-info/METADATA,sha256=yfhL-VxD-MYGDp88_n_7JdJgU8QifMmTheZh1xsjSyk,18026
256
+ digitalhub-0.13.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
257
+ digitalhub-0.13.4.dist-info/licenses/AUTHORS,sha256=iDleK_2EAMmh0o8Te_E9mdXQCP4rBfFr9dW9d0-pCno,301
258
+ digitalhub-0.13.4.dist-info/licenses/LICENSE,sha256=z3xQCHfGmTnigfoUe3uidW_GUSVeFBdos30w9VNTRec,11361
259
+ digitalhub-0.13.4.dist-info/RECORD,,