diff --git a/AGENTS.md b/AGENTS.md index 834b3b7..63d75d5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,13 +48,17 @@ The project follows a modular file-per-feature architecture: - `toolbox_base.py` — shared infrastructure (Logger, CommandResult, Color, cprint, Spinner, run/command/prompt helpers) - `features/` — one file per feature, each importing only from `toolbox_base` - `scripts/check.ps1` — unified ruff lint + format check runner -- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging +- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging; version via `str(vers)` not `repr(vers)` (see below) - `.github/workflows/ci.yml` — CI (ruff on push/PR) - `.github/workflows/release.yml` — Release (PyInstaller build on tag) - `README.md` — project documentation written using the `BLANK_README.md` (Best-README-Template) format, covering all 23 menu features, architecture, and production build info - Zero external dependencies; all imports from Python stdlib; ANSI colors for UX - `TOOLBOX_VERSION` read dynamically from `pyproject.toml` via `tomllib` +### PyInstaller Spec: Version File Serialization + +In `LDLWinToolBox.spec`, the version info `VSVersionInfo` object is serialized to `build/version_info.txt` using `str(vers)`, then loaded by `EXE(version=str(vers_file))`. **Must use `str()` not `repr()`** — `repr(vers)` produces qualified names (`versioninfo.VSVersionInfo(...)`) that cannot be `eval()`'d inside PyInstaller's `versioninfo.py` module scope, while `str(vers)` produces unqualified names (`VSVersionInfo(...)`) that match the `pyi-grab_version` format and deserialize correctly. + ## Current Implemented Features ### System Cleanup (1-3) diff --git a/MEMORY.md b/MEMORY.md index 6be6dea..568a65d 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -17,7 +17,7 @@ Last updated: 2026-07-05 - Repository path: `D:\Projects\WinProjects\LDLWinToolBox` - Git remote: `https://github.com/LoveDoLove/LDLWinToolBox.git` - Current branch at scan time: `lovedolove` -- Latest scanned commit: `fbb2701 Refactor into modular architecture + add Low Latency Mode + reorganize menu` +- Latest scanned commit: `d0b50e5 Fix VSVersionInfo deserialization: use str() not repr() for eval-safe format` - Latest repository scan: `2026-07-05`. - License: Apache License 2.0 - Primary executable: `LDLWinToolBox.bat` thin launcher for `ldlwintoolbox.py` via `uv run -- python` @@ -82,7 +82,7 @@ Implemented menu behavior (each feature in its own `features/*.py` file), groupe **Tools (20-22):** 20. View Log History: lists the newest toolbox logs in `logs\`, lets the user choose one of the latest 9 entries, and opens it with paged console viewing. -21. Check for Updates: queries GitHub releases API, compares with local version (1.0.3), opens browser for download if newer. +21. Check for Updates: queries GitHub releases API, compares with local version (1.0.7), opens browser for download if newer. 22. Cleanup Exclusion List: manage JSON-based exclusion list in `config/exclusions.json`; paths matching exclusions are skipped during cleanup. 23. Exit: asks Y/N confirmation, then closes the tool. @@ -111,6 +111,12 @@ The user-listed feature targets below were implemented: Treat the remote `iwr | iex` command as high risk. Do not execute it during analysis. The menu feature requires a clear warning, `KILL` confirmation, and logging. +### 2026-07-05 — PyInstaller Version Fix (v1.0.7) + +- **Bug:** `repr(vers)` writes `versioninfo.VSVersionInfo(...)` (qualified names), but `load_version_info_from_text_file` calls `eval(text)` in `versioninfo.py` module scope where only unqualified names (`VSVersionInfo`, `FixedFileInfo`, etc.) exist — `versioninfo` is not importable from within the module. +- **Fix:** Changed `repr(vers)` → `str(vers)` in `LDLWinToolBox.spec:57`. `str()` produces unqualified names matching the `pyi-grab_version` serialization format that `load_version_info_from_text_file` is designed to parse. +- Bumped version to `1.0.7`, created PR #8 (release-1.0.7 → main), merged. + ### 2026-07-05 (Python) - Modular refactor: split monolithic `ldlwintoolbox.py` into `toolbox_base.py` + `features/` (one file per feature). @@ -177,7 +183,7 @@ Treat the remote `iwr | iex` command as high risk. Do not execute it during anal - `scripts/check.ps1` — unified ruff lint + format + import check runner - `.github/workflows/ci.yml` — CI workflow (Windows + ruff-action) - `.github/workflows/release.yml` — Release workflow (PyInstaller build + GitHub Release) -- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging +- `LDLWinToolBox.spec` — PyInstaller spec for EXE packaging; critical `str(vers)` vs `repr(vers)` fix applied after v1.0.6 release build failure - `README.md` — rewritten using `BLANK_README.md` (Best-README-Template) format, covering all 23 menu features, architecture, and production build info - `memory/2026-07-05.md` — updated with Production Version work log @@ -212,3 +218,4 @@ Four-phase plan to move from feature-complete to production-ready. All phases co - C1: PyInstaller `.spec` at project root - C2: `.github/workflows/release.yml` — auto-build + release on version tag - C3: Version sourced from `pyproject.toml` via `tomllib` at runtime (`TOOLBOX_VERSION`) +- C4 (fix): Version text serialization must use `str(vers)` not `repr(vers)` — see AGENTS.md for root cause. Release v1.0.5 and v1.0.6 builds failed without this fix. Fixed in v1.0.7. diff --git a/README.md b/README.md index 7f10653..1ea0122 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@