refactor: 重构执行机架构为 Electron 壳内置 Python 运行时子集
将原 webhost 底座的后端、前端、工具等代码迁移至 electron-shell 目录,构建自包含的 Python 环境包,移除冗余的前端代码、旧的后端模块及相关依赖,更新版本号至 1.0.6,优化平台登录态预检逻辑,统一代码结构为单一真源,避免多副本维护问题。
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Build portable Python + environment package (python-env-<version>.zip)
|
||||
# Build portable Python + environment package (python-env-<version>.zip)
|
||||
# ============================================================================
|
||||
# Purpose: give the packaged Electron client a self-contained Python runtime so
|
||||
# plugins and platform-login no longer depend on an external Python install.
|
||||
# - Portable interpreter: python.org embeddable (self-contained) [default]
|
||||
# - Dependencies: pinned to the versions validated in the project .venv
|
||||
# - Runtime subset: webhost/backend/{plugins,core,shared} (minimal for
|
||||
# plugin_runner protocol + platform login)
|
||||
# - Runtime subset: electron-shell/python/webhost/backend/{plugins,core,shared}
|
||||
# (minimal for plugin_runner protocol + platform login; vendored, no webhost dep)
|
||||
# - Output: dist-env/python-env-<version>.zip + .sha256; by default also
|
||||
# installs into electron-shell/python-env/ for local dev (client probes it).
|
||||
# Usage (ASCII-safe, works on Windows PowerShell 5.1 with GBK codepage):
|
||||
@@ -161,23 +161,14 @@ if ($VcCount -lt 3) {
|
||||
throw "VC++ runtime DLLs incomplete ($VcCount): install VC++ 2015-2022 Redistributable x64 on this build machine first"
|
||||
}
|
||||
|
||||
# ---------- 3. webhost runtime subset ----------
|
||||
$Wb = Join-Path $Repo "desktop\webhost\backend"
|
||||
# ---------- 3. webhost runtime subset(单一真源 = electron-shell/python/webhost) ----------
|
||||
$Wb = Join-Path $Shell "python\webhost\backend"
|
||||
$EnvWb = Join-Path $PyDir "webhost\backend"
|
||||
New-Item -ItemType Directory -Force -Path (Join-Path $EnvWb "plugins"), (Join-Path $EnvWb "core"), (Join-Path $EnvWb "shared") | Out-Null
|
||||
|
||||
# top-level __init__ files: minimal (do NOT import the full core, avoids fastapi etc.)
|
||||
Set-Content -Path (Join-Path $PyDir "webhost\__init__.py") -Encoding utf8 -Value @(
|
||||
"# -*- coding: utf-8 -*-"
|
||||
'"""37du env-package runtime (self-contained)."""'
|
||||
)
|
||||
Set-Content -Path (Join-Path $EnvWb "__init__.py") -Encoding utf8 -Value @(
|
||||
"# -*- coding: utf-8 -*-"
|
||||
'"""37du env-package runtime subset (webhost.backend).'
|
||||
'Carries only the minimal modules needed for plugin execution and platform login:'
|
||||
'plugin_runner + plugins + shared + core.auth (+ winjob/job_guard).'
|
||||
'Deliberately does NOT import the full core (scheduler/http/etc. live in Node)."""'
|
||||
)
|
||||
# top-level __init__ files from source(minimal,不 import 完整 core)
|
||||
Copy-Item (Join-Path $Wb "__init__.py") (Join-Path $EnvWb "__init__.py") -Force
|
||||
Copy-Item (Join-Path (Join-Path $Shell "python\webhost") "__init__.py") (Join-Path $PyDir "webhost\__init__.py") -Force
|
||||
|
||||
# core: plugin_runner + auth + winjob + job_guard (no scheduler/http modules)
|
||||
$CoreFiles = @("__init__.py", "plugin_runner.py", "auth.py", "winjob.py", "job_guard.py")
|
||||
|
||||
Reference in New Issue
Block a user