msw-plugin-api 0.2.4__tar.gz → 0.3.0__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.
@@ -10,5 +10,8 @@ build/
10
10
  .mypy_cache/
11
11
  .ruff_cache/
12
12
 
13
+ # library: do not commit the lockfile
14
+ uv.lock
15
+
13
16
  # hatch-vcs generated version file
14
17
  src/msw_plugin_api/_version.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msw-plugin-api
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: Minimal structural interfaces for MSW plugin packages
5
5
  Project-URL: Homepage, https://github.com/MurineShiftWork/msw-plugin-api
6
6
  Project-URL: Issue Tracker, https://github.com/MurineShiftWork/msw-plugin-api/issues
@@ -0,0 +1 @@
1
+ 0.3.0
@@ -52,7 +52,7 @@ dev = [
52
52
  [tool.commitizen]
53
53
  name = "cz_conventional_commits"
54
54
  version_provider = "commitizen"
55
- version = "0.2.4"
55
+ version = "0.3.0"
56
56
  version_files = ["VERSION"]
57
57
  tag_format = "v$version"
58
58
  update_changelog_on_bump = false
@@ -95,3 +95,42 @@ class HostSessionProtocol(Protocol):
95
95
  def stop(self) -> None:
96
96
  """Stop the recording session on the backend."""
97
97
  ...
98
+
99
+
100
+ @runtime_checkable
101
+ class MetadataProtocol(Protocol):
102
+ """Structural protocol for an MSW metadata section.
103
+
104
+ A metadata addon owns exactly one top-level subtree of the manifest
105
+ ``metadata`` key-tree (e.g. ``metadata.probes``, ``metadata.opto``). It
106
+ keeps its schema in its own package and advertises itself with an entry
107
+ point::
108
+
109
+ [project.entry-points."msw.metadata"]
110
+ probes = "my_package.metadata:ProbesMetadata"
111
+
112
+ MSW core discovers these via ``importlib.metadata`` and checks
113
+ ``isinstance(obj, MetadataProtocol)``, so any object exposing ``subtree``,
114
+ ``schema_version``, and ``validate`` satisfies it (no import of this
115
+ package required). ``validate`` must be non-fatal: it returns a list of
116
+ human-readable warnings and never raises, because ``metadata`` is optional
117
+ and legacy/partial trees must still load.
118
+
119
+ Attributes:
120
+ subtree: The reserved top-level metadata key this addon owns.
121
+ schema_version: The version of this subtree's schema.
122
+ """
123
+
124
+ subtree: str
125
+ schema_version: int
126
+
127
+ def validate(self, block: object) -> list[str]:
128
+ """Validate this addon's metadata subtree.
129
+
130
+ Args:
131
+ block: The value at ``metadata[self.subtree]``.
132
+
133
+ Returns:
134
+ A list of human-readable warnings (empty when valid). Never raises.
135
+ """
136
+ ...
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.2.4'
22
- __version_tuple__ = version_tuple = (0, 2, 4)
21
+ __version__ = version = '0.3.0'
22
+ __version_tuple__ = version_tuple = (0, 3, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -1 +0,0 @@
1
- 0.2.4
File without changes
File without changes