Some checks failed
Build three ZaStoGram APKs / build (arm64-v8a, ZaStoGram-standalone-arm64-v8a, Arm64, arm64) (push) Failing after 17m58s
Build three ZaStoGram APKs / build (armeabi-v7a, ZaStoGram-standalone-armeabi-v7a, Armv7, armv7) (push) Failing after 37m3s
ZaStoGram source guards / guards (push) Failing after 15s
Build three ZaStoGram APKs / build (x86, ZaStoGram-standalone-x86, X86, x86) (push) Has been cancelled
- загрузчик: модуль плагина в sys.modules по __id__, импорт плагинов-библиотек (zwylib, cactuslib, quantahut), обход цикла debugpy.adapter, BasePlugin в пространстве имён, настройки доступны в __init__ - новые модули: markdown_utils, log_utils (self.logger), intents, plugin_settings, plugins_manager, elyx; FilesController в file_utils - extera_utils.classes: настоящие Java-подклассы через DexMaker ProxyBuilder - Elyx: установка .elyx/.eaf, изолированные импорты ElyxPlugins.<id>, assets, strings, settings, wheels, requires - client_utils: account=, get_client/AccountClient, настоящие send_photo/video/audio, replyToMsg по id - хуки: priority, HookResult.params, CANCEL отдельного обновления, приведение результата к типу возврата - метаданные: разбор как в AST, __app_version__ с операторами, __sdk_version__ - общий Markdown-парсер: многострочные блоки кода, `code` без разметки, snake_case, экранирование, цитаты - Java-прослойки com.exteragram: PluginsConstants, engines, pluginInstances, AppUtils, ChatUtils; авто-резолв com.* классов - гард Tools/check_plugin_sdk_runtime.py Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64 lines
1.9 KiB
Python
64 lines
1.9 KiB
Python
#!/usr/bin/env python3
|
|
"""Guard the bundled Python packages expected by common exteraGram plugins."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
BUILD_GRADLE = ROOT / "TMessagesProj" / "build.gradle"
|
|
|
|
REQUIRED_PACKAGES = {
|
|
"beautifulsoup4": "common HTML parsing library listed by exteraGram",
|
|
"debugpy": "debug adapter listed by exteraGram for plugin development",
|
|
"lxml": "common XML/HTML parser listed by exteraGram",
|
|
"packaging": "version parsing dependency used by common plugin libraries",
|
|
"Pillow": "provides PIL for image-processing plugins",
|
|
"PyYAML": "YAML parser listed by exteraGram",
|
|
"pyfiglet": "used by ASCII art generator plugins",
|
|
"requests": "used by networked plugin helpers",
|
|
"typing_extensions": "imported by ZwyLib, the most used library plugin",
|
|
}
|
|
|
|
|
|
def fail(message: str) -> int:
|
|
print("Plugin Python dependency guard failed:", file=sys.stderr)
|
|
print(f"- {message}", file=sys.stderr)
|
|
return 1
|
|
|
|
|
|
def installed_packages(gradle_text: str) -> set[str]:
|
|
packages: set[str] = set()
|
|
for match in re.finditer(r'(?m)^[ \t]*install[ \t]+"([^"]+)"', gradle_text):
|
|
packages.add(match.group(1))
|
|
return packages
|
|
|
|
|
|
def main() -> int:
|
|
try:
|
|
gradle_text = BUILD_GRADLE.read_text(encoding="utf-8")
|
|
except FileNotFoundError:
|
|
return fail(f"Missing {BUILD_GRADLE.relative_to(ROOT)}")
|
|
|
|
found = installed_packages(gradle_text)
|
|
missing = [
|
|
f"{package} ({reason})"
|
|
for package, reason in REQUIRED_PACKAGES.items()
|
|
if package not in found
|
|
]
|
|
|
|
if missing:
|
|
print("Plugin Python dependency guard failed:", file=sys.stderr)
|
|
for item in missing:
|
|
print(f"- Missing Chaquopy pip dependency: {item}", file=sys.stderr)
|
|
return 1
|
|
|
|
print("Plugin Python dependency guard passed")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|