mountaineer 0.5.0.dev2__tar.gz → 0.5.0.dev4__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 (292) hide show
  1. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Cargo.lock +1 -1
  2. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Cargo.toml +1 -1
  3. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Makefile +4 -0
  4. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/PKG-INFO +1 -1
  5. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/cli.py +8 -1
  6. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/root_layout.py +3 -1
  7. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/layout.tsx +3 -1
  8. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/pyproject.toml +1 -0
  9. mountaineer-0.5.0.dev4/docker-compose.test.yml +16 -0
  10. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/views.md +2 -6
  11. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_fields.py +7 -12
  12. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_passthrough_dec.py +3 -5
  13. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_sideeffect_dec.py +7 -11
  14. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/conftest.py +135 -0
  15. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_actions.py +50 -0
  16. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_db_memory_serializer.py +194 -0
  17. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_db_serializer.py +367 -0
  18. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_generator.py +128 -0
  19. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_generics.py +95 -0
  20. mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_handlers.py +142 -0
  21. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_app.py +124 -4
  22. mountaineer-0.5.0.dev4/mountaineer/__tests__/test_generics.py +39 -0
  23. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/fields.py +5 -19
  24. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/passthrough_dec.py +1 -1
  25. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/sideeffect_dec.py +0 -1
  26. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/app.py +152 -12
  27. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/builder.py +1 -1
  28. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/compat.py +4 -1
  29. mountaineer-0.5.0.dev4/mountaineer/generics.py +53 -0
  30. mountaineer-0.5.0.dev4/mountaineer/migrations/__init__.py +0 -0
  31. mountaineer-0.5.0.dev4/mountaineer/migrations/actions.py +532 -0
  32. mountaineer-0.5.0.dev4/mountaineer/migrations/cli.py +195 -0
  33. mountaineer-0.5.0.dev4/mountaineer/migrations/client_io.py +62 -0
  34. mountaineer-0.5.0.dev4/mountaineer/migrations/db_memory_serializer.py +210 -0
  35. mountaineer-0.5.0.dev4/mountaineer/migrations/db_serializer.py +207 -0
  36. mountaineer-0.5.0.dev4/mountaineer/migrations/db_stubs.py +278 -0
  37. mountaineer-0.5.0.dev4/mountaineer/migrations/dependency/__init__.py +1 -0
  38. mountaineer-0.5.0.dev4/mountaineer/migrations/dependency/core/__init__.py +1 -0
  39. mountaineer-0.5.0.dev4/mountaineer/migrations/dependency/core/core.py +10 -0
  40. mountaineer-0.5.0.dev4/mountaineer/migrations/generator.py +226 -0
  41. mountaineer-0.5.0.dev4/mountaineer/migrations/generics.py +88 -0
  42. mountaineer-0.5.0.dev4/mountaineer/migrations/handlers.py +613 -0
  43. mountaineer-0.5.0.dev4/mountaineer/migrations/migration.py +68 -0
  44. mountaineer-0.5.0.dev4/mountaineer/migrations/migrator.py +110 -0
  45. mountaineer-0.5.0.dev4/mountaineer/py.typed +0 -0
  46. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/api.ts +5 -10
  47. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/pyproject.toml +1 -1
  48. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.git-blame-ignore-revs +0 -0
  49. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.gitattributes +0 -0
  50. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/README_SCRIPTS.md +0 -0
  51. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/poetry.lock +0 -0
  52. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/pyproject.toml +0 -0
  53. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/__init__.py +0 -0
  54. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/__tests__/test_update_version.py +0 -0
  55. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/check_dependencies.py +0 -0
  56. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/update_version.py +0 -0
  57. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/workflows/publish_docs.yml +0 -0
  58. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/workflows/test.yml +0 -0
  59. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/workflows/validate.yml +0 -0
  60. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.gitignore +0 -0
  61. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Dockerfile +0 -0
  62. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/LICENSE +0 -0
  63. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/README.md +0 -0
  64. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/README.md +0 -0
  65. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/benchmarking/__init__.py +0 -0
  66. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/benchmarking/simple_render.py +0 -0
  67. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/poetry.lock +0 -0
  68. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/pyproject.toml +0 -0
  69. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/README.md +0 -0
  70. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/__init__.py +0 -0
  71. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/app.py +0 -0
  72. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/config.py +0 -0
  73. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/__init__.py +0 -0
  74. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/complex.py +0 -0
  75. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/detail.py +0 -0
  76. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/home.py +0 -0
  77. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/stream.py +0 -0
  78. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/main.py +0 -0
  79. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/__init__.py +0 -0
  80. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/complex/page.tsx +0 -0
  81. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/detail/page.tsx +0 -0
  82. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/home/page.tsx +0 -0
  83. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/main.css +0 -0
  84. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/stream/page.tsx +0 -0
  85. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/package-lock.json +0 -0
  86. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/package.json +0 -0
  87. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/postcss.config.js +0 -0
  88. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/tailwind.config.js +0 -0
  89. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/poetry.lock +0 -0
  90. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/README.md +0 -0
  91. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__init__.py +0 -0
  92. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/__init__.py +0 -0
  93. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/common.py +0 -0
  94. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/test_builder.py +0 -0
  95. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/test_cli.py +0 -0
  96. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/test_generation.py +0 -0
  97. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/builder.py +0 -0
  98. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/cli.py +0 -0
  99. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/__init__.py +0 -0
  100. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/base.py +0 -0
  101. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/poetry.py +0 -0
  102. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/venv.py +0 -0
  103. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/external.py +0 -0
  104. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/generation.py +0 -0
  105. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/io.py +0 -0
  106. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/.zed/settings.json +0 -0
  107. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/__init__.py +0 -0
  108. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/editor_configs/vim/.vimrc +0 -0
  109. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/editor_configs/vscode/.vscode/settings.json +0 -0
  110. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/editor_configs/zed/pyrightconfig.json +0 -0
  111. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/.env +0 -0
  112. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/.gitignore +0 -0
  113. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/README.md +0 -0
  114. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/__init__.py +0 -0
  115. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/app.py +0 -0
  116. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/cli.py +0 -0
  117. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/config.py +0 -0
  118. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/controllers/__init__.py +0 -0
  119. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/controllers/detail.py +0 -0
  120. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/controllers/home.py +0 -0
  121. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/main.py +0 -0
  122. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/models/__init__.py +0 -0
  123. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/models/detail.py +0 -0
  124. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/__init__.py +0 -0
  125. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/app/detail/page.tsx +0 -0
  126. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/app/home/page.tsx +0 -0
  127. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/app/main.css +0 -0
  128. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/package.json +0 -0
  129. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/postcss.config.js +0 -0
  130. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/views/tailwind.config.js +0 -0
  131. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/docker-compose.yml +0 -0
  132. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/pyproject.toml +0 -0
  133. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/poetry.lock +0 -0
  134. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/pyproject.toml +0 -0
  135. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/.zed/settings.json +0 -0
  136. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/README.md +0 -0
  137. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/CNAME +0 -0
  138. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/actions.md +0 -0
  139. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/api_exception.md +0 -0
  140. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/app-controller.md +0 -0
  141. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/build_plugins/base.md +0 -0
  142. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/build_plugins/javascript.md +0 -0
  143. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/build_plugins/postcss.md +0 -0
  144. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/cli.md +0 -0
  145. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/config.md +0 -0
  146. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/controller.md +0 -0
  147. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/core_dependencies.md +0 -0
  148. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/database/config.md +0 -0
  149. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/database/dependencies.md +0 -0
  150. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/logging.md +0 -0
  151. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/render.md +0 -0
  152. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/ssr.md +0 -0
  153. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/watch_server.md +0 -0
  154. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/client_actions.md +0 -0
  155. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/cma.md +0 -0
  156. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/database.md +0 -0
  157. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/deploy.md +0 -0
  158. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/error_handling.md +0 -0
  159. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/index.md +0 -0
  160. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/internal/core_library.md +0 -0
  161. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/links.md +0 -0
  162. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/final_todo_list.png +0 -0
  163. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/ide_typehints.png +0 -0
  164. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/network_debug.png +0 -0
  165. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/server_side_rendering.png +0 -0
  166. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/metadata.md +0 -0
  167. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/postcss.md +0 -0
  168. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/quickstart.md +0 -0
  169. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/static_analysis.md +0 -0
  170. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/structure.md +0 -0
  171. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/stylesheets/extra.css +0 -0
  172. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/mkdocs.yml +0 -0
  173. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/overrides/partials/footer.html +0 -0
  174. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/poetry.lock +0 -0
  175. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/pyproject.toml +0 -0
  176. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/media/header.png +0 -0
  177. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__init__.py +0 -0
  178. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/__init__.py +0 -0
  179. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/__init__.py +0 -0
  180. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/__init__.py +0 -0
  181. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_build_actions.py +0 -0
  182. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_build_links.py +0 -0
  183. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_build_schemas.py +0 -0
  184. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_builder.py +0 -0
  185. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_typescript.py +0 -0
  186. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/common.py +0 -0
  187. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/conftest.py +0 -0
  188. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/__init__.py +0 -0
  189. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/dependencies/__init__.py +0 -0
  190. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/dependencies/conftest.py +0 -0
  191. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/dependencies/test_core.py +0 -0
  192. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/test_config.py +0 -0
  193. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/test_sqlmodel.py +0 -0
  194. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/dependencies/__init__.py +0 -0
  195. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/dependencies/test_base.py +0 -0
  196. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/__init__.py +0 -0
  197. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/complex_controller_ssr_with_react.js +0 -0
  198. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/home_controller_source_map.js.map +0 -0
  199. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/home_controller_ssr_with_react.js +0 -0
  200. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/__init__.py +0 -0
  201. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/test_javascript.py +0 -0
  202. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/test_postcss.py +0 -0
  203. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/test_source_maps.py +0 -0
  204. {mountaineer-0.5.0.dev2/mountaineer/controllers → mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations}/__init__.py +0 -0
  205. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_annotation_helpers.py +0 -0
  206. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_cache.py +0 -0
  207. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_cli.py +0 -0
  208. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_compat.py +0 -0
  209. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_config.py +0 -0
  210. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_controller.py +0 -0
  211. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_controller_layout.py +0 -0
  212. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_cropper.py +0 -0
  213. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_exceptions.py +0 -0
  214. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_logging.py +0 -0
  215. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_paths.py +0 -0
  216. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_ssr.py +0 -0
  217. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_watch.py +0 -0
  218. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/__init__.py +0 -0
  219. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/annotation_helpers.py +0 -0
  220. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/cache.py +0 -0
  221. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/cli.py +0 -0
  222. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/build_actions.py +0 -0
  223. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/build_links.py +0 -0
  224. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/build_schemas.py +0 -0
  225. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/openapi.py +0 -0
  226. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/typescript.py +0 -0
  227. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/config.py +0 -0
  228. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/console.py +0 -0
  229. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/constants.py +0 -0
  230. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/controller.py +0 -0
  231. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/controller_layout.py +0 -0
  232. /mountaineer-0.5.0.dev2/mountaineer/py.typed → /mountaineer-0.5.0.dev4/mountaineer/controllers/__init__.py +0 -0
  233. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/controllers/exception_controller.py +0 -0
  234. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/cropper.py +0 -0
  235. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/__init__.py +0 -0
  236. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/cli.py +0 -0
  237. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/config.py +0 -0
  238. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/dependencies/__init__.py +0 -0
  239. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/dependencies/core.py +0 -0
  240. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/sqlmodel.py +0 -0
  241. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/validator.py +0 -0
  242. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/__init__.py +0 -0
  243. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/base.py +0 -0
  244. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/core/__init__.py +0 -0
  245. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/core/core.py +0 -0
  246. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/exceptions.py +0 -0
  247. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/io.py +0 -0
  248. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/__init__.py +0 -0
  249. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/base.py +0 -0
  250. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/exceptions.py +0 -0
  251. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/javascript.py +0 -0
  252. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/postcss.py +0 -0
  253. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/source_maps.py +0 -0
  254. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/logging.py +0 -0
  255. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/paths.py +0 -0
  256. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/render.py +0 -0
  257. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/ssr.py +0 -0
  258. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/__init__.py +0 -0
  259. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/live_reload.ts +0 -0
  260. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/ssr_polyfills.js +0 -0
  261. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/test_utilities.py +0 -0
  262. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/__init__.py +0 -0
  263. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/core/exception/page.tsx +0 -0
  264. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/core/layout.tsx +0 -0
  265. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/core/main.css +0 -0
  266. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/package-lock.json +0 -0
  267. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/package.json +0 -0
  268. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/postcss.config.js +0 -0
  269. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/tailwind.config.js +0 -0
  270. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/watch.py +0 -0
  271. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/watch_server.py +0 -0
  272. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/webservice.py +0 -0
  273. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/poetry.lock +0 -0
  274. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/fixtures/complex_sourcemap_mapping.txt +0 -0
  275. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/fixtures/home_controller_ssr_with_react.js +0 -0
  276. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/fixtures/ssr_polyfill_archive.js +0 -0
  277. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/lexers_benchmark.rs +0 -0
  278. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/source_map_benchmark.rs +0 -0
  279. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/ssr_benchmark.rs +0 -0
  280. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/errors.rs +0 -0
  281. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/lexers.rs +0 -0
  282. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/lib.rs +0 -0
  283. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/logging.rs +0 -0
  284. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/source_map.rs +0 -0
  285. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/ssr.rs +0 -0
  286. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/timeout.rs +0 -0
  287. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/Cargo.toml +0 -0
  288. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/build.rs +0 -0
  289. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/go/js_build.go +0 -0
  290. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/go.mod +0 -0
  291. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/go.sum +0 -0
  292. {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/src/lib.rs +0 -0
@@ -535,7 +535,7 @@ dependencies = [
535
535
 
536
536
  [[package]]
537
537
  name = "mountaineer"
538
- version = "0.5.0-dev2"
538
+ version = "0.5.0-dev4"
539
539
  dependencies = [
540
540
  "criterion",
541
541
  "deno_core_icudata",
@@ -15,7 +15,7 @@ harness = false
15
15
 
16
16
  [package]
17
17
  name = "mountaineer"
18
- version = "0.5.0-dev2"
18
+ version = "0.5.0-dev4"
19
19
  edition = "2021"
20
20
 
21
21
  [dependencies]
@@ -95,7 +95,11 @@ lint-validation-scripts:
95
95
 
96
96
  # Tests
97
97
  test-lib:
98
+ (cd $(LIB_DIR) && docker-compose -f docker-compose.test.yml up -d)
99
+ @$(call wait-for-postgres,30,5438)
100
+ @set -e; \
98
101
  $(call test-common,$(LIB_DIR),$(LIB_NAME))
102
+ (cd $(LIB_DIR) && docker-compose -f docker-compose.test.yml down)
99
103
  $(call test-rust-common,$(LIB_DIR),$(LIB_NAME))
100
104
  test-create-mountaineer-app:
101
105
  $(call test-common,$(CREATE_MOUNTAINEER_APP_DIR),$(CREATE_MOUNTAINEER_APP_NAME))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mountaineer
3
- Version: 0.5.0.dev2
3
+ Version: 0.5.0.dev4
4
4
  Requires-Dist: pydantic
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: inflection
@@ -1,5 +1,5 @@
1
1
  from click import command
2
- from mountaineer.cli import handle_runserver, handle_watch
2
+ from mountaineer.cli import handle_build, handle_runserver, handle_watch
3
3
 
4
4
 
5
5
  @command()
@@ -20,3 +20,10 @@ def watch():
20
20
  webcontroller="ci_webapp.app:controller",
21
21
  subscribe_to_mountaineer=True,
22
22
  )
23
+
24
+
25
+ @command()
26
+ def build():
27
+ handle_build(
28
+ webcontroller="ci_webapp.app:controller",
29
+ )
@@ -4,6 +4,7 @@ from mountaineer.actions import sideeffect
4
4
 
5
5
  class RootLayoutRender(RenderBase):
6
6
  layout_value: int
7
+ layout_arg: int
7
8
 
8
9
 
9
10
  class RootLayoutController(LayoutControllerBase):
@@ -13,9 +14,10 @@ class RootLayoutController(LayoutControllerBase):
13
14
  super().__init__()
14
15
  self.layout_value = 0
15
16
 
16
- def render(self) -> RootLayoutRender:
17
+ def render(self, layout_arg: int | None = None) -> RootLayoutRender:
17
18
  return RootLayoutRender(
18
19
  layout_value=self.layout_value,
20
+ layout_arg=layout_arg or 0,
19
21
  )
20
22
 
21
23
  @sideeffect
@@ -6,7 +6,9 @@ const Layout = ({ children }: { children: ReactNode }) => {
6
6
 
7
7
  return (
8
8
  <div className="p-6">
9
- <h1>Layout State: {serverState.layout_value}</h1>
9
+ <h1>
10
+ Layout State: {serverState.layout_value} : {serverState.layout_arg}
11
+ </h1>
10
12
  <div>{children}</div>
11
13
  <div>
12
14
  <button
@@ -14,6 +14,7 @@ mountaineer = { path = "../", develop = true }
14
14
  [tool.poetry.scripts]
15
15
  runserver = "ci_webapp.cli:runserver"
16
16
  watch = "ci_webapp.cli:watch"
17
+ build = "ci_webapp.cli:build"
17
18
 
18
19
  [tool.poetry.group.dev.dependencies]
19
20
  types-setuptools = "^69.0.0.20240125"
@@ -0,0 +1,16 @@
1
+ version: "3.8"
2
+
3
+ services:
4
+ postgres:
5
+ image: postgres:latest
6
+ environment:
7
+ POSTGRES_USER: mountaineer
8
+ POSTGRES_PASSWORD: mysecretpassword
9
+ POSTGRES_DB: mountaineer_test_db
10
+ ports:
11
+ - "5438:5432"
12
+ volumes:
13
+ - postgres_data_test:/var/lib/postgresql/data
14
+
15
+ volumes:
16
+ postgres_data_test:
@@ -239,13 +239,9 @@ app_controller = AppController(...)
239
239
  app_controller.register(RootLayoutController())
240
240
  ```
241
241
 
242
- In general you can implement layout controllers just like you do for pages. But since they're shared across multiple pages there are a few important differences to keep in mind:
242
+ In general you can implement layout controllers just like you do for pages. But since they're shared across multiple child controllers, make sure the keyword arguments you use in your `render` signature don't have any conflicts. Mountaineer will merge these signatures at runtime and check for duplicate keyword names across the layout's child pages. Arguments are allowed to share the same name _and_ type, in which case they will be resolved to the same value. Arguments with conflicting types will raise a `TypeError`.
243
243
 
244
- - Layout controllers will be rendered in an isolated scope. Sideeffects in one layout controller won't affect the others.
245
- - Dependency injections are similarly isolated. They are run in an isolated, synthetic context and not with the same dependency injection parameters that the page uses.
246
- - Layout controllers don't modify the page signature. Query params on layouts won't be extracted, for instance.
247
-
248
- As long as you write your layout controllers without directly referencing the page that they might be wrapping, which is the case for most layouts, you should be good to go.
244
+ It's also worth noting that layout controllers will resolve their dependencies in the same scope as the page controllers. So if you need database access within your layout, you'll receive the same underlying transaction as the page controller. This makes dependency injection a powerful way to save on resources, but be careful to not treat them as isolated objects.
249
245
 
250
246
  ## Typescript Configuration
251
247
 
@@ -1,4 +1,4 @@
1
- from typing import AsyncIterator, Iterator, Optional, Type, cast
1
+ from typing import AsyncIterator, Iterator, Optional, Type
2
2
 
3
3
  import pytest
4
4
  from fastapi.responses import JSONResponse
@@ -124,24 +124,19 @@ def test_fuse_metadata_to_response_typehint(
124
124
  metadata, sample_controller, render_model
125
125
  )
126
126
 
127
- assert "ExampleController" in raw_model.model_fields.keys()
128
-
129
- fused_model = cast(
130
- BaseModel, raw_model.model_fields["ExampleController"].annotation
131
- )
132
127
  if expected_sideeffect_fields:
133
- assert "sideeffect" in fused_model.model_fields.keys()
134
- assert fused_model.model_fields["sideeffect"].annotation
128
+ assert "sideeffect" in raw_model.model_fields.keys()
129
+ assert raw_model.model_fields["sideeffect"].annotation
135
130
  basic_compare_model_fields(
136
- fused_model.model_fields["sideeffect"].annotation.model_fields,
131
+ raw_model.model_fields["sideeffect"].annotation.model_fields,
137
132
  expected_sideeffect_fields,
138
133
  )
139
134
 
140
135
  if expected_passthrough_fields:
141
- assert "passthrough" in fused_model.model_fields.keys()
142
- assert fused_model.model_fields["passthrough"].annotation
136
+ assert "passthrough" in raw_model.model_fields.keys()
137
+ assert raw_model.model_fields["passthrough"].annotation
143
138
  basic_compare_model_fields(
144
- fused_model.model_fields["passthrough"].annotation.model_fields,
139
+ raw_model.model_fields["passthrough"].annotation.model_fields,
145
140
  expected_passthrough_fields,
146
141
  )
147
142
 
@@ -100,11 +100,9 @@ async def test_can_call_passthrough():
100
100
 
101
101
  # The response payload should be the same both both sync and async endpoints
102
102
  expected_response = {
103
- "TestController": {
104
- "passthrough": ExamplePassthroughModel(
105
- status="success",
106
- )
107
- }
103
+ "passthrough": ExamplePassthroughModel(
104
+ status="success",
105
+ )
108
106
  }
109
107
 
110
108
  assert return_value_sync == expected_response
@@ -101,13 +101,11 @@ async def call_sideeffect_common(controller: ControllerCommon):
101
101
 
102
102
  # The response payload should be the same both both sync and async endpoints
103
103
  expected_response = {
104
- controller.__class__.__name__: {
105
- "sideeffect": ExampleRenderModel(
106
- value_a="Hello",
107
- value_b="World",
108
- ),
109
- "passthrough": None,
110
- }
104
+ "sideeffect": ExampleRenderModel(
105
+ value_a="Hello",
106
+ value_b="World",
107
+ ),
108
+ "passthrough": None,
111
109
  }
112
110
 
113
111
  assert return_value_sync == expected_response
@@ -279,10 +277,8 @@ def test_limit_codepath_experimental(
279
277
  elapsed = (monotonic_ns() - start) / 1e9
280
278
  assert response.status_code == 200
281
279
  assert response.json() == {
282
- "ExampleController": {
283
- "sideeffect": {
284
- "value_a": "Hello 1229",
285
- }
280
+ "sideeffect": {
281
+ "value_a": "Hello 1229",
286
282
  }
287
283
  }
288
284
 
@@ -0,0 +1,135 @@
1
+ from contextlib import asynccontextmanager, contextmanager
2
+ from os import environ
3
+ from warnings import filterwarnings
4
+
5
+ import pytest
6
+ import pytest_asyncio
7
+ from fastapi import Depends
8
+ from sqlalchemy import exc as sa_exc
9
+ from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker
10
+ from sqlmodel import SQLModel, text
11
+
12
+ from mountaineer.config import ConfigBase, unregister_config
13
+ from mountaineer.database import DatabaseDependencies
14
+ from mountaineer.database.config import DatabaseConfig
15
+ from mountaineer.dependencies.base import get_function_dependencies
16
+ from mountaineer.test_utilities import bootstrap_database
17
+
18
+
19
+ @contextmanager
20
+ def clear_registration_metadata():
21
+ """
22
+ Temporarily clear the sqlalchemy metadata
23
+
24
+ """
25
+ archived_tables = SQLModel.metadata.tables
26
+ archived_schemas = SQLModel.metadata._schemas
27
+ archived_memos = SQLModel.metadata._fk_memos
28
+
29
+ try:
30
+ SQLModel.metadata.clear()
31
+ yield
32
+ finally:
33
+ # Restore
34
+ SQLModel.metadata.tables = archived_tables
35
+ SQLModel.metadata._schemas = archived_schemas
36
+ SQLModel.metadata._fk_memos = archived_memos
37
+
38
+
39
+ @pytest_asyncio.fixture
40
+ async def clear_all_database_objects(db_session: AsyncSession):
41
+ """
42
+ Clear all database objects, including those not directly created through
43
+ SQLAlchemy.
44
+
45
+ """
46
+ # Step 1: Drop all tables in the public schema
47
+ await db_session.execute(
48
+ text(
49
+ """
50
+ DO $$ DECLARE
51
+ r RECORD;
52
+ BEGIN
53
+ FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP
54
+ EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
55
+ END LOOP;
56
+ END $$;
57
+ """
58
+ )
59
+ )
60
+
61
+ # Step 2: Drop all custom types in the public schema
62
+ await db_session.execute(
63
+ text(
64
+ """
65
+ DO $$ DECLARE
66
+ r RECORD;
67
+ BEGIN
68
+ FOR r IN (SELECT typname FROM pg_type WHERE typtype = 'e' AND typnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'public')) LOOP
69
+ EXECUTE 'DROP TYPE IF EXISTS ' || quote_ident(r.typname) || ' CASCADE';
70
+ END LOOP;
71
+ END $$;
72
+ """
73
+ )
74
+ )
75
+
76
+ await db_session.commit()
77
+
78
+
79
+ @pytest.fixture
80
+ def isolated_sqlalchemy(clear_all_database_objects):
81
+ """
82
+ Drops database tables and clears the metadata that is registered
83
+ in-memory, just for this test
84
+
85
+ """
86
+ # Avoid also creating the tables for other SQLModels that have been defined
87
+ # in memory (and therefore captured in the same registry)
88
+ with clear_registration_metadata():
89
+ # Overrides the warning that we see when creating multiple ExampleDBModels
90
+ # in one session
91
+ filterwarnings("ignore", category=sa_exc.SAWarning)
92
+
93
+ yield
94
+
95
+
96
+ class MigrationAppConfig(ConfigBase, DatabaseConfig):
97
+ pass
98
+
99
+
100
+ @pytest.fixture(autouse=True)
101
+ def config():
102
+ """
103
+ Test-time configuration. Set to auto-use the fixture so that the configuration
104
+ is mounted and exposed to the dependency injection framework in all tests.
105
+
106
+ """
107
+ unregister_config()
108
+ return MigrationAppConfig(
109
+ POSTGRES_HOST=environ.get("TEST_POSTGRES_HOST", "localhost"),
110
+ POSTGRES_USER=environ.get("TEST_POSTGRES_USER", "mountaineer"),
111
+ POSTGRES_PASSWORD=environ.get("TEST_POSTGRES_PASSWORD", "mysecretpassword"),
112
+ POSTGRES_DB=environ.get("TEST_POSTGRES_DB", "mountaineer_test_db"),
113
+ POSTGRES_PORT=int(environ.get("POSTGRES_PORT", "5438")),
114
+ )
115
+
116
+
117
+ @pytest_asyncio.fixture(scope="function")
118
+ async def db_engine(config: MigrationAppConfig):
119
+ @asynccontextmanager
120
+ async def run_bootstrap(
121
+ engine: AsyncEngine = Depends(DatabaseDependencies.get_db),
122
+ ):
123
+ await bootstrap_database(engine)
124
+ yield engine
125
+
126
+ async with get_function_dependencies(callable=run_bootstrap) as values:
127
+ async with run_bootstrap(**values) as engine:
128
+ yield engine
129
+
130
+
131
+ @pytest_asyncio.fixture
132
+ async def db_session(db_engine: AsyncEngine):
133
+ session_maker = async_sessionmaker(db_engine, expire_on_commit=False)
134
+ async with session_maker() as session:
135
+ yield session
@@ -0,0 +1,50 @@
1
+ from unittest.mock import AsyncMock
2
+
3
+ import pytest
4
+
5
+ from mountaineer.migrations.actions import DatabaseActions, DryRunAction
6
+
7
+
8
+ def example_action_fn(arg_1: str):
9
+ pass
10
+
11
+
12
+ @pytest.mark.asyncio
13
+ async def test_record_signature_dry_run():
14
+ database_actions = DatabaseActions(dry_run=True)
15
+
16
+ await database_actions._record_signature(
17
+ example_action_fn, {"arg_1": "test"}, "SQL"
18
+ )
19
+
20
+ assert database_actions.dry_run_actions == [
21
+ DryRunAction(fn=example_action_fn, kwargs={"arg_1": "test"})
22
+ ]
23
+ assert database_actions.prod_sqls == []
24
+
25
+
26
+ @pytest.mark.asyncio
27
+ async def test_record_signature_prod():
28
+ database_actions = DatabaseActions(dry_run=False, db_session=AsyncMock())
29
+
30
+ await database_actions._record_signature(
31
+ example_action_fn, {"arg_1": "test"}, "SQL"
32
+ )
33
+
34
+ assert database_actions.dry_run_actions == []
35
+ assert database_actions.prod_sqls == ["SQL"]
36
+
37
+
38
+ @pytest.mark.asyncio
39
+ async def test_record_signature_incorrect_kwarg():
40
+ database_actions = DatabaseActions(dry_run=False, db_session=AsyncMock())
41
+
42
+ # An extra, non-existent kwarg is provided
43
+ with pytest.raises(ValueError):
44
+ await database_actions._record_signature(
45
+ example_action_fn, {"arg_1": "test", "arg_2": "test"}, "SQL"
46
+ )
47
+
48
+ # A required kwarg is missing
49
+ with pytest.raises(ValueError):
50
+ await database_actions._record_signature(example_action_fn, {}, "SQL")
@@ -0,0 +1,194 @@
1
+ from enum import Enum
2
+ from unittest.mock import ANY
3
+
4
+ import pytest
5
+ from sqlmodel import Field, SQLModel
6
+
7
+ from mountaineer.migrations.actions import (
8
+ ColumnType,
9
+ ConstraintType,
10
+ DatabaseActions,
11
+ DryRunAction,
12
+ DryRunComment,
13
+ )
14
+ from mountaineer.migrations.db_memory_serializer import DatabaseMemorySerializer
15
+
16
+
17
+ @pytest.mark.asyncio
18
+ async def test_from_scratch_migration():
19
+ """
20
+ Test a migration from scratch.
21
+
22
+ """
23
+
24
+ class OldValues(Enum):
25
+ A = "A"
26
+
27
+ class ModelA(SQLModel):
28
+ id: int = Field(primary_key=True)
29
+ animal: OldValues
30
+ was_nullable: str | None
31
+
32
+ migrator = DatabaseMemorySerializer()
33
+
34
+ db_objects = list(migrator.delegate([ModelA], context=None))
35
+ next_ordering = migrator.order_db_objects(db_objects)
36
+
37
+ actor = DatabaseActions()
38
+ actions = await migrator.build_actions(
39
+ actor, [], {}, [obj for obj, _ in db_objects], next_ordering
40
+ )
41
+
42
+ assert actions == [
43
+ DryRunComment(
44
+ text="\n" "NEW TABLE: modela\n",
45
+ ),
46
+ DryRunAction(
47
+ fn=actor.add_table,
48
+ kwargs={
49
+ "table_name": "modela",
50
+ },
51
+ ),
52
+ DryRunAction(
53
+ fn=actor.add_column,
54
+ kwargs={
55
+ "column_name": "id",
56
+ "custom_data_type": None,
57
+ "explicit_data_is_list": False,
58
+ "explicit_data_type": ColumnType.INTEGER,
59
+ "table_name": "modela",
60
+ },
61
+ ),
62
+ DryRunAction(
63
+ fn=actor.add_type,
64
+ kwargs={
65
+ "type_name": "oldvalues",
66
+ "values": [
67
+ "A",
68
+ ],
69
+ },
70
+ ),
71
+ DryRunAction(
72
+ fn=actor.add_column,
73
+ kwargs={
74
+ "column_name": "was_nullable",
75
+ "custom_data_type": None,
76
+ "explicit_data_is_list": False,
77
+ "explicit_data_type": ColumnType.VARCHAR,
78
+ "table_name": "modela",
79
+ },
80
+ ),
81
+ DryRunAction(
82
+ fn=actor.add_constraint,
83
+ kwargs={
84
+ "columns": [
85
+ "id",
86
+ ],
87
+ "constraint": ConstraintType.PRIMARY_KEY,
88
+ "constraint_args": None,
89
+ "constraint_name": "modela_pkey",
90
+ "table_name": "modela",
91
+ },
92
+ ),
93
+ DryRunAction(
94
+ fn=actor.add_column,
95
+ kwargs={
96
+ "column_name": "animal",
97
+ "custom_data_type": "oldvalues",
98
+ "explicit_data_is_list": False,
99
+ "explicit_data_type": None,
100
+ "table_name": "modela",
101
+ },
102
+ ),
103
+ ]
104
+
105
+
106
+ @pytest.mark.asyncio
107
+ async def test_diff_migration():
108
+ """
109
+ Test the diff migration between two schemas.
110
+
111
+ """
112
+
113
+ class OldValues(Enum):
114
+ A = "A"
115
+
116
+ class NewValues(Enum):
117
+ A = "A"
118
+ B = "B"
119
+
120
+ class ModelA(SQLModel):
121
+ id: int = Field(primary_key=True)
122
+ animal: OldValues
123
+ was_nullable: str | None
124
+
125
+ class ModelANew(SQLModel):
126
+ __tablename__ = "modela" # type: ignore
127
+ id: int = Field(primary_key=True)
128
+ name: str
129
+ animal: NewValues
130
+ was_nullable: str
131
+
132
+ actor = DatabaseActions()
133
+ migrator = DatabaseMemorySerializer()
134
+
135
+ db_objects = list(migrator.delegate([ModelA], context=None))
136
+ db_objects_previous = [obj for obj, _ in db_objects]
137
+ previous_ordering = migrator.order_db_objects(db_objects)
138
+
139
+ db_objects_new = list(migrator.delegate([ModelANew], context=None))
140
+ db_objects_next = [obj for obj, _ in db_objects_new]
141
+ next_ordering = migrator.order_db_objects(db_objects_new)
142
+
143
+ actor = DatabaseActions()
144
+ actions = await migrator.build_actions(
145
+ actor, db_objects_previous, previous_ordering, db_objects_next, next_ordering
146
+ )
147
+ assert actions == [
148
+ DryRunAction(
149
+ fn=actor.add_column,
150
+ kwargs={
151
+ "column_name": "name",
152
+ "custom_data_type": None,
153
+ "explicit_data_is_list": False,
154
+ "explicit_data_type": ColumnType.VARCHAR,
155
+ "table_name": "modela",
156
+ },
157
+ ),
158
+ DryRunAction(
159
+ fn=actor.add_type,
160
+ kwargs={
161
+ "type_name": "newvalues",
162
+ "values": [
163
+ "A",
164
+ "B",
165
+ ],
166
+ },
167
+ ),
168
+ DryRunAction(
169
+ fn=actor.add_not_null,
170
+ kwargs={
171
+ "column_name": "was_nullable",
172
+ "table_name": "modela",
173
+ },
174
+ ),
175
+ DryRunComment(
176
+ text=ANY,
177
+ ),
178
+ DryRunAction(
179
+ fn=actor.modify_column_type,
180
+ kwargs={
181
+ "column_name": "animal",
182
+ "custom_data_type": "newvalues",
183
+ "explicit_data_is_list": False,
184
+ "explicit_data_type": None,
185
+ "table_name": "modela",
186
+ },
187
+ ),
188
+ DryRunAction(
189
+ fn=actor.drop_type,
190
+ kwargs={
191
+ "type_name": "oldvalues",
192
+ },
193
+ ),
194
+ ]