fix: 增加插件 V3t 运行时兼容门禁 (#6475)

* fix(plugin): enforce declared runtime compatibility

* chore(ci): record plugin runtime compatibility edges

---------

Co-authored-by: jxxghp <jxxghp@gmail.com>
This commit is contained in:
InfinityPacer
2026-08-27 07:06:16 +08:00
committed by GitHub
co-authored by jxxghp
parent 627775c090
commit 3b7f8c357d
8 changed files with 119 additions and 5 deletions
+21
View File
@@ -1006,6 +1006,27 @@ class TestPluginHelper:
)
assert not PluginHelper.is_package_plugin_compatible({}, "")
def test_free_threaded_package_compatibility_honors_explicit_v3t_false(
self,
monkeypatch,
) -> None:
"""V3t 只把 package 中明确的 v3t:false 视为运行时不兼容。"""
from app.adapters.external import market as market_module
from app.adapters.external.market import PluginHelper
monkeypatch.setattr(market_module, "is_free_threaded_runtime", lambda: True)
monkeypatch.setattr(
market_module,
"settings",
SimpleNamespace(VERSION_FLAG="v3"),
)
assert PluginHelper.is_package_plugin_compatible({}, "v3")
assert PluginHelper.is_package_plugin_compatible({"v3t": True}, "v3")
assert not PluginHelper.is_package_plugin_compatible(
{"v3t": False}, "v3"
)
def test_get_online_plugins_force_keeps_release_cache_scoped(self, monkeypatch):
"""
全市场刷新不清理 Release 缓存,Release 接口按请求仓库协调刷新两类数据。