Repository navigation
fix: upgrade BSA to 0.2.5 to fix frozen app anonymisation crashes (#246) - #250
Conversation
Add bank_statement_anonymiser config files (always_anonymise_system.toml, never_anonymise_system.toml) to the explicit include_files list in cx_Freeze. While the BSA v0.2.5+ fix loads configs at import time (avoiding resource extraction issues in frozen apps), this ensures the files are also extracted to disk as a safety net for edge cases. Related to issue #246 - Anonymisation error on macOS frozen app.
Updates BSA dependency to v0.2.5 which includes critical fix for issue #246: frozen app anonymisation crashes on macOS/Windows/Linux. Changes in BSA 0.2.5: - System configs (always_anonymise_system.toml, never_anonymise_system.toml) are now loaded at module import time into cached dicts, fixing frozen app resource loading failures caused by importlib.resources.as_file() context manager cleanup. - API remains backward compatible: bsa.anonymise_pdf() still accepts always_anonymise_path and never_anonymise_path parameters. - All 643 BSA unit tests pass with new config loading behavior. Testing: - ✅ 177 openstan unit tests pass - ✅ 15 anonymise_presenter tests pass (BSA integration layer) - ✅ BSA 0.2.5 library verified: configs loaded at import time - ✅ API compatibility confirmed Fixes: #246
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The lock file pulls in an out-of-scope polars major version upgrade (1.x → 2.0) affecting directly-imported code that needs verification, and the comment insertion in cx_freeze_setup.py left an orphaned sentence fragment.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
This PR upgrades the uk-bank-statement-anonymiser (BSA) dependency from 0.2.4 to 0.2.5 to resolve issue #246, where anonymisation crashed in frozen app bundles (.app/cx_Freeze) because BSA 0.2.4 extracted bundled TOML configs via a short-lived importlib.resources.as_file() context manager that deleted the temp file before use. BSA 0.2.5 loads system configs at import time instead. The PR also hardens cx_freeze_setup.py by explicitly bundling BSA's system TOML config files as a defensive safety net.
Changes:
- Bump
uk-bank-statement-anonymiserto0.2.5inpyproject.tomlanduv.lock. - Add an explicit
include_filesblock incx_freeze_setup.pyto bundlealways_anonymise_system.toml/never_anonymise_system.toml, failing loudly if absent. - Incidental lock-file upgrades to several transitive/dev dependencies, including a
polars1.44.2 → 2.0.0 major version jump.
| File | Description |
|---|---|
| pyproject.toml | Bumps the anonymiser pin to ==0.2.5; clean and consistent with the PR goal. |
| uv.lock | Updates the anonymiser plus several unrelated packages, notably a polars major version bump (1.x → 2.0) that exceeds the stated scope. |
| cx_freeze_setup.py | Adds explicit bundling of BSA config files; insertion accidentally dropped the first line of the following icon-regeneration comment. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add note about regenerating PNG on Linux CI. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
- Update all description: fields to 150-160 chars for Google SERP snippets (30 pages) - Fix zensical blog plugin configuration: post_dir: blog -> post_dir: posts - Move multi-account-bank-export.md into docs/blog/posts/ to resolve build warnings - Add opening paragraphs for AI-summarisability (video-tutorials.md, logging.md) - Add logging cross-links to import/export/anonymise guides for content role clarity - Add See Also / Related Topics sections for internal link hierarchy (5+ links each) - Fix H1->H3 skip in index.md heading hierarchy - zensical build now completes cleanly with zero warnings
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
- Create comprehensive guides index page at docs/guides/index.md with links to all 11 guides - Enable sitemap plugin with asset exclusion to prevent non-page URLs from being indexed - Rename SCREENSHOTS.md → SCREENSHOTS.txt to prevent developer docs from appearing in sitemap - Add comment in mkdocs.yml documenting blog post URL migration (post_dir: blog → posts) - All 43 user-facing pages + 1 blog post now properly indexed in sitemap.xml - Guides index resolves 404 error on /guides/ path; improves internal link hierarchy
Updated the description and fixed links in the guides index. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
…tion - Enable Zensical's built-in redirects plugin - Map old blog post URL /blog/multi-account-bank-export/ to new /blog/posts/multi-account-bank-export/ - Generates proper redirect HTML with meta refresh and JavaScript fallback for GitHub Pages - Ensures old links maintain SEO value (canonical link + redirect) - Handles blog post URL path migration after post_dir config change (blog → posts) Verification: - zensical build completes cleanly with no warnings - Redirect HTML generated at site/blog/multi-account-bank-export/index.html - Canonical link points to new URL for proper SEO handling - Works on GitHub Pages (meta refresh + JavaScript redirect)
76713d3 to
dd9852d
Compare

Fix for Issue #246: Anonymisation Fails on Frozen macOS App
Problem
Anonymisation crashes on the macOS frozen app bundle (.app) with:
This also affects Windows and Linux frozen app bundles (cx_Freeze/PyInstaller).
Root Cause
BSA v0.2.4 used
importlib.resources.as_file()context manager to extract bundled config files. The temporary extracted files were deleted when the context exited, leaving a path to a non-existent file. In frozen apps, this caused immediate crashes because resources are bundled in zip archives and extraction temp files are deleted before anonymise_pdf() can use them.Solution
Upgraded to BSA v0.2.5 which includes the fix:
bsa.anonymise_pdf()still accepts path parametersTesting
Openstan Tests: 177/177 PASSED ✅
BSA Integration Verified ✅
Changes in This PR
pyproject.toml: Bumpeduk-bank-statement-anonymiserfrom 0.2.4 → 0.2.5uv.lock: Updated dependency lock fileRelated PRs
Pre-merge Checklist