simple-module-cli 0.0.42__tar.gz → 0.0.43__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/.gitignore +3 -0
  2. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/PKG-INFO +3 -2
  3. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/README.md +1 -1
  4. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/pyproject.toml +2 -1
  5. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/git_source.py +3 -87
  6. simple_module_cli-0.0.43/simple_module_cli/git_versions.py +114 -0
  7. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/package_update.py +1 -1
  8. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/package_update_deps.py +9 -2
  9. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/pypi.py +12 -5
  10. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/pyproject_edit.py +22 -6
  11. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/requirements.py +50 -30
  12. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-database/SKILL.md +6 -3
  13. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +2 -2
  14. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-migrations/SKILL.md +2 -2
  15. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-testing/SKILL.md +30 -0
  16. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/migrations/env.py +3 -2
  17. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/templates/index.html +1 -1
  18. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/update_cmd.py +11 -2
  19. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_add_spec_parse.py +14 -1
  20. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_package_update_pins.py +3 -3
  21. simple_module_cli-0.0.43/tests/test_cli_package_update_release_order.py +97 -0
  22. simple_module_cli-0.0.43/tests/test_cli_package_update_workspace_excludes.py +37 -0
  23. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_pyproject_edit.py +43 -0
  24. simple_module_cli-0.0.43/tests/test_cli_update_release_policy.py +99 -0
  25. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_update_sources.py +43 -0
  26. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_no_framework_deps.py +7 -4
  27. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/LICENSE +0 -0
  28. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/__init__.py +0 -0
  29. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_add_install.py +0 -0
  30. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_add_sources.py +0 -0
  31. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_app_project_manifests.py +0 -0
  32. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_env.py +0 -0
  33. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_local_env.py +0 -0
  34. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_module_build.py +0 -0
  35. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_module_host.py +0 -0
  36. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/_templating.py +0 -0
  37. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/add_cmd.py +0 -0
  38. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/app_project.py +0 -0
  39. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/case.py +0 -0
  40. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/catalog.py +0 -0
  41. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/cli.py +0 -0
  42. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/docker_assets.py +0 -0
  43. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/docker_cmd.py +0 -0
  44. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/framework_repo.py +0 -0
  45. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/migration_recipes/mail_settings.py +0 -0
  46. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/migration_recipes/users_tokens.py +0 -0
  47. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/migrations_cmd.py +0 -0
  48. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/module_cmd.py +0 -0
  49. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/new.py +0 -0
  50. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/openapi_cmd.py +0 -0
  51. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/openapi_types.py +0 -0
  52. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/package_update_npm.py +0 -0
  53. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/pins.py +0 -0
  54. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/plugins.py +0 -0
  55. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/recipes.py +0 -0
  56. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/scaffolding.py +0 -0
  57. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/README.md +0 -0
  58. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-cli/SKILL.md +0 -0
  59. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-conventions/SKILL.md +0 -0
  60. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-creating/SKILL.md +0 -0
  61. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-doctor/SKILL.md +0 -0
  62. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-locales/SKILL.md +0 -0
  63. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-registries/SKILL.md +0 -0
  64. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/skills_cmd.py +0 -0
  65. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
  66. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +0 -0
  67. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +0 -0
  68. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +0 -0
  69. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +0 -0
  70. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
  71. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/dockerignore +0 -0
  72. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/host-flat.Dockerfile +0 -0
  73. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/host.Dockerfile +0 -0
  74. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +0 -0
  75. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/.env.example +0 -0
  76. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/.gitignore +0 -0
  77. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/Makefile +0 -0
  78. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/README.md.tpl +0 -0
  79. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +0 -0
  80. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +0 -0
  81. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/alembic.ini +0 -0
  82. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/app.tsx +0 -0
  83. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
  84. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/module-assets.ts +0 -0
  85. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/package.json.tpl +0 -0
  86. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
  87. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +0 -0
  88. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
  89. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/styles.css +0 -0
  90. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/tsconfig.json +0 -0
  91. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/vite.config.ts +0 -0
  92. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -0
  93. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/main.py +0 -0
  94. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
  95. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
  96. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/pyproject.toml.tpl +0 -0
  97. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/routes.py +0 -0
  98. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -0
  99. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
  100. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/.gitignore +0 -0
  101. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/README.md.tpl +0 -0
  102. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/__init__.py +0 -0
  103. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/constants.py.tpl +0 -0
  104. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
  105. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +0 -0
  106. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/deps.py.tpl +0 -0
  107. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/endpoints/__init__.py +0 -0
  108. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/endpoints/api.py.tpl +0 -0
  109. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/endpoints/views.py.tpl +0 -0
  110. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
  111. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +0 -0
  112. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +0 -0
  113. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/Browse.tsx.tpl +0 -0
  114. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/Create.tsx.tpl +0 -0
  115. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/Edit.tsx.tpl +0 -0
  116. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +0 -0
  117. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -0
  118. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
  119. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/service.py.tpl +0 -0
  120. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/services.py.tpl +0 -0
  121. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/settings.py.tpl +0 -0
  122. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/LICENSE +0 -0
  123. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +0 -0
  124. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Browse.tsx.tpl +0 -0
  125. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Create.tsx.tpl +0 -0
  126. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Edit.tsx.tpl +0 -0
  127. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +0 -0
  128. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -0
  129. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -0
  130. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/package.json.tpl +0 -0
  131. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/pyproject.toml.tpl +0 -0
  132. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/tests/test___PACKAGE__.py.tpl +0 -0
  133. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/tsconfig.json.tpl +0 -0
  134. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/.env.example +0 -0
  135. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/.gitignore +0 -0
  136. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/Makefile +0 -0
  137. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/README.md.tpl +0 -0
  138. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
  139. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/pyproject.toml.tpl +0 -0
  140. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/uv_workspace.py +0 -0
  141. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/simple_module_cli/wizard.py +0 -0
  142. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/conftest.py +0 -0
  143. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_build_packaging.py +0 -0
  144. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_case.py +0 -0
  145. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_add_cmd.py +0 -0
  146. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_add_workspace_member.py +0 -0
  147. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_asset_prerequisites.py +0 -0
  148. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_catalog.py +0 -0
  149. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_catalog_depends_on.py +0 -0
  150. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_docker_assets.py +0 -0
  151. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_docker_persistence_secrets.py +0 -0
  152. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_docker_workers.py +0 -0
  153. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_gen_types_scaffold.py +0 -0
  154. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_git_scan.py +0 -0
  155. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_new.py +0 -0
  156. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_new_dest_tolerance.py +0 -0
  157. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_new_git_module.py +0 -0
  158. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_new_migration_bootstrap.py +0 -0
  159. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_new_regressions.py +0 -0
  160. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_new_scaffold_layout.py +0 -0
  161. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_openapi_export.py +0 -0
  162. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_openapi_gen_types.py +0 -0
  163. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_package_update.py +0 -0
  164. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_package_update_groups.py +0 -0
  165. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_package_update_npm.py +0 -0
  166. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_prepare_data_migrations.py +0 -0
  167. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_prepare_data_postgres.py +0 -0
  168. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_recipes.py +0 -0
  169. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_vite_port_env.py +0 -0
  170. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_wizard.py +0 -0
  171. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_cli_wizard_git.py +0 -0
  172. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_create_module_ci_skip.py +0 -0
  173. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_env_helper.py +0 -0
  174. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_framework_repo_wiring.py +0 -0
  175. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_cmd_build.py +0 -0
  176. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_cmd_e2e.py +0 -0
  177. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_cmd_verify.py +0 -0
  178. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_css_assets.py +0 -0
  179. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_css_build.py +0 -0
  180. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_css_subdir_sources.py +0 -0
  181. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_npm_aliases.py +0 -0
  182. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_module_pages_manifest.py +0 -0
  183. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_plugin_discovery.py +0 -0
  184. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
  185. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffold_rollback.py +0 -0
  186. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffolded_host_setup_wizard.py +0 -0
  187. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffolding_framework_repo.py +0 -0
  188. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffolding_host.py +0 -0
  189. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffolding_module.py +0 -0
  190. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_scaffolding_module_js.py +0 -0
  191. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_skills_cmd.py +0 -0
  192. {simple_module_cli-0.0.42 → simple_module_cli-0.0.43}/tests/test_template_requires_framework.py +0 -0
@@ -22,6 +22,9 @@ node_modules/
22
22
 
23
23
  # Database
24
24
  *.db
25
+ *.db-wal
26
+ *.db-shm
27
+ *.db-journal
25
28
  *.sqlite3
26
29
 
27
30
  # Module-managed runtime state (e.g. uploaded dataset files,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: simple_module_cli
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: Standalone scaffolder for the SimpleModule framework — `smpy new`, `smpy create-module`, plugin host.
5
5
  Project-URL: Homepage, https://github.com/antosubash/simple_module_python
6
6
  Project-URL: Repository, https://github.com/antosubash/simple_module_python
@@ -19,6 +19,7 @@ Classifier: Topic :: Software Development :: Code Generators
19
19
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
20
20
  Classifier: Typing :: Typed
21
21
  Requires-Python: >=3.12
22
+ Requires-Dist: packaging<27,>=23.0
22
23
  Requires-Dist: tomlkit<0.16,>=0.13
23
24
  Requires-Dist: typer<0.28,>=0.12
24
25
  Description-Content-Type: text/markdown
@@ -37,7 +38,7 @@ pipx install simple_module_cli
37
38
  uvx --from simple_module_cli smpy new my-app
38
39
  ```
39
40
 
40
- The package depends only on `typer` and `tomlkit` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
41
+ The package depends only on `typer`, `tomlkit` and `packaging` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
41
42
 
42
43
  ## Usage
43
44
 
@@ -12,7 +12,7 @@ pipx install simple_module_cli
12
12
  uvx --from simple_module_cli smpy new my-app
13
13
  ```
14
14
 
15
- The package depends only on `typer` and `tomlkit` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
15
+ The package depends only on `typer`, `tomlkit` and `packaging` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
16
16
 
17
17
  ## Usage
18
18
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "simple_module_cli"
3
- version = "0.0.42"
3
+ version = "0.0.43"
4
4
  description = "Standalone scaffolder for the SimpleModule framework — `smpy new`, `smpy create-module`, plugin host."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -20,6 +20,7 @@ classifiers = [
20
20
  "Typing :: Typed",
21
21
  ]
22
22
  dependencies = [
23
+ "packaging>=23.0,<27",
23
24
  "typer>=0.12,<0.28",
24
25
  "tomlkit>=0.13,<0.16",
25
26
  ]
@@ -11,15 +11,16 @@ tomlkit alone (see test_no_framework_deps.py); clones are read with tomllib.
11
11
 
12
12
  from __future__ import annotations
13
13
 
14
- import re
15
14
  import subprocess
16
15
  import tomllib
17
- from collections.abc import Callable, Iterable
16
+ from collections.abc import Callable
18
17
  from dataclasses import dataclass
19
18
  from pathlib import Path
20
19
  from typing import Literal
21
20
  from urllib.parse import urlsplit
22
21
 
22
+ from simple_module_cli.git_versions import derive_range, pick_latest_tag, satisfies, version_tuple
23
+
23
24
  __all__ = [
24
25
  "FoundModule",
25
26
  "GitAddSpec",
@@ -94,91 +95,6 @@ def _parse_git(raw: str) -> GitAddSpec:
94
95
  return GitAddSpec(url=body, ref=ref, subdirectory=subdirectory)
95
96
 
96
97
 
97
- # --- version helpers (no `packaging` dep — CLI depends on typer + tomlkit only) ---
98
-
99
-
100
- def version_tuple(v: str) -> tuple[int, ...]:
101
- parts: list[int] = []
102
- for part in v.split("."):
103
- digits = ""
104
- for ch in part:
105
- if ch.isdigit():
106
- digits += ch
107
- else:
108
- break
109
- parts.append(int(digits) if digits else 0)
110
- return tuple(parts)
111
-
112
-
113
- def _cmp(a: str, b: str) -> int:
114
- ta, tb = version_tuple(a), version_tuple(b)
115
- width = max(len(ta), len(tb))
116
- ta += (0,) * (width - len(ta))
117
- tb += (0,) * (width - len(tb))
118
- if ta != tb:
119
- return (ta > tb) - (ta < tb)
120
- pa, pb = _prerelease_key(a), _prerelease_key(b)
121
- return (pa > pb) - (pa < pb)
122
-
123
-
124
- def _prerelease_key(version: str) -> tuple[int, int]:
125
- # shortcut: handles Python a/b/rc suffixes; use a full parser for other version schemes.
126
- match = re.search(r"(alpha|beta|a|b|rc)(\d*)$", version, re.IGNORECASE)
127
- if match is None:
128
- return (3, 0)
129
- return (
130
- {"a": 0, "alpha": 0, "b": 1, "beta": 1, "rc": 2}[match[1].lower()],
131
- int(match[2] or "0"),
132
- )
133
-
134
-
135
- _OPS = ("<=", ">=", "==", "!=", "<", ">")
136
-
137
-
138
- def satisfies(version: str, constraint: str) -> bool:
139
- for clause in constraint.split(","):
140
- clause = clause.strip()
141
- if not clause:
142
- continue
143
- for op in _OPS:
144
- if clause.startswith(op):
145
- bound = clause[len(op) :].strip()
146
- c = _cmp(version, bound)
147
- ok = {
148
- "<=": c <= 0,
149
- ">=": c >= 0,
150
- "==": c == 0,
151
- "!=": c != 0,
152
- "<": c < 0,
153
- ">": c > 0,
154
- }[op]
155
- if not ok:
156
- return False
157
- break
158
- else:
159
- return False
160
- return True
161
-
162
-
163
- def derive_range(version: str) -> str:
164
- major = version_tuple(version)[0]
165
- upper = "1.0" if major == 0 else f"{major + 1}.0"
166
- return f">={version},<{upper}"
167
-
168
-
169
- def pick_latest_tag(tags: Iterable[str], constraint: str | None) -> str | None:
170
- best: str | None = None
171
- for tag in tags:
172
- if not tag.startswith("v") or len(tag) < 2 or not tag[1].isdigit():
173
- continue
174
- ver = tag[1:]
175
- if constraint and not satisfies(ver, constraint):
176
- continue
177
- if best is None or _cmp(ver, best[1:]) > 0:
178
- best = tag
179
- return best
180
-
181
-
182
98
  # --- remote resolution + clone scanning ---
183
99
 
184
100
 
@@ -0,0 +1,114 @@
1
+ """Version policies and release-tag selection for git module sources."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import re
6
+ from collections.abc import Iterable
7
+
8
+ from packaging.version import InvalidVersion
9
+
10
+ from simple_module_cli.requirements import _compare as _cmp
11
+ from simple_module_cli.requirements import (
12
+ _compatible_band,
13
+ _matches_wildcard,
14
+ is_valid_version,
15
+ )
16
+
17
+ # --- version helpers ---
18
+
19
+
20
+ def version_tuple(v: str) -> tuple[int, ...]:
21
+ parts: list[int] = []
22
+ for part in v.split("."):
23
+ digits = ""
24
+ for ch in part:
25
+ if ch.isdigit():
26
+ digits += ch
27
+ else:
28
+ break
29
+ parts.append(int(digits) if digits else 0)
30
+ return tuple(parts)
31
+
32
+
33
+ def _prerelease_key(version: str) -> tuple[int, int]:
34
+ # shortcut: handles Python a/b/rc suffixes; use a full parser for other version schemes.
35
+ match = re.search(r"(alpha|beta|a|b|rc)(\d*)$", version, re.IGNORECASE)
36
+ if match is None:
37
+ return (3, 0)
38
+ return (
39
+ {"a": 0, "alpha": 0, "b": 1, "beta": 1, "rc": 2}[match[1].lower()],
40
+ int(match[2] or "0"),
41
+ )
42
+
43
+
44
+ _OPS = ("<=", ">=", "==", "!=", "~=", "<", ">")
45
+
46
+
47
+ def satisfies(version: str, constraint: str) -> bool:
48
+ for clause in constraint.split(","):
49
+ clause = clause.strip()
50
+ if not clause:
51
+ continue
52
+ for op in _OPS:
53
+ if clause.startswith(op):
54
+ bound = clause[len(op) :].strip()
55
+ if op in ("==", "!=") and bound.endswith(".*"):
56
+ if (op == "==") != _matches_wildcard(version, bound):
57
+ return False
58
+ break
59
+ if op == "<" and _excluded_prerelease(version, bound):
60
+ return False
61
+ try:
62
+ c = _cmp(version, bound)
63
+ except InvalidVersion:
64
+ return False
65
+ if op == "~=":
66
+ band = _compatible_band(bound)
67
+ if c < 0 or band is None or not _matches_wildcard(version, band):
68
+ return False
69
+ break
70
+ ok = {
71
+ "<=": c <= 0,
72
+ ">=": c >= 0,
73
+ "==": c == 0,
74
+ "!=": c != 0,
75
+ "<": c < 0,
76
+ ">": c > 0,
77
+ }[op]
78
+ if not ok:
79
+ return False
80
+ break
81
+ else:
82
+ return False
83
+ return True
84
+
85
+
86
+ def _excluded_prerelease(version: str, bound: str) -> bool:
87
+ """PEP 440: ``<0.4`` excludes ``0.4.0rc1`` unless the bound is itself a pre-release."""
88
+ final = (3, 0)
89
+ if _prerelease_key(version) == final or _prerelease_key(bound) != final:
90
+ return False
91
+ width = max(len(version_tuple(version)), len(version_tuple(bound)))
92
+ pad = (0,) * width
93
+ return (version_tuple(version) + pad)[:width] == (version_tuple(bound) + pad)[:width]
94
+
95
+
96
+ def derive_range(version: str) -> str:
97
+ major = version_tuple(version)[0]
98
+ upper = "1.0" if major == 0 else f"{major + 1}.0"
99
+ return f">={version},<{upper}"
100
+
101
+
102
+ def pick_latest_tag(tags: Iterable[str], constraint: str | None) -> str | None:
103
+ best: str | None = None
104
+ for tag in tags:
105
+ if not tag.startswith("v") or len(tag) < 2 or not tag[1].isdigit():
106
+ continue
107
+ ver = tag[1:]
108
+ if not is_valid_version(ver):
109
+ continue
110
+ if constraint and not satisfies(ver, constraint):
111
+ continue
112
+ if best is None or _cmp(ver, best[1:]) > 0:
113
+ best = tag
114
+ return best
@@ -55,7 +55,7 @@ def _npm_target(cache: dict[str, str | None], skips: list[Skip]) -> tuple[str |
55
55
  if normalize(skip.package) == _CORE:
56
56
  return None, f"simple_module_core not updated ({skip.reason})"
57
57
  latest = next((v for n, v in cache.items() if normalize(n) == _CORE), None)
58
- return latest, None if latest else "simple_module_core not found on PyPI"
58
+ return latest, None if latest else "simple_module_core has no eligible release on PyPI"
59
59
 
60
60
 
61
61
  def _print_summary(changes: list[Change], skips: list[Skip], dry_run: bool) -> None:
@@ -11,6 +11,7 @@ import tomlkit
11
11
  from tomlkit.items import Array
12
12
 
13
13
  from simple_module_cli.requirements import parse_requirement, rewrite_requirement
14
+ from simple_module_cli.uv_workspace import is_workspace_member
14
15
 
15
16
 
16
17
  @dataclass(frozen=True)
@@ -72,7 +73,7 @@ def workspace_member_dirs(root_pyproject: Path, doc: tomlkit.TOMLDocument) -> li
72
73
  out: list[Path] = []
73
74
  for pattern in members:
74
75
  for match in sorted(base.glob(str(pattern))):
75
- if (match / "pyproject.toml").is_file():
76
+ if (match / "pyproject.toml").is_file() and is_workspace_member(base, match):
76
77
  out.append(match / "pyproject.toml")
77
78
  return list(dict.fromkeys(p.resolve() for p in out))
78
79
 
@@ -140,7 +141,13 @@ def process_file(
140
141
  continue
141
142
  latest = cache.get(name)
142
143
  if latest is None:
143
- skips.append(Skip(path, name, "not found on PyPI"))
144
+ skips.append(
145
+ Skip(
146
+ path,
147
+ name,
148
+ "no eligible release on PyPI (missing, or only pre-release/yanked)",
149
+ )
150
+ )
144
151
  continue
145
152
  result = rewrite_requirement(dep_str, latest, loosen=loosen)
146
153
  if result.spec is None:
@@ -14,7 +14,9 @@ import urllib.request
14
14
  from collections.abc import Callable
15
15
  from typing import Any
16
16
 
17
- from simple_module_cli.requirements import version_key
17
+ from packaging.version import Version
18
+
19
+ from simple_module_cli.requirements import is_valid_version
18
20
 
19
21
  __all__ = ["PYPI_URL", "Fetcher", "default_fetcher", "fetch_latest"]
20
22
 
@@ -23,8 +25,8 @@ Fetcher = Callable[[str], dict[str, Any]]
23
25
  PYPI_URL = "https://pypi.org/pypi/{name}/json"
24
26
 
25
27
  # PEP 440 release segments contain only digits + dots; any letter signals
26
- # a pre/post/dev release (a, b, rc, post, dev). Coarser than packaging.version
27
- # but `packaging` isn't a CLI dep (see test_no_framework_deps.py).
28
+ # a pre/post/dev release (a, b, rc, post, dev). Deliberately stricter than
29
+ # ``Version.is_prerelease``, which would let ``.post`` releases through as stable.
28
30
  _PRE_RELEASE_RE = re.compile(r"[a-zA-Z]")
29
31
 
30
32
 
@@ -43,11 +45,16 @@ def fetch_latest(name: str, *, include_pre: bool, fetcher: Fetcher) -> str | Non
43
45
  continue
44
46
  if not include_pre and _PRE_RELEASE_RE.search(version):
45
47
  continue
48
+ if not is_valid_version(version):
49
+ continue
46
50
  candidates.append(version)
47
51
  if candidates:
48
- return max(candidates, key=version_key)
52
+ return max(candidates, key=Version)
53
+ if releases:
54
+ return None
49
55
  info = data.get("info") or {}
50
- return info.get("version")
56
+ fallback = info.get("version")
57
+ return fallback if is_valid_version(fallback) else None
51
58
 
52
59
 
53
60
  def default_fetcher(url: str) -> dict[str, Any]:
@@ -14,6 +14,7 @@ import tomlkit
14
14
  from tomlkit.items import Array, Table
15
15
 
16
16
  from simple_module_cli.git_source import RefInfo
17
+ from simple_module_cli.requirements import parse_requirement
17
18
 
18
19
  __all__ = [
19
20
  "dep_constraint",
@@ -65,20 +66,35 @@ def dep_constraint(doc: tomlkit.TOMLDocument, dist_name: str) -> str | None:
65
66
  idx = _dep_index(deps, dist_name)
66
67
  if idx is None:
67
68
  return None
68
- text = str(deps[idx]).strip()
69
- for i, ch in enumerate(text):
70
- if ch in "<>=!~":
71
- return text[i:].strip()
72
- return None
69
+ parsed = parse_requirement(str(deps[idx]))
70
+ if parsed is None or not parsed.clauses:
71
+ return None
72
+ return ",".join(f"{op}{version}" for op, version in parsed.clauses)
73
73
 
74
74
 
75
- def write_dependency(doc: tomlkit.TOMLDocument, dist_name: str, constraint: str) -> bool:
75
+ def write_dependency(
76
+ doc: tomlkit.TOMLDocument,
77
+ dist_name: str,
78
+ constraint: str,
79
+ *,
80
+ keep_extras_and_marker: bool = False,
81
+ ) -> bool:
82
+ """Write ``dist_name`` + ``constraint``, replacing any existing declaration.
83
+
84
+ ``keep_extras_and_marker`` is for version bumps (``smpy update``): the
85
+ existing extras and environment marker survive and only the version
86
+ changes (#735). ``smpy add`` writes the declaration it was given.
87
+ """
76
88
  deps = _dependencies(doc)
77
89
  entry = f"{dist_name}{constraint}"
78
90
  idx = _dep_index(deps, dist_name)
79
91
  if idx is None:
80
92
  deps.append(entry)
81
93
  return True
94
+ if keep_extras_and_marker:
95
+ parsed = parse_requirement(str(deps[idx]))
96
+ if parsed:
97
+ entry = f"{dist_name}{parsed.extras}{constraint}{parsed.marker}"
82
98
  if str(deps[idx]).strip() == entry:
83
99
  return False
84
100
  deps[idx] = entry
@@ -16,6 +16,9 @@ from __future__ import annotations
16
16
  import re
17
17
  from dataclasses import dataclass
18
18
 
19
+ from packaging.specifiers import InvalidSpecifier, Specifier
20
+ from packaging.version import InvalidVersion, Version
21
+
19
22
  __all__ = ["ParsedRequirement", "RewriteResult", "parse_requirement", "rewrite_requirement"]
20
23
 
21
24
  # Longest-first: ``===`` must win over ``==``, and ``>=`` over ``>``.
@@ -30,8 +33,8 @@ _FLOOR_OPS = frozenset({"==", "===", ">="})
30
33
 
31
34
  #: Suffix marking a PEP 440 wildcard (``==1.4.*``, ``!=1.0.*``). These match on
32
35
  #: a *prefix* of the release segments, so they must never go through the
33
- #: numeric comparison — ``version_key`` maps ``*`` to 0, which would read
34
- #: ``1.0.*`` as ``1.0.0`` and quietly answer the wrong question.
36
+ #: numeric comparison — a numeric compare would read ``1.0.*`` as ``1.0.0`` and
37
+ #: quietly answer the wrong question.
35
38
  _WILDCARD = ".*"
36
39
 
37
40
 
@@ -59,29 +62,42 @@ class RewriteResult:
59
62
  reason: str | None = None
60
63
 
61
64
 
62
- def version_key(version: str) -> tuple[int, ...]:
63
- """Coarse PEP 440 release-segment ordering.
64
-
65
- ``packaging`` isn't a CLI dependency (see ``test_no_framework_deps.py``),
66
- so this compares the numeric release segments only. Good enough to answer
67
- "does the latest release trip this upper bound", which is all it's for.
68
- """
69
- parts: list[int] = []
70
- for part in version.split("."):
71
- digits = re.match(r"\d+", part)
72
- parts.append(int(digits.group()) if digits else 0)
73
- return tuple(parts)
65
+ def is_valid_version(version: str | None) -> bool:
66
+ """Is ``version`` a string PEP 440 can order? ``None`` and legacy spellings are not."""
67
+ try:
68
+ Version(version) # ty: ignore[invalid-argument-type] # None -> TypeError, handled
69
+ except (InvalidVersion, TypeError):
70
+ return False
71
+ return True
74
72
 
75
73
 
76
74
  def _compare(left: str, right: str) -> int:
77
- """Three-way compare two versions on their release segments, zero-padded."""
78
- a, b = version_key(left), version_key(right)
79
- width = max(len(a), len(b))
80
- a += (0,) * (width - len(a))
81
- b += (0,) * (width - len(b))
75
+ """Three-way PEP 440 comparison, including pre/dev/post releases."""
76
+ a, b = Version(left), Version(right)
82
77
  return (a > b) - (a < b)
83
78
 
84
79
 
80
+ def _unparseable(parsed: ParsedRequirement, latest: str) -> str | None:
81
+ """The first version that is not valid PEP 440, or ``None``.
82
+
83
+ Legacy spellings (``==1.x``, ``===local-build``) can't be ordered, so the
84
+ requirement is reported as a skip instead of aborting the whole run.
85
+ """
86
+ for candidate in (
87
+ latest,
88
+ *(v[: -len(_WILDCARD)] if v.endswith(_WILDCARD) else v for _, v in parsed.clauses),
89
+ ):
90
+ if not is_valid_version(candidate):
91
+ return candidate
92
+ for op, version in parsed.clauses:
93
+ if op in ("<", "<=", "!=") and not version.endswith(_WILDCARD):
94
+ try: # a valid Version can still be an invalid bound, e.g. ``<1.0+local``
95
+ Specifier(f"{op}{version}")
96
+ except InvalidSpecifier:
97
+ return version
98
+ return None
99
+
100
+
85
101
  def parse_requirement(spec: str) -> ParsedRequirement | None:
86
102
  """Split a PEP 508 requirement string, or ``None`` if the name is unusable."""
87
103
  base, sep, marker = spec.partition(";")
@@ -117,9 +133,10 @@ def _render(parsed: ParsedRequirement, clauses: tuple[tuple[str, str], ...]) ->
117
133
 
118
134
  def _matches_wildcard(version: str, pattern: str) -> bool:
119
135
  """Does ``version`` fall under a PEP 440 wildcard like ``1.4.*``?"""
120
- prefix = version_key(pattern[: -len(_WILDCARD)])
121
- release = version_key(version)
122
- return len(release) >= len(prefix) and release[: len(prefix)] == prefix
136
+ try:
137
+ return Specifier(f"=={pattern}").contains(version, prereleases=True)
138
+ except InvalidSpecifier:
139
+ return False
123
140
 
124
141
 
125
142
  def _compatible_band(version: str) -> str | None:
@@ -151,13 +168,8 @@ def _allows(op: str, version: str, latest: str) -> bool:
151
168
  if op == "~=":
152
169
  band = _compatible_band(version)
153
170
  return band is not None and _matches_wildcard(latest, band)
154
- cmp = _compare(latest, version)
155
- if op == "<":
156
- return cmp < 0
157
- if op == "<=":
158
- return cmp <= 0
159
- if op == "!=":
160
- return cmp != 0
171
+ if op in ("<", "<=", "!="):
172
+ return Specifier(f"{op}{version}").contains(latest, prereleases=True)
161
173
  # ``>`` — already satisfied by anything newer than the pin.
162
174
  return True
163
175
 
@@ -193,7 +205,11 @@ def _bump(op: str, version: str, latest: str) -> str:
193
205
  if len(parts) < segments:
194
206
  return version
195
207
  candidate = ".".join(parts[:segments])
196
- return candidate if _compare(candidate, version) > 0 else version
208
+ # A pre-release ``latest`` truncates to a release above itself
209
+ # (``1.5.0rc1`` -> ``1.5``), which nothing published satisfies yet.
210
+ if _compare(candidate, version) > 0 and _compare(candidate, latest) <= 0:
211
+ return candidate
212
+ return version
197
213
  if op in _FLOOR_OPS:
198
214
  return latest if _compare(latest, version) > 0 else version
199
215
  return version
@@ -217,6 +233,10 @@ def rewrite_requirement(spec: str, latest: str, *, loosen: bool = False) -> Rewr
217
233
  new = f"{parsed.name}{parsed.extras}>={latest}{parsed.marker}"
218
234
  return RewriteResult(None) if new == spec.strip() else RewriteResult(new)
219
235
 
236
+ bad = _unparseable(parsed, latest)
237
+ if bad is not None:
238
+ return RewriteResult(None, reason=f"unsupported version spelling {bad!r}")
239
+
220
240
  blocker = _excluded_by(parsed, latest)
221
241
  if blocker is not None:
222
242
  return RewriteResult(None, reason=f"{latest} excluded by {blocker}")
@@ -34,7 +34,7 @@ All modules — on Postgres and SQLite alike — share the host's single schema.
34
34
  |---|---|---|
35
35
  | `AuditMixin` | `created_at`, `updated_at`, `created_by`, `updated_by` | `created_at` defaults Python-side (and via `server_default`); `updated_at`/`created_by`/`updated_by` set by the `before_flush` listener from `current_user_id` + timestamp. |
36
36
  | `SoftDeleteMixin` | `is_deleted`, `deleted_at`, `deleted_by` | `session.delete(obj)` → soft-delete; `SELECT` auto-filters deleted rows. |
37
- | `MultiTenantMixin` | `tenant_id` | Auto-populated on insert from `current_tenant_id`. Column is **non-nullable**, so inserting outside any tenant context fails at the DB; creating/mutating a row for a different tenant raises `TenantIsolationError`. `SELECT` auto-scoped when `current_tenant_id` is set. |
37
+ | `MultiTenantMixin` | `tenant_id` | Auto-populated on insert from `current_tenant_id`. Column is **non-nullable**; with `multi_tenant` on, inserting with no bound tenant raises `MissingTenantError` even when `tenant_id` is set explicitly (cross-tenant writes go in `all_tenants()`); creating/mutating a row for a different tenant raises `TenantIsolationError`. `SELECT` auto-scoped when `current_tenant_id` is set. |
38
38
  | `VersionedMixin` | `version: int` | Auto-incremented on update. Use for optimistic concurrency. |
39
39
 
40
40
  List `Base` first; Python MRO handles mixin ordering after that:
@@ -60,10 +60,10 @@ The per-request session opens once, and **the dependency commits or rolls back f
60
60
  | Outcome | What `get_db` does |
61
61
  |---|---|
62
62
  | Request succeeded **and** session has pending writes | `commit()` (one transaction) |
63
- | Request succeeded **and** session is read-only | `rollback()` (cheaper than commit on no-ops) |
63
+ | Request succeeded **and** session is read-only | closes the transaction (rollback; loaded objects stay usable, no expiry) |
64
64
  | Request raised | `rollback()` |
65
65
 
66
- A pending-writes flag is set by an `after_flush` listener and by inspecting `session.new / dirty / deleted`. **Service code must not call `session.commit()`.** Manual commits double-commit on success and break the read-only optimization (which keeps read-only requests out of write-side profiling and pgBouncer transaction stats).
66
+ A pending-writes flag is set by flushes and session-executed INSERT/UPDATE/DELETE (follows savepoints: a rolled-back savepoint's writes no longer count) and by inspecting `session.new / dirty / deleted`. **Service code must not call `session.commit()`.** Manual commits double-commit on success and break the read-only optimization (which keeps read-only requests out of write-side profiling and pgBouncer transaction stats).
67
67
 
68
68
  `session.flush()` is fine and sometimes necessary — use it when you need a DB-assigned primary key mid-request:
69
69
 
@@ -79,6 +79,9 @@ async def create_order(session: AsyncSession, payload: OrderCreate) -> Order:
79
79
  ## Pitfalls
80
80
 
81
81
  - **Setting `tenant_id` manually.** `MultiTenantMixin` populates it on insert from request state (`current_tenant_id`). Setting it to a *different* tenant than the active context raises `TenantIsolationError`; changing it on an existing row raises too.
82
+ - **Legacy bulk APIs on tenant models.** `Session.bulk_save_objects()`, `bulk_insert_mappings()` and `bulk_update_mappings()` raise `TenantIsolationError` on a `MultiTenantMixin` model while a tenant is bound or strict mode is on; use `session.execute(insert(Model), rows)` / `session.execute(update(Model), rows)`, which are scoped. SQLite `INSERT OR REPLACE` into a tenant table and an INSERT embedded as a CTE are refused the same way.
83
+ - **`aliased(Model, <subquery>)` over Core.** A selectable built with `select(Other.__table__)` (or any Core read of a tenant-scoped / soft-deletable table other than the entity's own, or of the entity's own table with `GROUP BY`, `HAVING`, an aggregate or a window function) raises `TenantIsolationError`; build it from ORM entities (`select(Other)`), which the loader criteria scope. Relationships with `secondary=Link.__table__` are scoped in every loader (lazy, joined, selectin, subquery) only when `Link` is a mapped class using the mixins; a bare association `Table` is never filtered.
84
+ - **Objects made persistent in memory.** `make_transient_to_detached()` / `merge(load=False)` objects, and any detached object passed to `session.add()`, have their row's `tenant_id` read (once) before a flush writes them; another tenant's row raises `TenantIsolationError`. Load the row instead.
82
85
  - **Querying `WHERE is_deleted = false` by hand.** The listener already does it. Use `execution_options(include_deleted=True)` only when you genuinely want deleted rows.
83
86
 
84
87
  ## Related skills
@@ -27,7 +27,7 @@ Boot regenerates it too; mid-session adds need the manual call before HMR sees t
27
27
 
28
28
  ## Shared props (no setup needed)
29
29
 
30
- `InertiaLayoutDataMiddleware` populates these on every Inertia response:
30
+ `InertiaLayoutDataMiddleware` prepares these for every page render (lazily: a JSON `/api` call never builds them; code that renders outside `InertiaDep` awaits `resolve_inertia_shared(request)` from `simple_module_hosting.inertia_deps`):
31
31
 
32
32
  | Prop | Shape | Populated from |
33
33
  |---|---|---|
@@ -35,7 +35,7 @@ Boot regenerates it too; mid-session adds need the manual call before HMR sees t
35
35
  | `auth.isAuthenticated` | bool | `request.state.user` presence |
36
36
  | `auth.permissions` | string[] | Roles → permissions expansion via the framework's permission registry |
37
37
  | `menus` | `{ sidebar, adminSidebar, navbar, userDropdown }` | All modules' `register_menu_items()` output, auth/role-filtered |
38
- | `i18n` | `{ locale, supportedLocales, messages }` | Active locale (`request.state.locale`) + flattened message bundle for that locale (`messages` is `null` on Inertia XHR partials when the locale is unchanged) |
38
+ | `i18n` | `{ locale, supportedLocales, audience, messages }` | Active locale (`request.state.locale`) + flattened message bundle for that locale and audience (`messages` is `null` on an Inertia visit whose `X-SM-I18n` header reports the same locale and audience; the host client sends it per tab) |
39
39
 
40
40
  **Typing them in TSX.** A page receives its own props as typed component arguments (`export default function Browse({ items }: Props)`). Shared props are typed globally: `usePage().props.auth` is already a `SharedProps['auth']`. Components and layouts that need page props too use `usePageProps<Props>()` from `@simple-module-py/ui` (it returns `Props & SharedProps & { errors }`). Never write `usePage<{ props: X }>().props as unknown as X`; `make lint` rejects `as unknown as` outside tests unless the line carries `// cast-ok: <reason>`.
41
41
 
@@ -43,9 +43,9 @@ process_revision_directives = make_process_revision_directives(target_metadata)
43
43
  # context.configure(..., render_item=render_item)
44
44
  ```
45
45
 
46
- `build_module_metadata()` walks the `simple_module` entry-point group, imports each module's `models` submodule, and merges every module's per-module `MetaData` into one unified `MetaData`. `make_include_object(metadata)` allowlists only tables owned by installed modules — any host-owned tables (and `alembic_version`) outside the module system are preserved untouched. So one autogenerate call covers every installed module in a single pass; editable installs and wheels behave identically.
46
+ `build_module_metadata()` walks the `simple_module` entry-point group, imports each module's `models` submodule (a missing `models` module is skipped; a missing dependency inside it raises), and merges every module's per-module `MetaData` into one unified `MetaData`. `make_include_object(metadata)` allowlists only tables owned by installed modules — any host-owned tables (and `alembic_version`) outside the module system are preserved untouched. So one autogenerate call covers every installed module in a single pass; editable installs and wheels behave identically.
47
47
 
48
- Two extras matter for correctness: `render_item` collapses SQLModel's `AutoString` to `sa.String` and renders `StrEnum` columns so the generated file imports cleanly, and `make_process_revision_directives` re-emits expression-based (functional) indexes — e.g. `lower(email)` — that autogenerate silently drops under SQLite.
48
+ Two extras matter for correctness: `render_item` collapses SQLModel's `AutoString` to `sa.String` and renders `StrEnum` columns with the runtime type's labels so the generated file imports cleanly, and `make_process_revision_directives` re-emits expression-based (functional) indexes — e.g. `lower(email)` — that autogenerate silently drops under SQLite.
49
49
 
50
50
  All module tables live in the **host's single shared schema** on both Postgres and SQLite (each module still owns its own `MetaData` purely so autogenerate can attribute a table to its module). There is no schema-per-module; `__tablename__` is prefixed with the module name (`orders_order`) to avoid collisions, and a cross-module FK is an ordinary same-schema reference.
51
51
 
@@ -46,6 +46,36 @@ async def test_view_renders_index(authenticated_client):
46
46
 
47
47
  `authenticated_client` already carries the cookie — don't manually pass `cookies=`.
48
48
 
49
+ ## Asserting Inertia pages
50
+
51
+ Use `InertiaPage.from_response(resp)` or `inertia_page(resp)` from
52
+ `simple_module_test` for either an HTML document or an `X-Inertia` JSON page:
53
+
54
+ ```python
55
+ from simple_module_test import inertia_page
56
+
57
+
58
+ async def test_orders_page(authenticated_client):
59
+ resp = await authenticated_client.get("/orders/")
60
+ assert resp.status_code == 200
61
+ page = inertia_page(resp)
62
+ page.assert_component("Orders/Browse").has("orders", count=2)
63
+ page.where("orders.0.id", lambda value: value > 0).missing("secret")
64
+ page.deferred("default", "stats")
65
+ loaded = await page.load_deferred(authenticated_client, "default")
66
+ loaded.has("stats")
67
+ ```
68
+
69
+ Assertions chain and use dot paths into props, including list indices. `where`
70
+ accepts a value or predicate; `assert_url` and `assert_version` check page fields.
71
+ `reload_only(client, *props)`, `reload_except(client, *props)`, and
72
+ `load_deferred(client, group=None)` send the correct Inertia version and partial
73
+ headers. Each returns a new page with the server's response, without merging it
74
+ into the original props; omitting a deferred group loads all advertised groups.
75
+ No fixture is needed. Metadata is available as `deferred_props`, `merge_props`,
76
+ `prepend_props`, `deep_merge_props`, `match_props_on`, `once_props`, `scroll_props`,
77
+ `shared_props`, `rescued_props`, `encrypt_history`, and `clear_history`.
78
+
49
79
  ## Single-test / focused runs
50
80
 
51
81
  ```bash