Repository navigation
Skip folders when hashing the diagram tools - #139
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/*.pyinto 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
__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