Skip to content

refactor: delete empty __init__.py — namespace packages carry the structure - #25

Merged
SuperElectron merged 2 commits into
stagingfrom
feat/v2-delete-empty-inits
Aug 27, 2026
Merged

refactor: delete empty __init__.py — namespace packages carry the structure#25
SuperElectron merged 2 commits into
stagingfrom
feat/v2-delete-empty-inits

Conversation

@SuperElectron

Copy link
Copy Markdown
Owner

plan-v2 Phase 2 (approved): an MCP catalog that guides agents ships zero non-exemplary code — empty __init__.py marker files are cruft, so they're gone, not just empty.

What

  • 104 empty __init__.py deleted. 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.
  • The loader now rejects empty __init__.py with a message telling you to delete it — the rule is machine-enforced, not aspirational.
  • Toolchain made namespace-native, each change commented with its reason: pytest --import-mode=importlib (same-basename test files), mypy explicit_package_bases + mypy_path (duplicate-basename modules resolve by full path), ruff known-first-party declared (no inits to infer from).
  • CLAUDE.md/AGENTS.md house rule, /new-pattern scaffold, and test fixtures all emit/state the new shape.
  • __main__.py files untouched — correct standard entry points, per Mat.

Verification

make check green (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

SuperElectron and others added 2 commits August 27, 2026 14:23
…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>
@SuperElectron
SuperElectron merged commit f24af1e into staging Aug 27, 2026
3 checks passed
@SuperElectron
SuperElectron deleted the feat/v2-delete-empty-inits branch August 27, 2026 21:33
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.

1 participant