From 576ac40f25398d95ef452541386c637e26071dc0 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 2 Dec 2026 11:40:30 +0000 Subject: [PATCH] Update PRE_COMMIT_HOOK_SCRIPT in readme_sync.py to use virtualenv PYTHON_BIN (resolving Pillow ModuleNotFoundError during git commit hooks on VPS) --- README.md | 2 +- .../publishing/readme_sync.py | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 10ceed0..45fc815 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ > **Gitea Commit & Release Telemetry (`v2.17.1` • Namespace `urn:io:hyperstitionstud`)** > - **Repository Role & Public Route:** Shared PEP 420 Python core library (`hyperstitionstud_io.*`), MCP/REST server, `/quant/`, `/learn/`, `/engineering/`, `/math/`, & `/donate/` webroots → [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/) > - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 1 tracked module/artifact surface(s) -> - **Touched Files / Surfaces:** `tests/test_core_suite.py` +> - **Touched Files / Surfaces:** `src/hyperstitionstud_io/publishing/readme_sync.py` > - **Live Verified Ecosystem Metrics (`v2.17.1`):** `6` Repositories • `17` CLI Entrypoints • `20` MCP/REST Tools • `14` URN Resources • `63` Verified Web Routes • `388` KG Nodes / `1,282` Edges • `282` Glossary Entries • `4,943` Offline CMUdict Phonetics • `0` Synthetic Data diff --git a/src/hyperstitionstud_io/publishing/readme_sync.py b/src/hyperstitionstud_io/publishing/readme_sync.py index 41e872b..6cb601b 100644 --- a/src/hyperstitionstud_io/publishing/readme_sync.py +++ b/src/hyperstitionstud_io/publishing/readme_sync.py @@ -502,19 +502,26 @@ REPO_NAME="$(basename "${REPO_ROOT}")" WS_ROOT="$(cd "${REPO_ROOT}/.." && pwd)" CORE_SRC="${WS_ROOT}/hyperstitionstudio-core/src" +PYTHON_BIN="python3" +if [[ -x "${WS_ROOT}/.venv/bin/python3" ]]; then + PYTHON_BIN="${WS_ROOT}/.venv/bin/python3" +elif [[ -x "${WS_ROOT}/hyperstitionstudio-core/.venv/bin/python3" ]]; then + PYTHON_BIN="${WS_ROOT}/hyperstitionstudio-core/.venv/bin/python3" +fi + if [[ -d "${CORE_SRC}" ]]; then export PYTHONPATH="${CORE_SRC}${PYTHONPATH:+:${PYTHONPATH}}" if [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then - python3 -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --stage + "${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --stage else - python3 -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" + "${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" fi - python3 -m hyperstitionstud_io.publishing.closeups_sync + "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.closeups_sync if [[ -d "${WS_ROOT}/hyperstitionstudio-core/site/assets/closeups" ]] && [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then git -C "${REPO_ROOT}" add site/assets/closeups/ fi - python3 -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage - python3 -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}" + "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage + "${PYTHON_BIN}" -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}" fi """