refactor: delete empty __init__.py — namespace packages carry the structure - #25
Merged
Merged
Conversation
…420) Only load-bearing __init__.py remain (64 unit API files + registry's plugin-registration demo). pytest --import-mode=importlib for same-basename tests; mypy explicit_package_bases + mypy_path; ruff known-first-party declared (no __init__ to infer from); loader now REJECTS empty __init__.py and no longer demands example packages be regular packages; fixtures emit the new shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CLAUDE.md template tree + house rule updated (delete, don't create; PEP 420); AGENTS.md regenerated as mirror; /new-pattern scaffolds without empty inits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
plan-v2 Phase 2 (approved): an MCP catalog that guides agents ships zero non-exemplary code — empty
__init__.pymarker files are cruft, so they're gone, not just empty.What
__init__.pydeleted. 65 survive, every one load-bearing: the 64 unit API files (bare PEP 484 re-exports) and registry's plugin-registration demo init. PEP 420 namespace packages carry everything else.__init__.pywith a message telling you to delete it — the rule is machine-enforced, not aspirational.--import-mode=importlib(same-basename test files), mypyexplicit_package_bases+mypy_path(duplicate-basename modules resolve by full path), ruffknown-first-partydeclared (no inits to infer from)./new-patternscaffold, and test fixtures all emit/state the new shape.__main__.pyfiles untouched — correct standard entry points, per Mat.Verification
make checkgreen (547 tests; mypy --strict on 256 files — exactly the pre-change surface minus the 104 deletions, nothing shrunk to pass), import contract live, demos run, all 32 units through the sandbox, wheel inventory matches (128 md / 251 py / 32__main__.py/ 65__init__.py), repo-wide empty-init count: 0.Held for Mat's review.
🤖 Generated with Claude Code