Summary
A freshly-scaffolded host app crashes on first boot with ModuleNotFoundError: No module named 'settings'. The cause is that users/module.py and simple_module_hosting/app_builder.py both call importlib.import_module(\"settings.registration\") at startup, but simple_module_settings (which provides the settings top-level package) is not in the scaffold's default dependency list, and isn't pulled in transitively by simple_module_hosting or simple_module_users either.
Reproduction
uvx --from simple_module_cli sm new my-app --db sqlite --preset standard -y --no-install
cd my-app
# (after working around #105 and #106)
make install
make migrate
uv run python -c "from main import app"
Failure tail:
File ".../site-packages/users/module.py", line 55, in register_settings
register_module_settings = importlib.import_module(
^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.12/importlib/__init__.py", line 90, in _gcd_import
ModuleNotFoundError: No module named 'settings'
Source references
simple_module_hosting/app_builder.py:209-219
# We resolve `settings.registration` via importlib rather than a plain# `from settings.registration import ...`: ..._register_module_settings=importlib.import_module(
"settings.registration"
).register_module_settings
users/module.py:55-58 does the same.
simple_module_settings==0.0.6 is published on PyPI (pip index versions simple-module-settings → 0.0.6) and provides settings/registration.py, so it's clearly the intended provider — it's just not declared.
Generated pyproject.toml deps (no simple_module_settings)
dependencies = [
"simple_module_hosting==0.0.6",
"simple_module_auth==0.0.6",
"simple_module_users==0.0.6",
"simple_module_dashboard==0.0.6",
"simple_module_permissions==0.0.6",
]
Suggested fix
Either:
- Make
simple_module_hosting declare simple_module_settings as a runtime dependency (cleanest — every host needs it because hosting itself imports it), or - Have
sm new add simple_module_settings to the host's dependency list.
(1) is more robust because every module that uses register_module_settings (e.g. users) would otherwise need to depend on it individually.
Workaround
uv add simple_module_settings==0.0.6
Environment
simple_module_cli, simple_module_hosting, simple_module_users all at 0.0.6uv 0.7.5- macOS 25.4.0 (arm64), Python 3.12.10
Summary
A freshly-scaffolded host app crashes on first boot with
ModuleNotFoundError: No module named 'settings'. The cause is thatusers/module.pyandsimple_module_hosting/app_builder.pyboth callimportlib.import_module(\"settings.registration\")at startup, butsimple_module_settings(which provides thesettingstop-level package) is not in the scaffold's default dependency list, and isn't pulled in transitively bysimple_module_hostingorsimple_module_userseither.Reproduction
Failure tail:
Source references
simple_module_hosting/app_builder.py:209-219users/module.py:55-58does the same.simple_module_settings==0.0.6is published on PyPI (pip index versions simple-module-settings→ 0.0.6) and providessettings/registration.py, so it's clearly the intended provider — it's just not declared.Generated
pyproject.tomldeps (nosimple_module_settings)Suggested fix
Either:
simple_module_hostingdeclaresimple_module_settingsas a runtime dependency (cleanest — every host needs it because hosting itself imports it), orsm newaddsimple_module_settingsto the host's dependency list.(1) is more robust because every module that uses
register_module_settings(e.g.users) would otherwise need to depend on it individually.Workaround
Environment
simple_module_cli,simple_module_hosting,simple_module_usersall at 0.0.6uv0.7.5