Skip to content

fix(cli): pin simple_module_cli in scaffold dev deps so smpy plugins load - #147

Merged
antosubash merged 1 commit into
mainfrom
feature/feat-smpy-users-cli-plugin-simple-module-users-91z72
May 13, 2026
Merged

fix(cli): pin simple_module_cli in scaffold dev deps so smpy plugins load#147
antosubash merged 1 commit into
mainfrom
feature/feat-smpy-users-cli-plugin-simple-module-users-91z72

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Fixes #134smpy users create-admin (and every other module CLI plugin) failed No such command in fresh scaffolds.

  • Root cause: simple_module_cli ships the smpy console script, but scaffolded host pyproject.toml never depended on it. So uv run smpy fell through to the globally-installed uv tool copy, whose isolated venv can't see the project's plugin entry points. The discovery code in simple_module_cli.plugins was correctly wired — it was just iterating an empty group.
  • Fix: Add simple_module_cli=={FRAMEWORK_VERSION} to _APP_PY_DEV_DEPS in framework/cli/simple_module_cli/app_project.py. After smpy new myapp && make install, the project venv has its own smpy and uv run smpy users create-admin … works as advertised.
  • Regression test: test_sm_new_pins_simple_module_cli_as_host_dev_dep asserts the scaffolded host pyproject pins simple_module_cli so this can't silently drift back.

End-to-end verified: scaffolded a fresh app, ran uv sync --all-packages, then uv run smpy users --help — now shows create-admin instead of No such command 'users'.

Note

Existing 0.0.12 scaffolds in the wild need either an upgrade or a manual simple_module_cli entry added to their host [dependency-groups].dev — worth a line in the 0.0.13 release notes.

Test plan

  • uv run pytest framework/cli/tests/ — 106 passed
  • uv run ruff format --check framework/cli/ + uv run ruff check framework/cli/ — clean
  • uv run python scripts/check_file_size.py — 300-line cap OK
  • End-to-end repro: scaffolded /tmp/smpy-test-myapp via smpy new --yes, ran uv sync --all-packages, verified uv run smpy users --help shows create-admin

…load

Without simple_module_cli in the project venv, `uv run smpy` falls back to
the globally-installed `uv tool` copy, whose isolated venv can't see the
project's plugin entry points. As a result `smpy users create-admin`
(and every other module CLI plugin) failed "No such command" in fresh
scaffolds, contradicting what the Installation + Quickstart docs advertise.

Adding `simple_module_cli=={FRAMEWORK_VERSION}` to `_APP_PY_DEV_DEPS` means
`make install` installs smpy into the project venv, so `uv run smpy users
create-admin ...` resolves locally and discovers the entry points.

Closes #134.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: e58c428
Status: ✅  Deploy successful!
Preview URL: https://2b386b74.simple-module-python.pages.dev
Branch Preview URL: https://feature-feat-smpy-users-cli.simple-module-python.pages.dev

View logs

@antosubash
antosubash merged commit d18ad9e into main May 13, 2026
12 checks passed
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.

smpy users create-admin not discovered — CLI plugin from simple_module_users never loads

1 participant