spot-sdk-python 2.0.0b5__py3-none-any.whl → 2.0.0b6__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.
spot_sdk/manifest.py CHANGED
@@ -69,6 +69,9 @@ _SETTING_VALUES: dict[SettingType, tuple[type, ...]] = {
69
69
  SettingType.SECRET: (str,),
70
70
  }
71
71
 
72
+ # The setting types whose value can have several lines.
73
+ _MULTILINE_TYPES = (SettingType.STRING, SettingType.SECRET)
74
+
72
75
 
73
76
  class SettingField(BaseModel):
74
77
  """One setting of a plugin, as ``spot.plugin.settings`` declares it.
@@ -78,6 +81,11 @@ class SettingField(BaseModel):
78
81
  an empty one, or one whose values do not fit ``type`` (``integer``: int,
79
82
  never bool; ``number``: int or float, never bool; ``boolean``: bool;
80
83
  ``string``, ``url`` and ``secret``: str).
84
+
85
+ ``multiline`` marks a value of several lines, such as a PEM certificate:
86
+ the dashboard renders a textarea and keeps the line breaks. It is for
87
+ ``string`` and ``secret`` settings only; on any other type it is refused
88
+ in the same way.
81
89
  """
82
90
 
83
91
  type: SettingType
@@ -88,6 +96,10 @@ class SettingField(BaseModel):
88
96
  enum: list[Any] | None = Field(
89
97
  default=None, description="Allowed values, each of the setting's type"
90
98
  )
99
+ multiline: bool = Field(
100
+ default=False,
101
+ description="The value has several lines (a PEM certificate); string and secret only",
102
+ )
91
103
 
92
104
  @model_validator(mode="after")
93
105
  def _check_enum(self) -> Self:
@@ -100,6 +112,14 @@ class SettingField(BaseModel):
100
112
  raise ValueError(f"enum[{index}] does not fit the type {self.type}")
101
113
  return self
102
114
 
115
+ @model_validator(mode="after")
116
+ def _check_multiline(self) -> Self:
117
+ if self.multiline and self.type not in _MULTILINE_TYPES:
118
+ raise ValueError(
119
+ f"multiline is for string and secret settings, not {self.type}"
120
+ )
121
+ return self
122
+
103
123
 
104
124
  def _fits(value: Any, setting_type: SettingType) -> bool:
105
125
  """Whether ``value`` is a value of ``setting_type``."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spot-sdk-python
3
- Version: 2.0.0b5
3
+ Version: 2.0.0b6
4
4
  Summary: SPOT plugin SDK: the plugin contract, the plugin runtime, its clients and test helpers
5
5
  License: Apache-2.0
6
6
  Author: SPOT Project
@@ -50,7 +50,7 @@ plugins share:
50
50
  ## Install
51
51
 
52
52
  ```bash
53
- pip install spot-sdk-python==2.0.0b5
53
+ pip install spot-sdk-python==2.0.0b6
54
54
  ```
55
55
 
56
56
  Python 3.11 to 3.15. Version 2 implements plugin contract 2, for
@@ -9,7 +9,7 @@ spot_sdk/knowledge.py,sha256=FF8VOl1iVIwbsCIYO0IvlFf0oOxhBnDhS64NLqySxJ4,11734
9
9
  spot_sdk/knowledge_tags.py,sha256=BGhDsNeF8Q0MMNEIZjWrgQWjwH_Vf7dGBNN_hlBqTXs,978
10
10
  spot_sdk/llm.py,sha256=1VOwP9PtAkN75c2DEyFcUwwQKUYFpQfUM7vMu4QS3ds,18605
11
11
  spot_sdk/logging.py,sha256=lY-OdTvShp3Vb-1Gmhi88z810YGFhh6y21PbNscBGSg,3907
12
- spot_sdk/manifest.py,sha256=GyGKuNO6k9fk_bOIaxakAvZ1deM2bOznKWBUaQBavKI,5512
12
+ spot_sdk/manifest.py,sha256=Zi5n0B_yvct63ApJ6AExrrHQ114S6Ye9ponmlW-FCgA,6317
13
13
  spot_sdk/mime.py,sha256=t31948EwgbCpu3yMmQyYgVnC7QDpmdOzXoZJuoIgjP4,107484
14
14
  spot_sdk/orchestrator.py,sha256=MCAOV1h7RefcbypjVmrohMpL2_wZ29pelD-E7HBxwO4,2644
15
15
  spot_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -25,6 +25,6 @@ spot_sdk/testing/fake_spot.py,sha256=VF99H9b2CIDe1fd2BFD4d0NX7mtufHLC4YQ8FUutP8Q
25
25
  spot_sdk/testing/views.py,sha256=Su45wOqCQG_O2WcpZhFnCZCLEc8yd9KsUl3YkjvvM9g,1649
26
26
  spot_sdk/verdict.py,sha256=RD12dbXHXHTa-q3-gWlFURrIR6EECoMLZT3AjLlIgbE,1797
27
27
  spot_sdk/workflow.py,sha256=gRvPw8CQKtMhaUoUGPUUXREhNSDlwQ5g901DtAnu08E,6728
28
- spot_sdk_python-2.0.0b5.dist-info/METADATA,sha256=z64-v6wvLuurrl2bynzX54RcoM4rx2yGlUoLdL_s2GA,3873
29
- spot_sdk_python-2.0.0b5.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
30
- spot_sdk_python-2.0.0b5.dist-info/RECORD,,
28
+ spot_sdk_python-2.0.0b6.dist-info/METADATA,sha256=B8e--yR2MBZFFGaN63a2Xmu7qvdDuZe-KL5wYiIgHu8,3873
29
+ spot_sdk_python-2.0.0b6.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
30
+ spot_sdk_python-2.0.0b6.dist-info/RECORD,,