digitalhub 0.14.0b7__py3-none-any.whl → 0.14.1b0__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.

Files changed (68) hide show
  1. digitalhub/__init__.py +2 -2
  2. digitalhub/context/api.py +42 -1
  3. digitalhub/context/context.py +3 -6
  4. digitalhub/entities/_base/context/entity.py +0 -3
  5. digitalhub/entities/_base/material/entity.py +2 -2
  6. digitalhub/entities/_processors/base/crud.py +14 -23
  7. digitalhub/entities/_processors/base/import_export.py +0 -5
  8. digitalhub/entities/_processors/base/processor.py +1 -4
  9. digitalhub/entities/_processors/base/special_ops.py +4 -8
  10. digitalhub/entities/_processors/context/crud.py +5 -5
  11. digitalhub/entities/_processors/context/import_export.py +5 -5
  12. digitalhub/entities/_processors/context/material.py +2 -2
  13. digitalhub/entities/_processors/context/special_ops.py +13 -13
  14. digitalhub/entities/_processors/utils.py +2 -111
  15. digitalhub/entities/function/_base/entity.py +0 -3
  16. digitalhub/entities/project/_base/builder.py +0 -6
  17. digitalhub/entities/project/_base/entity.py +4 -12
  18. digitalhub/entities/project/_base/spec.py +4 -4
  19. digitalhub/entities/project/crud.py +9 -44
  20. digitalhub/entities/project/utils.py +7 -3
  21. digitalhub/entities/workflow/_base/entity.py +0 -5
  22. digitalhub/stores/client/{dhcore/api_builder.py → api_builder.py} +2 -3
  23. digitalhub/stores/client/builder.py +20 -32
  24. digitalhub/stores/client/{dhcore/client.py → client.py} +64 -23
  25. digitalhub/stores/client/{dhcore/configurator.py → configurator.py} +122 -176
  26. digitalhub/stores/client/{_base/enums.py → enums.py} +11 -0
  27. digitalhub/stores/client/{dhcore/http_handler.py → http_handler.py} +4 -5
  28. digitalhub/stores/client/{_base/key_builder.py → key_builder.py} +13 -13
  29. digitalhub/stores/client/{dhcore/params_builder.py → params_builder.py} +51 -12
  30. digitalhub/stores/client/{dhcore/response_processor.py → response_processor.py} +1 -1
  31. digitalhub/stores/client/{dhcore/utils.py → utils.py} +2 -7
  32. digitalhub/stores/{credentials → configurator}/api.py +5 -5
  33. digitalhub/stores/configurator/configurator.py +123 -0
  34. digitalhub/stores/{credentials → configurator}/enums.py +25 -10
  35. digitalhub/stores/configurator/handler.py +213 -0
  36. digitalhub/stores/{credentials → configurator}/ini_module.py +31 -0
  37. digitalhub/stores/data/_base/store.py +0 -4
  38. digitalhub/stores/data/api.py +2 -4
  39. digitalhub/stores/data/builder.py +5 -37
  40. digitalhub/stores/data/s3/configurator.py +30 -114
  41. digitalhub/stores/data/s3/store.py +9 -22
  42. digitalhub/stores/data/sql/configurator.py +49 -71
  43. digitalhub/stores/data/sql/store.py +20 -55
  44. {digitalhub-0.14.0b7.dist-info → digitalhub-0.14.1b0.dist-info}/METADATA +1 -1
  45. {digitalhub-0.14.0b7.dist-info → digitalhub-0.14.1b0.dist-info}/RECORD +51 -66
  46. digitalhub/stores/client/_base/api_builder.py +0 -34
  47. digitalhub/stores/client/_base/client.py +0 -243
  48. digitalhub/stores/client/_base/params_builder.py +0 -82
  49. digitalhub/stores/client/api.py +0 -32
  50. digitalhub/stores/client/dhcore/__init__.py +0 -3
  51. digitalhub/stores/client/dhcore/enums.py +0 -18
  52. digitalhub/stores/client/dhcore/key_builder.py +0 -62
  53. digitalhub/stores/client/local/__init__.py +0 -3
  54. digitalhub/stores/client/local/api_builder.py +0 -116
  55. digitalhub/stores/client/local/client.py +0 -605
  56. digitalhub/stores/client/local/enums.py +0 -15
  57. digitalhub/stores/client/local/key_builder.py +0 -62
  58. digitalhub/stores/client/local/params_builder.py +0 -97
  59. digitalhub/stores/credentials/__init__.py +0 -3
  60. digitalhub/stores/credentials/configurator.py +0 -185
  61. digitalhub/stores/credentials/handler.py +0 -164
  62. digitalhub/stores/credentials/store.py +0 -77
  63. /digitalhub/stores/client/{dhcore/error_parser.py → error_parser.py} +0 -0
  64. /digitalhub/stores/client/{dhcore/header_manager.py → header_manager.py} +0 -0
  65. /digitalhub/stores/{client/_base → configurator}/__init__.py +0 -0
  66. {digitalhub-0.14.0b7.dist-info → digitalhub-0.14.1b0.dist-info}/WHEEL +0 -0
  67. {digitalhub-0.14.0b7.dist-info → digitalhub-0.14.1b0.dist-info}/licenses/AUTHORS +0 -0
  68. {digitalhub-0.14.0b7.dist-info → digitalhub-0.14.1b0.dist-info}/licenses/LICENSE +0 -0
@@ -1,62 +0,0 @@
1
- # SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
4
-
5
- from __future__ import annotations
6
-
7
- from digitalhub.stores.client._base.key_builder import ClientKeyBuilder
8
-
9
-
10
- class ClientDHCoreKeyBuilder(ClientKeyBuilder):
11
- """
12
- Class that build the key of entities.
13
- """
14
-
15
- def base_entity_key(self, entity_id: str) -> str:
16
- """
17
- Build for base entity key.
18
-
19
- Parameters
20
- ----------
21
- entity_id : str
22
- Entity id.
23
-
24
- Returns
25
- -------
26
- str
27
- Key.
28
- """
29
- return f"store://{entity_id}"
30
-
31
- def context_entity_key(
32
- self,
33
- project: str,
34
- entity_type: str,
35
- entity_kind: str,
36
- entity_name: str,
37
- entity_id: str | None = None,
38
- ) -> str:
39
- """
40
- Build for context entity key.
41
-
42
- Parameters
43
- ----------
44
- project : str
45
- Project name.
46
- entity_type : str
47
- Entity type.
48
- entity_kind : str
49
- Entity kind.
50
- entity_name : str
51
- Entity name.
52
- entity_id : str
53
- Entity ID.
54
-
55
- Returns
56
- -------
57
- str
58
- Key.
59
- """
60
- if entity_id is None:
61
- return f"store://{project}/{entity_type}/{entity_kind}/{entity_name}"
62
- return f"store://{project}/{entity_type}/{entity_kind}/{entity_name}:{entity_id}"
@@ -1,3 +0,0 @@
1
- # SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
@@ -1,116 +0,0 @@
1
- # SPDX-FileCopyrightText: © 2025 DSLab - Fondazione Bruno Kessler
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
4
-
5
- from __future__ import annotations
6
-
7
- from digitalhub.stores.client._base.api_builder import ClientApiBuilder
8
- from digitalhub.stores.client._base.enums import ApiCategories, BackendOperations
9
- from digitalhub.stores.client.local.enums import LocalClientVar
10
- from digitalhub.utils.exceptions import BackendError
11
-
12
- API_BASE = "/api/v1"
13
- API_CONTEXT = f"{API_BASE}/-"
14
-
15
-
16
- class ClientLocalApiBuilder(ClientApiBuilder):
17
- """
18
- This class is used to build the API for the Local client.
19
- """
20
-
21
- def build_api(self, category: str, operation: str, **kwargs) -> str:
22
- """
23
- Build the API for the client.
24
-
25
- Parameters
26
- ----------
27
- category : str
28
- API category.
29
- operation : str
30
- API operation.
31
- **kwargs : dict
32
- Additional parameters.
33
-
34
- Returns
35
- -------
36
- str
37
- API formatted.
38
- """
39
- if category == ApiCategories.BASE.value:
40
- return self.build_api_base(operation, **kwargs)
41
- return self.build_api_context(operation, **kwargs)
42
-
43
- def build_api_base(self, operation: str, **kwargs) -> str:
44
- """
45
- Build the base API for the client.
46
-
47
- Parameters
48
- ----------
49
- operation : str
50
- API operation.
51
- **kwargs : dict
52
- Additional parameters.
53
-
54
- Returns
55
- -------
56
- str
57
- API formatted.
58
- """
59
- entity_type = kwargs["entity_type"] + "s"
60
- if operation in (
61
- BackendOperations.CREATE.value,
62
- BackendOperations.LIST.value,
63
- ):
64
- return f"{API_BASE}/{entity_type}"
65
- elif operation in (
66
- BackendOperations.READ.value,
67
- BackendOperations.UPDATE.value,
68
- BackendOperations.DELETE.value,
69
- ):
70
- return f"{API_BASE}/{entity_type}/{kwargs['entity_name']}"
71
- raise BackendError(f"API for operation '{operation}' for entity type '{entity_type}' not implemented in Local.")
72
-
73
- def build_api_context(self, operation: str, **kwargs) -> str:
74
- """
75
- Build the context API for the client.
76
-
77
- Parameters
78
- ----------
79
- operation : str
80
- The API operation.
81
- **kwargs : dict
82
- Additional parameters including project, entity_type, entity_id, etc.
83
-
84
- Returns
85
- -------
86
- str
87
- The formatted context API endpoint.
88
-
89
- Raises
90
- ------
91
- BackendError
92
- If the operation is not supported for the entity type.
93
- """
94
- try:
95
- entity_type = kwargs["entity_type"] + "s"
96
- except KeyError:
97
- pass
98
- project = kwargs["project"]
99
- if operation in (
100
- BackendOperations.CREATE.value,
101
- BackendOperations.LIST.value,
102
- ):
103
- return f"{API_CONTEXT}/{project}/{entity_type}"
104
- elif operation in (
105
- BackendOperations.READ.value,
106
- BackendOperations.UPDATE.value,
107
- BackendOperations.DELETE.value,
108
- ):
109
- return f"{API_CONTEXT}/{project}/{entity_type}/{kwargs['entity_id']}"
110
- elif operation in (
111
- BackendOperations.LOGS.value,
112
- BackendOperations.FILES.value,
113
- BackendOperations.METRICS.value,
114
- ):
115
- return LocalClientVar.EMPTY.value
116
- raise BackendError(f"API for operation '{operation}' for entity type '{entity_type}' not implemented in Local.")