Skip to content

Skip folders when hashing the diagram tools - #139

Merged
markbac merged 1 commit into
mainfrom
fix-tools-revision-skips-folders
Oct 17, 2026
Merged

markbac merged 1 commit into
mainfrom
fix-tools-revision-skips-folders

Conversation

@markbac

@markbac markbac commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

When py-doc is installed with pip (from a wheel or from git, as markbac.github.io's CI does), pip compiles py_doc/diagrams/tools/*.py into a __pycache__ folder. _tools_revision() read every entry of that folder as a file, so every build of a document with a diagram failed: IsADirectoryError on Linux, PermissionError on Windows. It now skips anything that isn't a file.

Found by the glossary migration in markbac/markbac.github.io#3. Its eight Mermaid diagrams fail the CI build without this fix.

Testing

  • New test: adding a __pycache__ folder beside the scripts leaves the revision unchanged. Before the fix it raised.
  • tests/test_diagrams.py: 53 passed. ruff check: clean.

🤖 Generated with Claude Code

pip compiles the scripts in py_doc/diagrams/tools/ into a __pycache__
folder when py-doc is installed from a wheel or from git. _tools_revision()
read every entry as a file, so any document with a diagram failed with
IsADirectoryError (PermissionError on Windows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markbac
markbac merged commit 500a1d5 into main Oct 17, 2026
7 checks passed
@markbac
markbac deleted the fix-tools-revision-skips-folders branch October 19, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant