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.
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Cargo.lock +1 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Cargo.toml +1 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Makefile +4 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/PKG-INFO +1 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/cli.py +8 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/root_layout.py +3 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/layout.tsx +3 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/pyproject.toml +1 -0
- mountaineer-0.5.0.dev4/docker-compose.test.yml +16 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/views.md +2 -6
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_fields.py +7 -12
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_passthrough_dec.py +3 -5
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_sideeffect_dec.py +7 -11
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/conftest.py +135 -0
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_actions.py +50 -0
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_db_memory_serializer.py +194 -0
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_db_serializer.py +367 -0
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_generator.py +128 -0
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_generics.py +95 -0
- mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations/test_handlers.py +142 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_app.py +124 -4
- mountaineer-0.5.0.dev4/mountaineer/__tests__/test_generics.py +39 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/fields.py +5 -19
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/passthrough_dec.py +1 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/sideeffect_dec.py +0 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/app.py +152 -12
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/builder.py +1 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/compat.py +4 -1
- mountaineer-0.5.0.dev4/mountaineer/generics.py +53 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/__init__.py +0 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/actions.py +532 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/cli.py +195 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/client_io.py +62 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/db_memory_serializer.py +210 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/db_serializer.py +207 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/db_stubs.py +278 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/dependency/__init__.py +1 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/dependency/core/__init__.py +1 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/dependency/core/core.py +10 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/generator.py +226 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/generics.py +88 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/handlers.py +613 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/migration.py +68 -0
- mountaineer-0.5.0.dev4/mountaineer/migrations/migrator.py +110 -0
- mountaineer-0.5.0.dev4/mountaineer/py.typed +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/api.ts +5 -10
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/pyproject.toml +1 -1
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.git-blame-ignore-revs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.gitattributes +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/README_SCRIPTS.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/poetry.lock +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/pyproject.toml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/__tests__/test_update_version.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/check_dependencies.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/scripts/update_version.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/workflows/publish_docs.yml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/workflows/test.yml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.github/workflows/validate.yml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/.gitignore +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/Dockerfile +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/LICENSE +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/README.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/README.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/benchmarking/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/benchmarking/simple_render.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/poetry.lock +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/benchmarking/pyproject.toml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/README.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/app.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/config.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/complex.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/detail.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/home.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/stream.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/main.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/complex/page.tsx +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/detail/page.tsx +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/home/page.tsx +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/main.css +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/app/stream/page.tsx +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/package-lock.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/package.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/postcss.config.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/views/tailwind.config.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/poetry.lock +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/README.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/common.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/test_builder.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/test_cli.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/__tests__/test_generation.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/builder.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/cli.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/base.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/poetry.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/environments/venv.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/external.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/generation.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/io.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/.zed/settings.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/editor_configs/vim/.vimrc +0 -0
- {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
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/editor_configs/zed/pyrightconfig.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/.env +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/.gitignore +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/README.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/app.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/cli.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/config.py +0 -0
- {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
- {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
- {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
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/[project_name]/main.py +0 -0
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {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
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/docker-compose.yml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/create_mountaineer_app/templates/project/pyproject.toml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/poetry.lock +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/create_mountaineer_app/pyproject.toml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/.zed/settings.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/README.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/CNAME +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/actions.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/api_exception.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/app-controller.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/build_plugins/base.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/build_plugins/javascript.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/build_plugins/postcss.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/cli.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/config.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/controller.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/core_dependencies.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/database/config.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/database/dependencies.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/logging.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/render.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/ssr.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/api/watch_server.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/client_actions.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/cma.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/database.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/deploy.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/error_handling.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/index.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/internal/core_library.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/links.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/final_todo_list.png +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/ide_typehints.png +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/network_debug.png +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/media/server_side_rendering.png +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/metadata.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/postcss.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/quickstart.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/static_analysis.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/structure.md +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/docs/stylesheets/extra.css +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/mkdocs.yml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/overrides/partials/footer.html +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/poetry.lock +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/docs_website/pyproject.toml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/media/header.png +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_build_actions.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_build_links.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_build_schemas.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_builder.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/client_builder/test_typescript.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/common.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/conftest.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/dependencies/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/dependencies/conftest.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/dependencies/test_core.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/test_config.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/database/test_sqlmodel.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/dependencies/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/dependencies/test_base.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/complex_controller_ssr_with_react.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/home_controller_source_map.js.map +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/fixtures/home_controller_ssr_with_react.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/test_javascript.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/test_postcss.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/js_compiler/test_source_maps.py +0 -0
- {mountaineer-0.5.0.dev2/mountaineer/controllers → mountaineer-0.5.0.dev4/mountaineer/__tests__/migrations}/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_annotation_helpers.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_cache.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_cli.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_compat.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_config.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_controller.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_controller_layout.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_cropper.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_exceptions.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_logging.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_paths.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_ssr.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/test_watch.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/actions/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/annotation_helpers.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/cache.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/cli.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/build_actions.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/build_links.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/build_schemas.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/openapi.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/client_builder/typescript.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/config.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/console.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/constants.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/controller.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/controller_layout.py +0 -0
- /mountaineer-0.5.0.dev2/mountaineer/py.typed → /mountaineer-0.5.0.dev4/mountaineer/controllers/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/controllers/exception_controller.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/cropper.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/cli.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/config.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/dependencies/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/dependencies/core.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/sqlmodel.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/database/validator.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/base.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/core/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/dependencies/core/core.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/exceptions.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/io.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/base.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/exceptions.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/javascript.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/postcss.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/js_compiler/source_maps.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/logging.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/paths.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/render.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/ssr.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/live_reload.ts +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/static/ssr_polyfills.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/test_utilities.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/__init__.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/core/exception/page.tsx +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/core/layout.tsx +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/core/main.css +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/package-lock.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/package.json +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/postcss.config.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/views/tailwind.config.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/watch.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/watch_server.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/webservice.py +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/poetry.lock +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/fixtures/complex_sourcemap_mapping.txt +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/fixtures/home_controller_ssr_with_react.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/fixtures/ssr_polyfill_archive.js +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/lexers_benchmark.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/source_map_benchmark.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/benches/ssr_benchmark.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/errors.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/lexers.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/lib.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/logging.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/source_map.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/ssr.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src/timeout.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/Cargo.toml +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/build.rs +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/go/js_build.go +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/go.mod +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/go.sum +0 -0
- {mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/src_go/src/lib.rs +0 -0
|
@@ -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,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
|
+
)
|
{mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/ci_webapp/ci_webapp/controllers/root_layout.py
RENAMED
|
@@ -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>
|
|
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
|
|
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
|
-
|
|
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
|
|
{mountaineer-0.5.0.dev2 → mountaineer-0.5.0.dev4}/mountaineer/__tests__/actions/test_fields.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import AsyncIterator, Iterator, Optional, Type
|
|
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
|
|
134
|
-
assert
|
|
128
|
+
assert "sideeffect" in raw_model.model_fields.keys()
|
|
129
|
+
assert raw_model.model_fields["sideeffect"].annotation
|
|
135
130
|
basic_compare_model_fields(
|
|
136
|
-
|
|
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
|
|
142
|
-
assert
|
|
136
|
+
assert "passthrough" in raw_model.model_fields.keys()
|
|
137
|
+
assert raw_model.model_fields["passthrough"].annotation
|
|
143
138
|
basic_compare_model_fields(
|
|
144
|
-
|
|
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
|
-
"
|
|
104
|
-
"
|
|
105
|
-
|
|
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
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
"
|
|
283
|
-
"
|
|
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
|
+
]
|