lockss-turtles 0.6.0.dev9__tar.gz → 0.6.0.dev11__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lockss-turtles
3
- Version: 0.6.0.dev9
3
+ Version: 0.6.0.dev11
4
4
  Summary: Library and command line tool to manage LOCKSS plugin sets and LOCKSS plugin registries
5
5
  License: BSD-3-Clause
6
6
  Author: Thib Guicherd-Callin
@@ -28,7 +28,7 @@
28
28
 
29
29
  [project]
30
30
  name = "lockss-turtles"
31
- version = "0.6.0-dev9" # Always change in __init__.py, and at release time in README.rst and CHANGELOG.rst
31
+ version = "0.6.0-dev11" # Always change in __init__.py, and at release time in README.rst and CHANGELOG.rst
32
32
  description = "Library and command line tool to manage LOCKSS plugin sets and LOCKSS plugin registries"
33
33
  license = { text = "BSD-3-Clause" }
34
34
  readme = "README.rst"
@@ -5,7 +5,7 @@ Library and command line tool to manage LOCKSS plugin sets and LOCKSS plugin
5
5
  registries.
6
6
  """
7
7
 
8
- __version__ = '0.6.0-dev9'
8
+ __version__ = '0.6.0-dev11'
9
9
 
10
10
  __copyright__ = '''
11
11
  Copyright (c) 2000-2025, Board of Trustees of Leland Stanford Jr. University
@@ -175,6 +175,11 @@ class PluginRegistryLayer(BaseModel, ABC):
175
175
  name: str = Field(title='Plugin Registry Layer Name', description='A name for the plugin registry layer')
176
176
  path: str = Field(title='Plugin Registry Layer Path', description='A root path for the plugin registry layer')
177
177
 
178
+ _plugin_registry: Optional[PluginRegistry]
179
+
180
+ def deploy_plugin(self, plugin_id: PluginIdentifier, src_path: Path, interactive: bool=False) -> Optional[tuple[Path, Plugin]]:
181
+ self.get_plugin_registry().get_layout().deploy_plugin(plugin_id, self, src_path, interactive)
182
+
178
183
  def get_id(self) -> PluginRegistryLayerIdentifier:
179
184
  return self.id
180
185
 
@@ -187,6 +192,19 @@ class PluginRegistryLayer(BaseModel, ABC):
187
192
  def get_path(self) -> Path:
188
193
  return path(self.path)
189
194
 
195
+ def get_plugin_registry(self) -> PluginRegistry:
196
+ if self._plugin_registry is None:
197
+ raise RuntimeError('Uninitialized plugin registry')
198
+ return self._plugin_registry
199
+
200
+ def initialize(self, plugin_registry: PluginRegistry) -> PluginRegistryLayer:
201
+ self._plugin_registry = plugin_registry
202
+ return self
203
+
204
+ def model_post_init(self, context: Any) -> None:
205
+ super().model_post_init(context)
206
+ self._plugin_registry = None
207
+
190
208
 
191
209
  PluginRegistryKind = Literal['PluginRegistry']
192
210
 
@@ -199,7 +217,7 @@ class PluginRegistry(BaseModelWithRoot):
199
217
  id: PluginRegistryIdentifier = Field(title='Plugin Registry Identifier', description='An identifier for the plugin set')
200
218
  name: str = Field(title='Plugin Registry Name', description='A name for the plugin set')
201
219
  layout: PluginRegistryLayout = Field(title='Plugin Registry Layout', description='A layout for the plugin registry')
202
- layers: list[PluginRegistryLayer] = Field(min_length=1, title='Plugin Registry Layers', description="A non-empty list of plugin registry layers", alias='plugin-registry-layers')
220
+ layers: list[PluginRegistryLayer] = Field(min_length=1, title='Plugin Registry Layers', description="A non-empty list of plugin registry layers")
203
221
  plugin_identifiers: list[PluginIdentifier] = Field(min_length=1, title='Plugin Identifiers', description="A non-empty list of plugin identifiers", alias='plugin-identifiers')
204
222
  suppressed_plugin_identifiers: list[PluginIdentifier] = Field([], title='Suppressed Plugin Identifiers', description="A list of suppressed plugin identifiers", alias='suppressed-plugin-identifiers')
205
223
 
@@ -236,3 +254,5 @@ class PluginRegistry(BaseModelWithRoot):
236
254
  def model_post_init(self, context: Any) -> None:
237
255
  super().model_post_init(context)
238
256
  self.get_layout().initialize(self)
257
+ for layer in self.get_layers():
258
+ layer.initialize(self)