Skip to content

feat(cli): modules from any git repo — smpy add / smpy update - #266

Merged
antosubash merged 11 commits into
mainfrom
worktree-git-module-sources-spec
Aug 20, 2026
Merged

feat(cli): modules from any git repo — smpy add / smpy update#266
antosubash merged 11 commits into
mainfrom
worktree-git-module-sources-spec

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Makes any git repo (and local path) a first-class module source alongside PyPI, per the approved design in docs/superpowers/specs/2026-08-19-git-module-sources-design.md (implementation plan: docs/superpowers/plans/2026-08-19-git-module-sources.md).

  • smpy add <spec> — accepts a PyPI requirement, git+URL[@tag|branch|sha][#subdirectory=dir], or a local path. Writes a normal named dependency plus a [tool.uv.sources] redirect (tomlkit, format-preserving; nothing written until git resolution succeeds), then runs uv syncsmpy host gen-pagessmpy host sync-js-deps → entry-point verification. Prints a one-line security notice on the first git source and a migration reminder for modules shipping models.
  • Multi-module repos — a git spec without #subdirectory is scanned for packages declaring [project.entry-points.simple_module]; several matches go through an interactive picker or --module a,b / --all.
  • smpy update [name] — moves git-sourced modules to the newest v* semver tag satisfying the host's declared range, group-wise per repo (one repo, one ref). Branch pins re-lock to the newest SHA and are labeled dev-mode; PyPI-sourced names delegate to uv lock --upgrade-package.
  • Wizard / scaffolds — the smpy new wizard gains an 'Add modules from a git URL?' step; smpy new and smpy create-host gain a repeatable --git-module flag.
  • Docs — module-authoring guide reframed to 'PyPI or any git repo' with a new Distributing via git section (lockstep vX.Y.Z tag convention, multi-module layout, private-repo auth); host README template and framework-conventions updated.

No loader or frontend changes needed: entry-point discovery and the npm-alias pipeline were already source-agnostic.

Test plan

  • 45 new CLI tests (spec parsing, ref classification + shallow clone + repo scan against local git fixtures, tomlkit round-trips, add/update flows with injectable runners, wizard + scaffold integration) — no network, CLI deps stay typer+tomlkit only.
  • Full gates green: make test (1945 py + 48 js) and make lint (ruff format/check, ty, Biome, tsc, 300-line cap).
  • Manual smoke: real smpy add git+file://… against a two-module repo wrote both sources sharing one tag; smpy update --dry-run picked up the next tag for the whole group.

https://claude.ai/code/session_01HMniW4BEhpumUTFnWZVKVc

Approved brainstorm outcome: smpy add/update over [tool.uv.sources],
multi-module repo scan, lockstep v* tag convention, wizard integration.
Claude-Session: https://claude.ai/code/session_01HMniW4BEhpumUTFnWZVKVc
@antosubash
antosubash marked this pull request as ready for review August 20, 2026 09:51
@antosubash
antosubash merged commit 72ad9a6 into mainAug 20, 2026
11 checks passed
Sign up for freeto 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

@antosubash