Skip to content

chore(gitignore): ignore Python bytecode caches#409

Merged
Daren9m merged 1 commit into
mainfrom
chore/gitignore-python
Jun 13, 2026
Merged

chore(gitignore): ignore Python bytecode caches#409
Daren9m merged 1 commit into
mainfrom
chore/gitignore-python

Conversation

@Daren9m

@Daren9m Daren9m commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

The root .gitignore had no Python section, so python -m py_compile scripts/Build-Registry.py — run by the CI validate.yml workflow and during local registry-build verification — leaves scripts/__pycache__/*.pyc untracked, where a git add -A will stage it. (This happened during the #408 work and the artifact had to be manually unstaged.)

Adds a Python artifacts section after the PowerShell block:

# Python artifacts (Build-Registry.py et al.; py_compile runs in CI)
__pycache__/
*.py[cod]

Verification

Reproduced the exact scenario in a clean worktree:

  • python -m py_compile scripts/Build-Registry.py → creates scripts/__pycache__/Build-Registry.cpython-313.pyc
  • git status --short → shows only M .gitignore; the artifact does not appear
  • git status --ignored → classifies it !! scripts/__pycache__/
  • git check-ignore -v.pyc matches __pycache__/, and a stray foo.pyc matches *.py[cod]

No other files touched.

`python -m py_compile scripts/Build-Registry.py` (run by the CI
validate.yml workflow and during local registry-build verification)
creates scripts/__pycache__/*.pyc, which was not ignored — a `git add -A`
would stage it. Add a Python artifacts section (`__pycache__/`,
`*.py[cod]`). Verified: after compiling, the artifact is classified
ignored (!!) and no longer appears in `git status`.
@Daren9m Daren9m merged commit 793dac7 into main Jun 13, 2026
9 checks passed
@Daren9m Daren9m deleted the chore/gitignore-python branch June 13, 2026 15:04
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