Problem
The org baseline .gitignore (seeded into repos from repo-template) does not exclude Python bytecode. When an agent workflow runs the test suite and then commits the working tree, it silently commits compiled bytecode.
Observed concretely: in petry-projects/incubator#121, dev-lead ran pytest while fixing review comments and committed 11 __pycache__/*.pyc files (pocs/demand-radar/__pycache__/*.cpython-312.pyc and the pytest-cache .pycs under tests/__pycache__/). No reviewer or agent caught it because it's the agent's own byproduct, and nothing in .gitignore prevents it.
This will recur on any Python-touching repo where an agent (or a human running tests) commits broadly — bytecode is non-deterministic noise that bloats diffs and can leak local paths/versions.
Proposal
Add Python bytecode patterns to the standard baseline .gitignore (and/or the backend-python / fullstack stack variants under standards/):
# Python bytecode & caches
__pycache__/
*.py[cod]
.pytest_cache/
Rationale:
__pycache__/ + *.py[cod] covers .pyc/.pyo/.pyd.
.pytest_cache/ covers pytest's own cache dir.
- These are universally safe to ignore (always regenerable), so seeding them fleet-wide has no downside.
Acceptance
- Baseline
.gitignore (and Python stack variants) include the patterns above.
- A fresh repo from
repo-template no longer lets a pytest run's bytecode be committed.
Filed from work on petry-projects/incubator#121, where the gap surfaced.
Problem
The org baseline
.gitignore(seeded into repos fromrepo-template) does not exclude Python bytecode. When an agent workflow runs the test suite and then commits the working tree, it silently commits compiled bytecode.Observed concretely: in
petry-projects/incubator#121,dev-leadranpytestwhile fixing review comments and committed 11__pycache__/*.pycfiles (pocs/demand-radar/__pycache__/*.cpython-312.pycand the pytest-cache.pycs undertests/__pycache__/). No reviewer or agent caught it because it's the agent's own byproduct, and nothing in.gitignoreprevents it.This will recur on any Python-touching repo where an agent (or a human running tests) commits broadly — bytecode is non-deterministic noise that bloats diffs and can leak local paths/versions.
Proposal
Add Python bytecode patterns to the standard baseline
.gitignore(and/or thebackend-python/fullstackstack variants understandards/):Rationale:
__pycache__/+*.py[cod]covers.pyc/.pyo/.pyd..pytest_cache/covers pytest's own cache dir.Acceptance
.gitignore(and Python stack variants) include the patterns above.repo-templateno longer lets apytestrun's bytecode be committed.Filed from work on petry-projects/incubator#121, where the gap surfaced.