Skip to content

Add a Python .gitignore - #7

Draft
fafouine wants to merge 1 commit into
mainfrom
claude/add-python-gitignore-3b4072e6ebfe81d0b8f200a9a3e5d154
Draft

Add a Python .gitignore#7
fafouine wants to merge 1 commit into
mainfrom
claude/add-python-gitignore-3b4072e6ebfe81d0b8f200a9a3e5d154

Conversation

@fafouine

@fafouine fafouine commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a standard Python .gitignore at the repository root. The repo previously had none, so running scripts/generate_tag_index.py locally produces __pycache__/ and .pyc artifacts that could be committed by accident.

The file is the canonical GitHub Python template, which ignores bytecode caches (__pycache__/, *.py[cod]), virtual environments (.venv/, venv/), and common test/coverage/type-checker artifacts.

Changes

  • Add .gitignore (new file) at the repo root.

No source files, README, or script behavior were changed.

Verification

  • Byte-compiled scripts/generate_tag_index.py to generate scripts/__pycache__/…​.pyc, plus a sample .venv/.
  • git status --porcelain listed only .gitignore; the cache and virtualenv were correctly ignored.
  • git check-ignore -v confirmed the matching rules:
    • .gitignore:2:__pycache__/scripts/__pycache__/generate_tag_index.cpython-311.pyc
    • .gitignore:125:.venv.venv/

Explainer doc

Full background, intuition, code walkthrough, alternatives, and a quiz: Explainer: Add a Python .gitignore

Notion task: Add a Python .gitignore

Add a standard GitHub Python .gitignore at the repo root to prevent
committing local build/tooling artifacts such as __pycache__/, *.pyc,
and virtual environments (e.g. .venv/). Running
scripts/generate_tag_index.py locally produces bytecode caches that
could otherwise be committed by accident.

Co-authored-by: Johanie Martin Lafond <omgwtfgtfoomw@gmail.com>
@fafouine fafouine self-assigned this Aug 6, 2026
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.

2 participants