mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-05 14:55:08 +00:00
feat(vegas): one declared participation per plugin (scroll | pause | exclude) (#682)
A plugin takes part in Vegas mode in one declared way: 'scroll', 'pause' or 'exclude', resolved from the user's vegas_participation setting, the manifest field, then the legacy hooks, so no plugin changes behaviour. The stream manager decides inclusion and pauses through it; the installed plugins API and the Vegas plugin-order list report it. Deprecates get_supported_vegas_modes, get_vegas_segment_width and vegas_panel_count for removal in 3.9.0, and regenerates docs/DEPRECATIONS_3.8.md to include them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,19 @@ DEPRECATED = {
|
||||
"src.plugin_system.plugin_manager.PluginManager": ["get_enabled_plugins"],
|
||||
}
|
||||
|
||||
#: Deprecated with Vegas participation, for removal in 3.9.0: core never read
|
||||
#: them (src.plugin_system.base_plugin.VEGAS_LEGACY_REMOVAL).
|
||||
DEPRECATED_3_9 = {
|
||||
"src.plugin_system.base_plugin.BasePlugin": [
|
||||
"get_supported_vegas_modes", "get_vegas_segment_width",
|
||||
],
|
||||
}
|
||||
|
||||
#: Every pinned marker: (class path, method) -> the release that removes it.
|
||||
PINNED = {(path, name): removal
|
||||
for removal, table in (("3.8.0", DEPRECATED), ("3.9.0", DEPRECATED_3_9))
|
||||
for path, names in table.items() for name in names}
|
||||
|
||||
|
||||
def _cls(path):
|
||||
import importlib
|
||||
@@ -52,14 +65,14 @@ def _cls(path):
|
||||
return getattr(importlib.import_module(module), name)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", sorted(DEPRECATED))
|
||||
@pytest.mark.parametrize("path", sorted({path for path, _ in PINNED}))
|
||||
def test_exactly_these_methods_are_deprecated(path):
|
||||
cls = _cls(path)
|
||||
marked = sorted(name for name, value in vars(cls).items()
|
||||
if hasattr(value, "__deprecated__"))
|
||||
assert marked == sorted(DEPRECATED[path])
|
||||
assert marked == sorted(name for owner, name in PINNED if owner == path)
|
||||
for name in marked:
|
||||
assert "3.8.0" in getattr(cls, name).__deprecated__
|
||||
assert f"LEDMatrix {PINNED[(path, name)]}" in getattr(cls, name).__deprecated__
|
||||
|
||||
|
||||
def _markers():
|
||||
@@ -82,7 +95,7 @@ def _markers():
|
||||
|
||||
|
||||
def test_markers_are_found():
|
||||
assert len(_markers()) == sum(len(v) for v in DEPRECATED.values())
|
||||
assert len(_markers()) == len(PINNED)
|
||||
|
||||
|
||||
def test_no_marker_names_a_release_already_shipped():
|
||||
@@ -116,8 +129,7 @@ def usage_script():
|
||||
def test_usage_script_lists_exactly_the_pinned_markers(usage_script):
|
||||
found = {(f"{m.module}.{m.owner}", m.method, m.removal)
|
||||
for m in usage_script.find_markers(REPO)}
|
||||
assert found == {(path, name, "3.8.0")
|
||||
for path, names in DEPRECATED.items() for name in names}
|
||||
assert found == {(path, name, removal) for (path, name), removal in PINNED.items()}
|
||||
|
||||
|
||||
def test_usage_script_tells_uses_from_name_collisions(usage_script, tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user