From 290c96e712e72e4a529b1e83714b76921e8a91ea Mon Sep 17 00:00:00 2001 From: Mathew Goldsborough <1759329+mgoldsborough@users.noreply.github.com> Date: Wed, 22 Apr 2026 09:31:55 -1000 Subject: [PATCH] Anchor project-only patterns in .mcpbignore template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unanchored gitignore patterns (no leading `/`) match anywhere in the tree — including inside `deps/`. Patterns like `tests/`, `docs/`, or `conftest.py` end up stripping legitimate runtime files from vendored dependencies, breaking imports when the bundle starts. Split the template into two sections: 1. Strip anywhere (`__pycache__`, `*.pyc`, `.DS_Store`) — safe cross-tree hygiene. 2. Project-only (anchored with `/`) — patterns that must only match at the project root. Also drops `conftest.py` (redundant with `/tests/`, and collides with legitimate runtime modules like `beartype._conf.conftest`). --- .mcpbignore | 77 ++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/.mcpbignore b/.mcpbignore index 9370542..6adc87d 100644 --- a/.mcpbignore +++ b/.mcpbignore @@ -1,40 +1,45 @@ -# Development environment -.venv/ -.git/ -.github/ -.pytest_cache/ +# mcpb pack loads this file and treats each pattern as gitignore-style. +# Gitignore rule that bites: a pattern without a leading `/` matches +# anywhere in the tree, including inside `deps/`. Unanchored `conftest.py` +# or `tests/` happily strips vendored `deps//.../conftest.py` and +# breaks imports at runtime. Anchor project-only patterns with `/`. + +# ── Strip anywhere (generated/OS cruft — safe to remove from deps/) ── __pycache__/ *.pyc - -# Cache directories -.ruff_cache/ -.coverage - -# Test files -tests/ - -# Build artifacts -dist/ -build/ -*.egg-info/ +*.pyo +*.pyi +.DS_Store *.mcpb -# Dev config -Makefile -pytest.ini -.env -.env.* - -# Lock files -uv.lock - -# IDE -.vscode/ -.idea/ - -# Docs (not needed in bundle) -CLAUDE.md -CONTRIBUTING.md - -# Images -*.png +# ── Project-only (anchored) ── +/.venv/ +/.git/ +/.github/ +/.claude/ +/.vscode/ +/.idea/ +/.env +/.env.* +/.python-version +/.pytest_cache/ +/.ruff_cache/ +/.ty_cache/ +/.mypy_cache/ +/.coverage +/build/ +/dist/ +/tests/ +/test/ +/e2e/ +/examples/ +/docs/ +/doc/ +/scripts/ +/htmlcov/ +/Makefile +/Dockerfile +/pytest.ini +/uv.lock +/CLAUDE.md +/CONTRIBUTING.md