Add a Python .gitignore - #7
Draft
fafouine wants to merge 1 commit into
Draft
Conversation
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>
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
Adds a standard Python
.gitignoreat the repository root. The repo previously had none, so runningscripts/generate_tag_index.pylocally produces__pycache__/and.pycartifacts 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
.gitignore(new file) at the repo root.No source files, README, or script behavior were changed.
Verification
scripts/generate_tag_index.pyto generatescripts/__pycache__/….pyc, plus a sample.venv/.git status --porcelainlisted only.gitignore; the cache and virtualenv were correctly ignored.git check-ignore -vconfirmed 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