Skip to content

refactor: no __main__.py — example entry points are main.py - #26

Merged
SuperElectron merged 1 commit into
stagingfrom
feat/v2-main-py
Aug 27, 2026
Merged

refactor: no __main__.py — example entry points are main.py#26
SuperElectron merged 1 commit into
stagingfrom
feat/v2-main-py

Conversation

@SuperElectron

Copy link
Copy Markdown
Owner

Mat's requirement: zero __main__.py in the repo; every example entry point is main.py, run as python -m patterns.<group>.<slug>.examples.<project>.main.

What

  • 32 __main__.pymain.py (git mv, content unchanged — main() + guard kept; the guard fires under -m <pkg>.main).
  • Machine-enforced: the catalog loader raises on any __main__.py inside a unit, with a test — the rule cannot regress.
  • Run command updated across 66 markdown files (unit READMEs, root README, docs, CLAUDE.md/AGENTS.md), 20 test files' imports, sandbox (python -I -m <pkg>.main), list_examples run-hints, fixtures, and the /new-pattern scaffold.

Verification

make check green (548 tests). Install sweep done against this exact state: wheel built, installed into a fresh venv, run from outside the repo — catalog loads 32 patterns, library imports work, examples run via python -m …main, python-design-patterns-mcp console script works, sandbox run_example green. Wheel ships 32 main.py, 0 __main__.py. Repo-wide __main__.py count: 0.

Held for Mat's review.

🤖 Generated with Claude Code

…age>.main

Mat's rule: zero __main__.py in the repo. 32 entry points renamed (content
unchanged, guards kept); run commands, docs, scaffold, and test imports
updated; loader discovers examples by main.py and BANS __main__.py as
debris; sandbox executes <package>.main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@SuperElectron
SuperElectron merged commit 7863d59 into staging Aug 27, 2026
3 checks passed
@SuperElectron
SuperElectron deleted the feat/v2-main-py branch August 27, 2026 21:49
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