feat: 升级 V3 默认运行时至 Python 3.14 与 Debian Trixie (#6382)

This commit is contained in:
InfinityPacer
2026-08-22 07:16:35 +08:00
committed by GitHub
parent 3b1c0bb93d
commit 3a5947cc88
36 changed files with 149 additions and 1030 deletions
+1 -1
View File
@@ -1485,7 +1485,7 @@
"producers": [
{
"caller": "app.workflow.actions.send_event",
"line": 46
"line": 35
}
]
},
+2 -2
View File
@@ -142,7 +142,7 @@ class BluRayTest(TestCase):
# 测试手动刮削
logger.debug(f"测试手动刮削 {path}")
mock_metadata_nfo.call_count = 0
mock_metadata_nfo.reset_mock()
ScrapingChain().scrape_metadata(
fileitem=fileitem, meta=meta, mediainfo=mediainfo, overwrite=True
)
@@ -151,7 +151,7 @@ class BluRayTest(TestCase):
# 测试自动刮削
logger.debug(f"测试自动刮削 {path}")
mock_metadata_nfo.call_count = 0
mock_metadata_nfo.reset_mock()
ScrapingChain().scrape_metadata_event(
Event(
event_type=EventType.MetadataScrape,
+5 -3
View File
@@ -5,13 +5,15 @@ from pathlib import Path
def test_runtime_image_installs_postgresql_18_client_from_pgdg() -> None:
"""Bookworm 镜像必须从签名的 PGDG 源安装固定主版本客户端。"""
"""Trixie 镜像必须从签名的 PGDG 源安装固定主版本客户端。"""
dockerfile = (
Path(__file__).resolve().parents[1] / "docker" / "Dockerfile"
).read_text(encoding="utf-8")
assert re.search(
r"^FROM python:[^\s]+-slim-bookworm AS base$", dockerfile, re.MULTILINE
r"^FROM python:[^\s]+-slim-trixie@sha256:[0-9a-f]{64} AS base$",
dockerfile,
re.MULTILINE,
)
assert "https://www.postgresql.org/media/keys/ACCC4CF8.asc" in dockerfile
for curl_option in (
@@ -25,7 +27,7 @@ def test_runtime_image_installs_postgresql_18_client_from_pgdg() -> None:
keyring = "/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc"
assert f"chmod 0644 {keyring}" in dockerfile
assert f"signed-by={keyring}" in dockerfile
assert "https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" in dockerfile
assert "https://apt.postgresql.org/pub/repos/apt trixie-pgdg main" in dockerfile
assert re.search(r"^\s+postgresql-client-18 \\$", dockerfile, re.MULTILINE)
assert not re.search(r"^\s+postgresql-client \\$", dockerfile, re.MULTILINE)
+4 -4
View File
@@ -65,12 +65,12 @@ class LocalSetupConfigDirTests(unittest.TestCase):
with patch.object(module, "get_python_version", return_value=(3, 15, 0)):
module.ensure_supported_python("python3.15")
def test_supported_python_rejects_versions_below_3_12(self):
def test_supported_python_rejects_versions_below_3_14(self):
module = load_local_setup_module()
with patch.object(module, "get_python_version", return_value=(3, 11, 9)):
with self.assertRaisesRegex(RuntimeError, r"Python 3\.12\+"):
module.ensure_supported_python("python3.11")
with patch.object(module, "get_python_version", return_value=(3, 13, 9)):
with self.assertRaisesRegex(RuntimeError, r"Python 3\.14\+"):
module.ensure_supported_python("python3.13")
def test_install_deps_installs_browser_runtime(self):
module = load_local_setup_module()
+5 -5
View File
@@ -30,7 +30,7 @@ def test_recreate_commands_use_external_bootstrap_python(tmp_path, arguments):
bin_dir = tmp_path / "bin"
bin_dir.mkdir()
record = tmp_path / "record"
external_python = bin_dir / "python3.12"
external_python = bin_dir / "python3.14"
external_python.write_text(
"#!/bin/sh\n"
"if [ \"$1\" = \"-\" ]; then exit 0; fi\n"
@@ -47,7 +47,7 @@ def test_recreate_commands_use_external_bootstrap_python(tmp_path, arguments):
)
venv_python.write_text(venv_script, encoding="utf-8")
venv_python.chmod(venv_python.stat().st_mode | stat.S_IXUSR)
venv_alias = venv_python.with_name("python3.12")
venv_alias = venv_python.with_name("python3.14")
venv_alias.write_text(venv_script, encoding="utf-8")
venv_alias.chmod(venv_alias.stat().st_mode | stat.S_IXUSR)
@@ -117,7 +117,7 @@ def test_recreate_accepts_explicit_external_python(tmp_path):
("update", "backend", "--recreate"),
],
)
@pytest.mark.parametrize("python_option", [(), ("--python", "python3.12")])
@pytest.mark.parametrize("python_option", [(), ("--python", "python3.14")])
def test_recreate_excludes_custom_venv_from_external_bootstrap(
tmp_path, arguments, python_option
):
@@ -135,8 +135,8 @@ def test_recreate_excludes_custom_venv_from_external_bootstrap(
external_bin = tmp_path / "external-bin"
external_bin.mkdir()
record = tmp_path / "record"
target_python = target_bin / "python3.12"
external_python = external_bin / "python3.12"
target_python = target_bin / "python3.14"
external_python = external_bin / "python3.14"
for python_path in (target_python, external_python):
python_path.write_text(
"#!/bin/sh\n"
+16 -1
View File
@@ -5,7 +5,7 @@ import app
def test_app_installs_known_oss2_invalid_escape_warning_filter():
"""
app 初始化过滤器应覆盖 oss2 在 Python 3.12 下产生的无转义警告。
app 初始化过滤器应覆盖 oss2 的无转义警告。
"""
app._filter_third_party_startup_warnings()
action, message, category, module, lineno = warnings.filters[0]
@@ -15,3 +15,18 @@ def test_app_installs_known_oss2_invalid_escape_warning_filter():
assert category is SyntaxWarning
assert module is None
assert lineno == 0
def test_app_installs_google_genai_python314_warning_filter():
"""app 初始化过滤器应覆盖 Google GenAI SDK 的 Python 3.14 弃用警告。"""
app._filter_third_party_startup_warnings()
assert any(
action == "ignore"
and message.match("'_UnionGenericAlias' is deprecated and slated for removal in Python 3.17")
and category is DeprecationWarning
and module is not None
and module.match("google.genai.types")
and lineno == 0
for action, message, category, module, lineno in warnings.filters
)
+6 -14
View File
@@ -192,20 +192,9 @@ def test_execute_with_inputs_maps_contract_inputs_outputs_and_runtime(monkeypatc
"outputs": [{"name": "downloads", "label": "下载任务", "kind": "list"}],
}
@classmethod
@property
def name(cls) -> str:
return "契约动作"
@classmethod
@property
def description(cls) -> str:
return "测试契约动作"
@classmethod
@property
def data(cls) -> dict:
return {}
name = "契约动作"
description = "测试契约动作"
data = {}
@property
def success(self) -> bool:
@@ -254,5 +243,8 @@ def test_workflow_manager_list_actions_exposes_contract():
actions = manager.list_actions()
assert actions[0]["name"] == "获取RSS资源"
assert actions[0]["description"] == "订阅RSS地址获取资源"
assert isinstance(actions[0]["data"], dict)
assert actions[0]["contract"]["outputs"][0]["name"] == "torrents"
assert actions[0]["contract"]["condition_fields"][0]["label"] == "资源"