mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-29 22:24:13 +02:00
Offer Python with the Windows installer, for the MCP server
Most Windows users have no Python, which the MCP server needs. The installer now offers "Python for the AI assistant", unticked by default: the official embeddable package from python.org (3.14.7, ~12 MB, no registry, removed with QElectroTech), in <folder>\mcp\python. The portable folder and the MSI, which pack all of files/, carry it. The workflow downloads it pinned by version and by python.org's own sha256 for the file (checked against python.org's download API), and fails the build on a mismatch. The script stays plain text beside it. Checked under Wine (64-bit, qet-wine-smoke image), on an installer built with makensis 3.10 (0 warnings, strings in all 29 languages): - a silent default install puts mcp\qet_mcp.py in place and no Python; the same installer with the section ticked by default installs it, so the check tells the two apart; - the installed Python runs the installed server: 15 tools listed, qet_project_info on an example answers as on Linux, and the server finds bin\QElectroTech.exe and elements\ by itself. Not checked: a real Windows machine; the CI download step (fork run). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -230,6 +230,20 @@ jobs:
|
||||
# The MCP server finds bin/QElectroTech.exe and elements/ from mcp/.
|
||||
mkdir -p "$FILES/mcp"
|
||||
cp "$GITHUB_WORKSPACE/misc/qet-mcp/qet_mcp.py" "$GITHUB_WORKSPACE/misc/qet-mcp/README.md" "$FILES/mcp/"
|
||||
# Python for it, so Windows users need not install one: the official
|
||||
# embeddable package, pinned by version and checksum (python.org's
|
||||
# own sha256 for this file). The installer offers it unticked; the
|
||||
# portable folder and the MSI carry it.
|
||||
PY_EMBED_VERSION=3.14.7
|
||||
PY_EMBED_SHA256=d297e5ff019966817ad8502465176139f2d3d840fa4ed84b13bed399a6ab1f15
|
||||
PY_ZIP="$GITHUB_WORKSPACE/python-embed.zip"
|
||||
curl -fsSL -o "$PY_ZIP" \
|
||||
"https://www.python.org/ftp/python/$PY_EMBED_VERSION/python-$PY_EMBED_VERSION-embed-amd64.zip"
|
||||
echo "$PY_EMBED_SHA256 $PY_ZIP" | sha256sum -c - \
|
||||
|| { echo "ERROR: embeddable Python checksum mismatch"; exit 1; }
|
||||
python3 -m zipfile -e "$PY_ZIP" "$FILES/mcp/python"
|
||||
[ -f "$FILES/mcp/python/python.exe" ] \
|
||||
|| { echo "ERROR: python.exe missing from the embeddable package"; exit 1; }
|
||||
|
||||
# --- Translations ---
|
||||
# Since PR #751 the .qm files are no longer tracked in git: lrelease
|
||||
|
||||
Reference in New Issue
Block a user