swiftpy-framework 0.3.9__tar.gz → 0.4.1__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.
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/.github/workflows/ci.yml +37 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/CHANGELOG.md +47 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/PKG-INFO +8 -3
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/README.md +7 -2
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-14-installation-quick-start.md +20 -20
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-authentication-and-security.md +1 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-database-query-builder-and-migrations.md +7 -3
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-orm-models-and-relationships.md +106 -2
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-validation-and-form-requests.md +29 -5
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-19-cli-and-testing.md +6 -4
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-19-database-schema-and-blueprint.md +43 -8
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/pyproject.toml +1 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/__init__.py +22 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/auth_manager.py +127 -35
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/make.py +113 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/new.py +1 -1
- swiftpy_framework-0.4.1/swiftpy/console/stubs/factory.stub +18 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/application.py +3 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/__init__.py +5 -0
- swiftpy_framework-0.4.1/swiftpy/database/factories.py +1828 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/migrations/blueprint.py +99 -4
- swiftpy_framework-0.4.1/swiftpy/database/migrations/schema.py +817 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/orm/__init__.py +23 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/orm/model.py +72 -2
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/http/request.py +38 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/schemas/base.py +4 -1
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/form_request.py +13 -2
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/rules/registry.py +25 -10
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/rules/unique.py +90 -5
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/validator.py +14 -8
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_proxy.py +278 -29
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_new_command.py +5 -3
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_phase9_cli_remediation.py +31 -2
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_stubs_and_make.py +128 -2
- swiftpy_framework-0.4.1/tests/database/test_factories.py +1172 -0
- swiftpy_framework-0.4.1/tests/migrations/test_migrations_v040.py +636 -0
- swiftpy_framework-0.4.1/tests/typing/test_auth_typing.py +75 -0
- swiftpy_framework-0.4.1/tests/typing/test_factory_typing.py +178 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/typing/test_orm_typing.py +34 -0
- swiftpy_framework-0.4.1/tests/typing/test_validation_typing.py +62 -0
- swiftpy_framework-0.4.1/tests/validation/test_db_rules.py +758 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_validation_ergonomics.py +153 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/uv.lock +1 -1
- swiftpy_framework-0.3.9/swiftpy/database/migrations/schema.py +0 -475
- swiftpy_framework-0.3.9/tests/validation/test_db_rules.py +0 -269
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/.dockerignore +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/.env.example +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/.gitignore +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/Dockerfile +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/LICENSE +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/ai/agents/assistant_agent.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/ai/observers/.gitkeep +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/ai/pipelines/.gitkeep +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/ai/providers/.gitkeep +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/ai/tools/system_status_tool.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/ai/vectorstores/.gitkeep +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/controllers/user_controller.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/handler/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/middleware/admin_middleware.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/middleware/auth_middleware.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/http/resources/user_resource.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/models/profile.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/models/user.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/schemas/user_schema.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/app/services/user_service.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/ai.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/app.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/auth.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/cache.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/cors.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/database.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/events.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/filesystems.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/http.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/logging.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/mail.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/queue.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/config/schedule.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/database/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/database/migrations/2026_01_01_000000_create_users_table.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/database/migrations/2026_11_26_180006_create_profiles_table.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/docker-compose.yml +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-ai-subsystem.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-cache-events-and-queues.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-core-application-di-and-config.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-filesystem-storage-and-mail.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-15-websockets-and-admin.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-19-application-schemas.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-20-error-handling.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-20-logging.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-20-request-and-responses.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-21-application-architecture-and-project-structure.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-21-cors.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-22-task-scheduling.md +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/main.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/prompts/classify.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/prompts/summarise.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/red-black.png +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/routes/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/routes/api.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/client.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/prompts/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/prompts/loader.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/api_key_guard.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/events.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/jwt_guard.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/jwt_issuer.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/throttle.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/token_blacklist.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth/user_context.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/auth_manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/cli.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/queue.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/schedule.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/loader.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/agent.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/controller.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/model.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/prompt.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/repository.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/resource.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/schema.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/service.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/console/stubs/tool.stub +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/helpers/helper.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/http/client_ip.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/http/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/http/router.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/logging/channels.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/logging/log.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/logging/manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/py.typed +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/queue/worker.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/_redis_lua.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/cron.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/events.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/jobs.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/models.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/scheduler.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/signing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/scheduling/store.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/schemas/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/schemas/fields.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/websockets/connection.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_observability.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_prompts.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_prompts_security.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/app/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/app/test_application_providers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/app/test_starter_auth.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_attempt.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_context_on_issue.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_auth_throttle.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_jwt_defaults.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_refresh_and_logout.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/concurrency/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/conftest.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/test_helpers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_query_helpers_v036.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/database/test_sequence_gaps.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/docs/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/docs/test_readme_examples.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/e2e/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/events/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_client_ip.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_controller_routing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_request_router_abort.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/http/test_router_405_and_has_file.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/logging/test_logging.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/migrations/test_migrations.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_instance_update.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_relationships_hardening.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/orm/test_where_has.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_cron_and_timezone.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_scheduler_core.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_scheduler_lifecycle_and_cli.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_scheduler_queue_integration.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_scheduler_recovery_and_failures.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_scheduler_redis_store.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/scheduling/test_scheduler_worker_lifecycle.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/schemas/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/schemas/test_schema_auth.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/schemas/test_schema_orm_and_cli.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/schemas/test_schema_routing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/schemas/test_schemas.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/security/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/stress/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/support/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/typing/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/typing/test_schema_typing.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/tests/websockets/test_websocket_routing_and_lifecycle.py +0 -0
- {swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/views/mail/template.html +0 -0
|
@@ -84,6 +84,7 @@ jobs:
|
|
|
84
84
|
uv run mypy swiftpy
|
|
85
85
|
uv run mypy .
|
|
86
86
|
uv run mypy --explicit-package-bases .
|
|
87
|
+
uv run mypy --strict tests/typing/
|
|
87
88
|
|
|
88
89
|
- name: Run Pyrefly
|
|
89
90
|
run: |
|
|
@@ -195,11 +196,46 @@ jobs:
|
|
|
195
196
|
out, _ = proc.communicate(timeout=5)
|
|
196
197
|
assert ok, out
|
|
197
198
|
'
|
|
199
|
+
ROOT_DIR="$(pwd)"
|
|
198
200
|
rm -rf /tmp/swiftpy-pyrefly-smoke && mkdir -p /tmp/swiftpy-pyrefly-smoke
|
|
199
201
|
(
|
|
200
202
|
cd /tmp/swiftpy-pyrefly-smoke
|
|
201
203
|
/tmp/swiftpy-wheel-smoke/bin/swiftpy new ci_smoke_api
|
|
202
204
|
cd ci_smoke_api
|
|
203
|
-
|
|
205
|
+
cat <<'EOF' > v041_typing_contract_smoke.py
|
|
206
|
+
from __future__ import annotations
|
|
207
|
+
|
|
208
|
+
from typing import assert_type
|
|
209
|
+
|
|
210
|
+
from swiftpy import Auth, AuthProxy, AuthUser, Request, UniqueRule, ValidatedData, unique
|
|
211
|
+
from swiftpy.auth import auth
|
|
212
|
+
from swiftpy.auth_manager import Auth as LegacyAuth
|
|
213
|
+
from swiftpy.auth_manager import auth as legacy_auth
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def check_auth_contracts() -> AuthUser:
|
|
217
|
+
_proxy = assert_type(auth(), AuthProxy)
|
|
218
|
+
_user = assert_type(auth().user(), AuthUser)
|
|
219
|
+
_uid = auth().user().id
|
|
220
|
+
_facade_id = Auth.user().id
|
|
221
|
+
_legacy_id = legacy_auth().user().id
|
|
222
|
+
_legacy_facade_id = LegacyAuth.user().id
|
|
223
|
+
_nullable = assert_type(auth().user(nullable=True), AuthUser | None)
|
|
224
|
+
_facade_nullable = assert_type(Auth.user(nullable=True), AuthUser | None)
|
|
225
|
+
_strict = assert_type(auth().user_or_fail(), AuthUser)
|
|
226
|
+
_ = (_proxy, _user, _uid, _facade_id, _legacy_id, _legacy_facade_id, _nullable, _facade_nullable, _strict)
|
|
227
|
+
return auth().user()
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
async def check_validation_contracts(request: Request, user_id: int) -> ValidatedData:
|
|
231
|
+
_rule = assert_type(unique("users", "email").ignore(user_id), UniqueRule)
|
|
232
|
+
_ = _rule
|
|
233
|
+
return assert_type(
|
|
234
|
+
await request.validate({"email": f"required|email|unique:users,email,{user_id}"}),
|
|
235
|
+
ValidatedData,
|
|
236
|
+
)
|
|
237
|
+
EOF
|
|
238
|
+
uvx pyrefly check --python-interpreter-path /tmp/swiftpy-wheel-smoke/bin/python --error=no-any-return-implicit app/ config/ routes/ database/ prompts/ main.py v041_typing_contract_smoke.py
|
|
239
|
+
PYTHONPATH= "$ROOT_DIR/.venv/bin/mypy" --python-executable /tmp/swiftpy-wheel-smoke/bin/python --strict v041_typing_contract_smoke.py
|
|
204
240
|
)
|
|
205
241
|
rm -rf /tmp/swiftpy-pyrefly-smoke /tmp/swiftpy-wheel-smoke
|
|
@@ -4,6 +4,52 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.4.1] - 2026-11-28
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Inline Request Validation & Route Parameter Helpers (`swiftpy/http/request.py`, `swiftpy/core/application.py`, `swiftpy/validation/form_request.py`):**
|
|
11
|
+
- Added `await request.validate(schema, messages=None, *, registry=None, stop_on_first_error=False) -> ValidatedData` on `Request`, automatically validating request payloads, raising `ValidationException` (HTTP 422) on failure, and returning `ValidatedData` (supporting both dict and attribute access).
|
|
12
|
+
- Populated `request.path_params` during HTTP and WebSocket dispatch in `Application` and added `request.route(param=None, default=None)` and `FormRequest.route(param=None, default=None)` so controllers and dynamic `FormRequest.rules()` methods can read route parameters cleanly (`"validate"`, `"route"`, and `"path_params"` added to `Request._RESERVED_INPUT_ATTRS`).
|
|
13
|
+
- **Unique Validation Enhancements (`swiftpy/validation/rules/unique.py`, `swiftpy/validation/rules/registry.py`):**
|
|
14
|
+
- Added fluent `UniqueRule.ignore(ignore_id, id_column=None)` and support for `Model`, `AuthUser`, and `CurrentUser` instances passed as `ignore_id` (automatically inferring `__primary_key__` and primary key value), while explicitly rejecting boolean `ignore_id` values (`TypeError`).
|
|
15
|
+
- Normalized `"NULL"`, `"null"`, `"None"`, and empty `""` `ignore_id` tokens in `_parse_unique` without shifting `id_column` positionally (e.g. `unique:users,email,NULL,user_id`), and rejected empty 4th `id_column` tokens (`unique:users,email,1,`) or extra trailing positional tokens (`unique:users,email,1,id,extra`) with `ConfigurationError`.
|
|
16
|
+
- Optimized `UniqueRule._fetchval_unique` to execute a single query on the common integer-PK update path (`f"unique:users,email,{id}"`) by binding canonical integer strings as `int` first and falling back to `str`/`int` coercion on `(asyncpg.DataError, TypeError)`.
|
|
17
|
+
- **Strict Default `auth().user()` / `Auth.user()` & Explicit `user_or_fail()` (`swiftpy/auth/auth_manager.py`):**
|
|
18
|
+
- Enforced strict runtime behavior matching `@overload` static types on `AuthProxy.user()` and `Auth.user()`: default `auth().user()` and `Auth.user()` (`nullable: Literal[False] = False -> AuthUser`) raise `AuthenticationError("Unauthenticated.")` when unauthenticated or when the active guard mismatches the requested guard, while `nullable=True` (`-> AuthUser | None`) returns `None`.
|
|
19
|
+
- Added `auth().user_or_fail() -> AuthUser` and `Auth.user_or_fail() -> AuthUser` for explicit fail-closed access.
|
|
20
|
+
- Hardened `AuthUser.id` custom `__primary_key__` fallback, `AuthProxy._resolve_user` rejection of empty or all-sensitive dicts, model-aware string PK preservation in `_build_auth_user_from_dict` (`_expects_int_pk`), `is_sensitive_key(...)` stripping across dict/model hydration, and `_is_logged_out()` enforcement in `_adopt_request_state_user()`, `current_user_model()`, `current_user()`, and `AuthProxy._resolve_user()`.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- **Static Typing (`Pyrefly[missing-attribute]` / `mypy --strict`) & CI Typing Gates (`swiftpy/auth/auth_manager.py`, `swiftpy/http/request.py`, `swiftpy/validation/validator.py`, `swiftpy/__init__.py`, `.github/workflows/ci.yml`):**
|
|
24
|
+
- Eliminated `Object of class NoneType has no attribute id` errors on `auth().user().id`, `Auth.user().id`, and legacy facade calls with aligned `@overload` contracts and runtime enforcement, backed by dedicated `tests/typing/test_auth_typing.py` and `tests/typing/test_validation_typing.py` CI checks in both `mypy --strict` and `pyrefly check` (including installed-wheel typing smoke checks).
|
|
25
|
+
- Widened `Request.validate`, `validate()`, and `Validator.__init__` annotations to accept `Mapping[str, Any]` schemas and `Mapping[str, str] | None` custom error message mappings.
|
|
26
|
+
- Updated `swiftpy/__init__.py` `TYPE_CHECKING`, `_EXPORT_MAP`, and `__all__` entries for `AuthProxy`, `AuthUser`, `AuthenticationError`, `current_user_model`, and `set_user_model`.
|
|
27
|
+
- Broke the `swiftpy.http.request` <-> `swiftpy.validation` / `swiftpy.schemas.base` circular import chain cleanly at top-of-file imports (`_is_swiftpy_request` TypeGuard marker).
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Bumped `swiftpy-framework` package version (`pyproject.toml`), `swiftpy new` dependency floor (`swiftpy/console/commands/new.py`), `tests/console/test_phase9_cli_remediation.py`, [Installation & Quick Start](documentations/2026-11-14-installation-quick-start.md), [Validation & Form Requests](documentations/2026-11-15-validation-and-form-requests.md), [Authentication & Security](documentations/2026-11-15-authentication-and-security.md), and [README.md](README.md) to `0.4.1`.
|
|
31
|
+
|
|
32
|
+
## [0.4.0] - 2026-11-27
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- **Migration Alteration & Introspection Helpers (`swiftpy/database/migrations/schema.py`, `blueprint.py`):**
|
|
36
|
+
- Added `Schema.has_columns(table, columns) -> bool` and `Schema.has_index(table, index, type_=None, *, type=None) -> bool` using parameterized PostgreSQL catalog queries (`information_schema.columns` and `pg_index` / `pg_class` / `pg_am` / `pg_attribute`) supporting unqualified or schema-qualified (`"schema.table"`) lookups (also supported in `Schema.has_table` / `Schema.has_column`), index names, exact ordered column sequences, partial indexes, expression indexes (by name), and constraint (`"primary"`, `"unique"`) or PostgreSQL access-method (`"btree"`, `"gin"`, ...) filters.
|
|
37
|
+
- Added `Blueprint.binary(name)` (`BYTEA`) with PostgreSQL hex default literal formatting (`'\x...'::bytea`) for `bytes`/`bytearray`/`memoryview` defaults, and verified `Blueprint.jsonb(name)` (`JSONB`).
|
|
38
|
+
- Widened `Blueprint.drop_column(*names: str | Sequence[str])` so callers can pass either variadic column names or column lists/tuples (`table.drop_column(["votes", "avatar", "location"])`).
|
|
39
|
+
- Added `ColumnDefinition.change()` and `ColumnDefinition.using(expression)` with PostgreSQL `ALTER COLUMN` compilation in `SchemaGrammar._compile_modify_column` (drops omitted column check constraints, defaults, and comments cleanly; idempotently refreshes `.unique()` constraints; emits `TYPE ... [USING ...]`, `SET`/`DROP NOT NULL`, `SET DEFAULT`, `unsigned`/`enum` check constraints, unique/index constraints, and `COMMENT ON COLUMN`). Added explicit guards rejecting `.change()`/`.using()` inside `Schema.create` and `.change()` on auto-incrementing identity columns.
|
|
40
|
+
- **Model Factories & Seeders Interop (`swiftpy/database/factories.py`, `swiftpy/database/orm/model.py`, `swiftpy/__init__.py`):**
|
|
41
|
+
- Added typed `Factory[T]`, `FactoryBatch[T]`, `Fake`, and `Sequence` (with typed `@overload`s for index callbacks and `.state()` callbacks) utilities plus `Model.factory(count=None)` (`Model.factory() -> Factory[Self]` returning `Self`; `Model.factory(n)` / `.count(n) -> FactoryBatch[Self]` returning `list[Self]`).
|
|
42
|
+
- Wrapped `Factory._create_many()` inside re-entrant `db.transaction()` (with savepoints inside nested transactions) so partial/nested relationship or hook failures roll back atomically with zero orphaned records, added a call-scoped recursion depth guard (`_MAX_FACTORY_DEPTH`) raising `RecursionError` on circular factory definitions, hardened `.for_()` / `.has()` / `.has_<relation>()` validation and package-scoped convention discovery (`database/factories/<subpkg>/<model>_factory.py` & `Model.__factory__` checks), and cleaned up unawaited coroutines on async hook misuse during sync `.make()`.
|
|
43
|
+
- Supports `.definition()`, custom state helper methods via `.state(...)`, `.sequence(...)`, `Sequence(idx_callback)`, `.seed(int)`, `.raw()`, `.make()`, `await .create()`, sync/async `.after_making()` and `.after_creating()` hooks, nested factory attribute references, `.has()` / dynamic `.has_<relation>()` (`HasMany`/`HasOne`), `.has_attached()` (`BelongsToMany` pivot attributes), `.for_()` / `.for_<relation>()` (`BelongsTo`), and factory resolution via `Model.__factory__`, `_FACTORY_REGISTRY`, disk convention discovery (`database/factories/<model>_factory.py`), and `_DefaultModelFactory` fallback (all strictly Pythonic `snake_case`, no `camelCase` aliases).
|
|
44
|
+
- **CLI Factory Generators (`swiftpy/console/commands/make.py`, `swiftpy/console/stubs/factory.stub`):**
|
|
45
|
+
- Added `swiftpy make:factory <Name>` (`--model`, `--path`, `--force`) writing to `database/factories/` and added `-f` / `--factory` and `--factory-path` flags to `swiftpy make:model`. Starter projects created with `swiftpy new` intentionally do not pre-create `database/factories/` until a factory is generated.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
- Bumped `swiftpy-framework` package version (`pyproject.toml`), `swiftpy new` dependency floor (`swiftpy/console/commands/new.py`), and `tests/console/test_phase9_cli_remediation.py` to `0.4.0`.
|
|
49
|
+
|
|
50
|
+
### Documentation
|
|
51
|
+
- Updated [Database Schema, `Blueprint` & Migrations](documentations/2026-11-19-database-schema-and-blueprint.md), [Database Query Builder, Migrations & Seeders](documentations/2026-11-15-database-query-builder-and-migrations.md), [Active Record ORM & Relationships](documentations/2026-11-15-orm-models-and-relationships.md), [CLI & Testing](documentations/2026-11-19-cli-and-testing.md), [Installation & Quick Start](documentations/2026-11-14-installation-quick-start.md), and [README.md](README.md) with v0.4.0 migration helpers, model factories, CLI commands, and upgrade instructions.
|
|
52
|
+
|
|
7
53
|
## [0.3.9] - 2026-11-27
|
|
8
54
|
|
|
9
55
|
### Changed
|
|
@@ -19,7 +65,7 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
19
65
|
- Added `Run Pyrefly` and isolated wheel `py.typed` + `swiftpy new` Pyrefly smoke-test verification to `.github/workflows/ci.yml`.
|
|
20
66
|
|
|
21
67
|
### Documentation
|
|
22
|
-
- Updated [ORM Models & Relationships](documentations/2026-11-15-orm-models-and-relationships.md), [Installation & Quick Start](documentations/2026-11-14-installation-quick-start.md), [CLI & Testing](documentations/2026-11-19-cli-and-testing.md), and [README.md](README.md) with guidance on `ClassVar`-free model metadata (`__fillable__`, `__guarded__`, `__hidden__`), host
|
|
68
|
+
- Updated [ORM Models & Relationships](documentations/2026-11-15-orm-models-and-relationships.md), [Installation & Quick Start](documentations/2026-11-14-installation-quick-start.md), [CLI & Testing](documentations/2026-11-19-cli-and-testing.md), and [README.md](README.md) with guidance on `ClassVar`-free model metadata (`__fillable__`, `__guarded__`, `__hidden__`), zero-`.venv` host Python installation (`python -m pip install -U swiftpy-framework`) for Dockerized IDE type checking, and avoiding global `ignore_missing_imports = true` with Pyrefly.
|
|
23
69
|
|
|
24
70
|
## [0.3.8] - 2026-11-25
|
|
25
71
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: SwiftPY is a new generation async-first Python framework purpose built for the modern API and AI economy.
|
|
5
5
|
Project-URL: Homepage, https://github.com/obrainwave/swiftpy
|
|
6
6
|
Project-URL: Repository, https://github.com/obrainwave/swiftpy
|
|
@@ -98,6 +98,8 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
98
98
|
| **Release v0.3.7: Declarative Schemas (`swiftpy.schemas`) & Pyrefly/PEP 561 Typing** | `swiftpy/py.typed` PEP 561 marker, `Model` / `ModelQueryBuilder[T]` fluent generic preservation, `BaseSchema` / `Schema` & `Field(...)` constraints, `@field_validator` / `@model_validator`, Router/Controller auto-injection & JSON serialization, ORM `create()`/`update()` schema interop, `make:schema` & `swiftpy new` updates | ✅ Completed |
|
|
99
99
|
| **Release v0.3.8: Zero-Boilerplate ORM & Relationship Static Typing** | Source-level `Relation[T]` / `RelationshipQueryBuilder[T]` / `SingleRelationshipQueryBuilder[T]` type propagation (`await v.relation` & full query chains), zero-ceremony `model = YourModel` repositories, covariant `Mapping` / non-string `Sequence` & `ModelQueryBuilder` subqueries, and `BaseSchema` parity on `ModelQueryBuilder.update`, `first_or_create`, `update_or_create`, and relationship `.create()`/`.update()` | ✅ Completed |
|
|
100
100
|
| **Release v0.3.9: Pyrefly/Mypy Scaffolding Hardening & `ClassVar`-Free Model Guidance** | Removed global `ignore_missing_imports = true` from `swiftpy new` `[tool.mypy]` (replaced with scoped `[[tool.mypy.overrides]]` so Pyrefly surfaces `[missing-import]` instead of silent `Model: Unknown` / `[no-any-return-implicit]`), expanded `RUF012` per-file ignores across `app/models/`, `app/**/models/`, and `tests/`, added `typing.assert_type` + `py.typed` wheel-packaging regression tests, and documented host IDE setup & `ClassVar`-free model metadata | ✅ Completed |
|
|
101
|
+
| **Release v0.4.0: Migration Alteration/Introspection Helpers & Model Factories** | `Schema.has_columns()`, `Schema.has_index()`, `Blueprint.binary()` (`BYTEA`), `Blueprint.drop_column()` sequence support, declarative `ColumnDefinition.change()` + `.using(expr)` PostgreSQL `ALTER COLUMN` compiler, typed `Factory[T]` / `FactoryBatch[T]` / `Fake` / `Sequence` & `Model.factory()` with `.state()`, `.sequence()`, `.has()` / `.has_<rel>()`, `.has_attached()`, `.for_()`, plus `swiftpy make:factory` & `make:model -f` | ✅ Completed |
|
|
102
|
+
| **Release v0.4.1: Inline `request.validate()`, Unique Update Ergonomics & Strict `AuthUser` Contract** | Added `await request.validate(...)` and `request.route()` / `FormRequest.route()` for `f"required\|email\|unique:users,email,{id}"` flows, hardened `UniqueRule` (`NULL`/`None` tokens, `Model`/`AuthUser` `.ignore()`, bidirectional int/str PK coercion), enforced strict `auth().user()` / `Auth.user()` (`-> AuthUser`, raising `AuthenticationError` unless `nullable=True` is passed, plus `user_or_fail()`) eliminating `Pyrefly[missing-attribute]`, fixed top-level `swiftpy` `AuthUser`/`AuthProxy` exports, and enforced Pyrefly + `mypy --strict` CI typing gates | ✅ Completed |
|
|
101
103
|
|
|
102
104
|
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md), [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md), and [`documentations/2026-11-22-task-scheduling.md`](./documentations/2026-11-22-task-scheduling.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
103
105
|
|
|
@@ -355,6 +357,8 @@ class CreatePostsTable(Migration):
|
|
|
355
357
|
await Schema.drop_if_exists("posts")
|
|
356
358
|
```
|
|
357
359
|
|
|
360
|
+
Also supports column alterations inside `Schema.table(...)` via `.change()` and `.using(expr)`, `table.binary(name)` (`BYTEA`), `table.drop_column(["col_a", "col_b"])`, and schema introspection via `Schema.has_columns(table, [...])` and `Schema.has_index(table, index, type=...)`.
|
|
361
|
+
|
|
358
362
|
### 7. Asynchronous Queues & Background Jobs
|
|
359
363
|
|
|
360
364
|
Define background jobs with automatic JSON serialization, HMAC envelope signing, retry with backoff, and dead letter queue routing:
|
|
@@ -504,9 +508,10 @@ swiftpy migrate:rollback
|
|
|
504
508
|
swiftpy migrate:reset
|
|
505
509
|
swiftpy db:seed
|
|
506
510
|
|
|
507
|
-
# Scaffold migrations, models, requests, schemas, API keys, mailables, and more
|
|
511
|
+
# Scaffold migrations, models, factories, requests, schemas, API keys, mailables, and more
|
|
508
512
|
swiftpy make:migration create_posts_table
|
|
509
|
-
swiftpy make:model Post --migration
|
|
513
|
+
swiftpy make:model Post --migration --factory
|
|
514
|
+
swiftpy make:factory PostFactory --model Post
|
|
510
515
|
swiftpy make:request RegisterRequest
|
|
511
516
|
swiftpy make:schema OrderSchema
|
|
512
517
|
swiftpy make:mail WelcomeEmail
|
|
@@ -68,6 +68,8 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
68
68
|
| **Release v0.3.7: Declarative Schemas (`swiftpy.schemas`) & Pyrefly/PEP 561 Typing** | `swiftpy/py.typed` PEP 561 marker, `Model` / `ModelQueryBuilder[T]` fluent generic preservation, `BaseSchema` / `Schema` & `Field(...)` constraints, `@field_validator` / `@model_validator`, Router/Controller auto-injection & JSON serialization, ORM `create()`/`update()` schema interop, `make:schema` & `swiftpy new` updates | ✅ Completed |
|
|
69
69
|
| **Release v0.3.8: Zero-Boilerplate ORM & Relationship Static Typing** | Source-level `Relation[T]` / `RelationshipQueryBuilder[T]` / `SingleRelationshipQueryBuilder[T]` type propagation (`await v.relation` & full query chains), zero-ceremony `model = YourModel` repositories, covariant `Mapping` / non-string `Sequence` & `ModelQueryBuilder` subqueries, and `BaseSchema` parity on `ModelQueryBuilder.update`, `first_or_create`, `update_or_create`, and relationship `.create()`/`.update()` | ✅ Completed |
|
|
70
70
|
| **Release v0.3.9: Pyrefly/Mypy Scaffolding Hardening & `ClassVar`-Free Model Guidance** | Removed global `ignore_missing_imports = true` from `swiftpy new` `[tool.mypy]` (replaced with scoped `[[tool.mypy.overrides]]` so Pyrefly surfaces `[missing-import]` instead of silent `Model: Unknown` / `[no-any-return-implicit]`), expanded `RUF012` per-file ignores across `app/models/`, `app/**/models/`, and `tests/`, added `typing.assert_type` + `py.typed` wheel-packaging regression tests, and documented host IDE setup & `ClassVar`-free model metadata | ✅ Completed |
|
|
71
|
+
| **Release v0.4.0: Migration Alteration/Introspection Helpers & Model Factories** | `Schema.has_columns()`, `Schema.has_index()`, `Blueprint.binary()` (`BYTEA`), `Blueprint.drop_column()` sequence support, declarative `ColumnDefinition.change()` + `.using(expr)` PostgreSQL `ALTER COLUMN` compiler, typed `Factory[T]` / `FactoryBatch[T]` / `Fake` / `Sequence` & `Model.factory()` with `.state()`, `.sequence()`, `.has()` / `.has_<rel>()`, `.has_attached()`, `.for_()`, plus `swiftpy make:factory` & `make:model -f` | ✅ Completed |
|
|
72
|
+
| **Release v0.4.1: Inline `request.validate()`, Unique Update Ergonomics & Strict `AuthUser` Contract** | Added `await request.validate(...)` and `request.route()` / `FormRequest.route()` for `f"required\|email\|unique:users,email,{id}"` flows, hardened `UniqueRule` (`NULL`/`None` tokens, `Model`/`AuthUser` `.ignore()`, bidirectional int/str PK coercion), enforced strict `auth().user()` / `Auth.user()` (`-> AuthUser`, raising `AuthenticationError` unless `nullable=True` is passed, plus `user_or_fail()`) eliminating `Pyrefly[missing-attribute]`, fixed top-level `swiftpy` `AuthUser`/`AuthProxy` exports, and enforced Pyrefly + `mypy --strict` CI typing gates | ✅ Completed |
|
|
71
73
|
|
|
72
74
|
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md), [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md), and [`documentations/2026-11-22-task-scheduling.md`](./documentations/2026-11-22-task-scheduling.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
73
75
|
|
|
@@ -325,6 +327,8 @@ class CreatePostsTable(Migration):
|
|
|
325
327
|
await Schema.drop_if_exists("posts")
|
|
326
328
|
```
|
|
327
329
|
|
|
330
|
+
Also supports column alterations inside `Schema.table(...)` via `.change()` and `.using(expr)`, `table.binary(name)` (`BYTEA`), `table.drop_column(["col_a", "col_b"])`, and schema introspection via `Schema.has_columns(table, [...])` and `Schema.has_index(table, index, type=...)`.
|
|
331
|
+
|
|
328
332
|
### 7. Asynchronous Queues & Background Jobs
|
|
329
333
|
|
|
330
334
|
Define background jobs with automatic JSON serialization, HMAC envelope signing, retry with backoff, and dead letter queue routing:
|
|
@@ -474,9 +478,10 @@ swiftpy migrate:rollback
|
|
|
474
478
|
swiftpy migrate:reset
|
|
475
479
|
swiftpy db:seed
|
|
476
480
|
|
|
477
|
-
# Scaffold migrations, models, requests, schemas, API keys, mailables, and more
|
|
481
|
+
# Scaffold migrations, models, factories, requests, schemas, API keys, mailables, and more
|
|
478
482
|
swiftpy make:migration create_posts_table
|
|
479
|
-
swiftpy make:model Post --migration
|
|
483
|
+
swiftpy make:model Post --migration --factory
|
|
484
|
+
swiftpy make:factory PostFactory --model Post
|
|
480
485
|
swiftpy make:request RegisterRequest
|
|
481
486
|
swiftpy make:schema OrderSchema
|
|
482
487
|
swiftpy make:mail WelcomeEmail
|
|
@@ -98,31 +98,30 @@ Use this path for full-stack APIs with config files, migrations, ORM models, sto
|
|
|
98
98
|
|
|
99
99
|
### 1. Scaffold the Project
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
From the workspace parent directory where you want your `my_api` folder created, choose **one** of these two ways to scaffold your project:
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
- **With `uvx` (recommended — no `.venv` clutter or global installs):**
|
|
103
|
+
- **Recommended (especially for Dockerized development on Windows, macOS, or Linux) — Install `swiftpy-framework` on your host Python:**
|
|
106
104
|
|
|
107
105
|
```bash
|
|
108
|
-
|
|
106
|
+
python -m pip install --upgrade pip
|
|
107
|
+
python -m pip install -U swiftpy-framework
|
|
108
|
+
swiftpy --version
|
|
109
|
+
swiftpy new my_api
|
|
109
110
|
cd my_api
|
|
110
111
|
```
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
**Why this is recommended:** When you run your application inside Docker (Option A below), your code editor (VS Code, Antigravity, Cursor, PyCharm) and its type checkers (**Pyrefly**, **Pylance**, **Mypy**) still run on your host OS (e.g., Windows). Installing `swiftpy-framework` once into your host Python makes both the `swiftpy` CLI and SwiftPY's `py.typed` type definitions available globally to your IDE — so **every Dockerized SwiftPY project works out of the box with zero Pyrefly errors and without needing a `.venv`, `.devcontainer`, or custom `.vscode/settings.json` in your project folder**.
|
|
114
|
+
|
|
115
|
+
*(Note: If Windows prints a warning that `Scripts` is not on your `PATH`, either add that `Scripts` folder to your Windows `PATH` or run `python -m swiftpy.console.cli new my_api`.)*
|
|
116
|
+
|
|
117
|
+
- **Alternative (if you prefer not to install packages into your host Python) — Use `uvx` or a dedicated virtual environment:**
|
|
113
118
|
|
|
114
119
|
```bash
|
|
115
|
-
|
|
116
|
-
source .cli-venv/bin/activate # Windows PowerShell: .cli-venv\Scripts\Activate.ps1
|
|
117
|
-
python -m pip install --upgrade pip
|
|
118
|
-
python -m pip install swiftpy-framework
|
|
119
|
-
swiftpy --version
|
|
120
|
-
swiftpy new my_api
|
|
121
|
-
deactivate
|
|
120
|
+
uvx --from swiftpy-framework swiftpy new my_api
|
|
122
121
|
cd my_api
|
|
123
122
|
```
|
|
124
123
|
|
|
125
|
-
*(
|
|
124
|
+
*(Note: Because `uvx` runs in a temporary cache and deletes itself afterward, if you use `uvx` you will need to create a local `.venv` inside `my_api` with `uv sync` so your host IDE can find `swiftpy`.)*
|
|
126
125
|
|
|
127
126
|
Pass `--force` only if overwriting an existing non-empty directory (existing `.env` files are preserved when `--force` is used).
|
|
128
127
|
|
|
@@ -171,7 +170,7 @@ my_api/
|
|
|
171
170
|
├── docker-compose.yml # name: my_api; app, postgres (pgvector:pg16), & redis services
|
|
172
171
|
├── Dockerfile
|
|
173
172
|
├── main.py # Entrypoint: GET /, /api router, register_exception_handlers(app)
|
|
174
|
-
└── pyproject.toml # Configured with swiftpy-framework>=0.
|
|
173
|
+
└── pyproject.toml # Configured with swiftpy-framework>=0.4.1, setuptools, & mypy strict settings
|
|
175
174
|
```
|
|
176
175
|
|
|
177
176
|
What `swiftpy new my_api` configures automatically:
|
|
@@ -186,10 +185,10 @@ Now choose **ONE** of the two run modes below (Option A **or** Option B).
|
|
|
186
185
|
|
|
187
186
|
### Option A: Fully Dockerized (App + PostgreSQL + Redis in Docker)
|
|
188
187
|
|
|
189
|
-
Use this mode if you want Docker to run
|
|
188
|
+
Use this mode if you want Docker to run everything — **you do not need a `.venv` folder in your project, `.devcontainer`, or local PostgreSQL/Redis on your host.**
|
|
190
189
|
|
|
191
|
-
> **
|
|
192
|
-
>
|
|
190
|
+
> **Zero-Setup IDE Autocomplete & Pyrefly Type Checking:**
|
|
191
|
+
> Because you installed `swiftpy-framework` on your host Python in Step 1 (`python -m pip install -U swiftpy-framework`), your host IDE (Pyrefly, Pylance, Mypy) automatically finds `swiftpy` in your system Python — no project `.venv`, `.devcontainer`, or `.vscode/settings.json` configuration is needed. (Only create a project `.venv` with `uv sync` if you skipped the host install and used `uvx` instead.)
|
|
193
192
|
|
|
194
193
|
1. Inside `my_api`, review `.env` (optional — defaults already work out of the box with Compose).
|
|
195
194
|
2. Build and start `app`, `postgres`, and `redis`:
|
|
@@ -328,7 +327,7 @@ The scaffolded `Dockerfile` reads `[project].dependencies` from your project's `
|
|
|
328
327
|
name = "my_api"
|
|
329
328
|
version = "0.1.0"
|
|
330
329
|
dependencies = [
|
|
331
|
-
"swiftpy-framework>=0.
|
|
330
|
+
"swiftpy-framework>=0.4.1",
|
|
332
331
|
# ...
|
|
333
332
|
]
|
|
334
333
|
```
|
|
@@ -348,6 +347,7 @@ The scaffolded `Dockerfile` reads `[project].dependencies` from your project's `
|
|
|
348
347
|
```
|
|
349
348
|
|
|
350
349
|
- The target version of `swiftpy-framework` must already be published on PyPI before running `docker compose build`. To test an unreleased local framework build in Docker, build a wheel (`uv build --wheel`), copy the `.whl` into your project's build context, and `pip install` that wheel in `Dockerfile`.
|
|
350
|
+
- **Keep your host IDE in sync:** Also run `python -m pip install -U "swiftpy-framework>=0.4.1"` on your host machine so your IDE and Pyrefly pick up any new APIs or type annotations from the upgraded release.
|
|
351
351
|
|
|
352
352
|
### Local Virtual Environment Projects (Option B / Minimal App)
|
|
353
353
|
|
|
@@ -358,7 +358,7 @@ If running without Docker, upgrade inside your activated `.venv`:
|
|
|
358
358
|
uv sync --upgrade-package swiftpy-framework
|
|
359
359
|
|
|
360
360
|
# Or with pip
|
|
361
|
-
python -m pip install --upgrade "swiftpy-framework>=0.
|
|
361
|
+
python -m pip install --upgrade "swiftpy-framework>=0.4.1"
|
|
362
362
|
swiftpy --version
|
|
363
363
|
```
|
|
364
364
|
|
|
@@ -313,7 +313,7 @@ async def login(payload: LoginRequest, jwt: JWTIssuer, current: CurrentUser) ->
|
|
|
313
313
|
|
|
314
314
|
**Routes without `JWTGuard`.** By default only guards authenticate. Set `AUTH_PASSIVE_RESOLUTION=true` (`auth.passive_resolution`, default guard `jwt`) to let routes without a guard resolve a valid `Authorization: Bearer <access_token>` into `CurrentUser` / `auth()`. Invalid, expired or revoked tokens are ignored and the request stays a guest; use `JWTGuard` when you need a `401`.
|
|
315
315
|
|
|
316
|
-
> `CurrentUser.id` returns the raw token `sub` (a string) when no model is bound, while `auth().id()` coerces it to the User model's primary key type. Compare with `str(...)` or use `auth().id()` consistently.
|
|
316
|
+
> `CurrentUser.id` returns the raw token `sub` (a string) when no model is bound, while `auth().id()` coerces it to the User model's primary key type. Compare with `str(...)` or use `auth().id()` consistently. `auth().user()` and `Auth.user()` return `AuthUser` strictly and raise `AuthenticationError` (`HTTP 401`) if unauthenticated (or if the active guard does not match), matching their static `AuthUser` return type in Pyrefly and `mypy --strict` so expressions like `auth().user().id` or `Auth.user().email` work directly without `NoneType` errors; pass `nullable=True` (`auth().user(nullable=True) -> AuthUser | None`) on unauthenticated/optional routes where `None` is expected, or call `auth().user_or_fail()` / `Auth.user_or_fail()` for explicit strict intent.
|
|
317
317
|
|
|
318
318
|
For token refresh endpoints, inject `jwt: JWTIssuer` **or** invoke `await JWTIssuer.refresh_token_pair(...)` directly on `JWTIssuer` (both forms automatically resolve the active application's configuration and `TokenBlacklist`). Rather than calling `issue_token_pair()` manually, `refresh_token_pair()` verifies the incoming token with `expected_type="refresh"`, checks `TokenBlacklist`, revokes the previous refresh token's `jti` automatically (`rotate=True` by default) so reused refresh tokens fail with `TokenRevokedError` (`401`), and issues a fresh access/refresh pair:
|
|
319
319
|
|
|
@@ -547,10 +547,10 @@ class CreateArticlesAndTags(Migration):
|
|
|
547
547
|
Supported `Blueprint` methods:
|
|
548
548
|
|
|
549
549
|
- **Primary keys & IDs:** `id(name="id")` (`BIGSERIAL PRIMARY KEY`), `increments(name="id")` (`SERIAL PRIMARY KEY`), `big_increments(name="id")` (`BIGSERIAL PRIMARY KEY`), or table-level composite `table.primary(["user_id", "role_id"], name=...)`.
|
|
550
|
-
- **Column types:** `uuid()`, `string(name, length=255)`, `text()` (unbounded `TEXT`, up to ~1 GB in PostgreSQL), `medium_text()` and `long_text()` (aliases for `text()` since PostgreSQL has no separate size variants), `enum(name, values)` (`VARCHAR(255)` with a named `{table}_{col}_check` `CHECK` constraint), `integer()`, `big_integer()`, `small_integer()`, `boolean()`, `decimal(name, precision=8, scale=2)`, `float()`, `json()`, `jsonb()`, `date()`, `time()`, `timestamp(name, tz=True)`, `timestamps(tz=True)`, `soft_deletes(name="deleted_at", tz=True)`, `vector(name, dimensions=1536)` (for `pgvector`).
|
|
551
|
-
- **Column modifiers:** `.nullable(True)`, `.default(value)` (use `raw("CURRENT_TIMESTAMP")` or `raw("gen_random_uuid()")` for SQL expressions; passing raw SQL keyword strings emits a `DeprecationWarning`), `.unique(name=None)`, `.index(name=None)`, `.primary()`, `.comment("text")`, `.unsigned()` (`CHECK ("col" >= 0)`). Column positioning via `.after()` is intentionally not implemented because PostgreSQL only appends added columns to the end of a table.
|
|
550
|
+
- **Column types:** `uuid()`, `string(name, length=255)`, `text()` (unbounded `TEXT`, up to ~1 GB in PostgreSQL), `medium_text()` and `long_text()` (aliases for `text()` since PostgreSQL has no separate size variants), `enum(name, values)` (`VARCHAR(255)` with a named `{table}_{col}_check` `CHECK` constraint), `integer()`, `big_integer()`, `small_integer()`, `boolean()`, `decimal(name, precision=8, scale=2)`, `float()`, `binary(name)` (`BYTEA`), `json()`, `jsonb()`, `date()`, `time()`, `timestamp(name, tz=True)`, `timestamps(tz=True)`, `soft_deletes(name="deleted_at", tz=True)`, `vector(name, dimensions=1536)` (for `pgvector`).
|
|
551
|
+
- **Column modifiers:** `.nullable(True)`, `.default(value)` (use `raw("CURRENT_TIMESTAMP")` or `raw("gen_random_uuid()")` for SQL expressions; passing raw SQL keyword strings emits a `DeprecationWarning`), `.unique(name=None)`, `.index(name=None)`, `.primary()`, `.comment("text")`, `.unsigned()` (`CHECK ("col" >= 0)`), `.change()` (modify an existing column cleanly inside `Schema.table`), and `.using(expr)` (`USING` cast clause for `.change()`). Column positioning via `.after()` is intentionally not implemented because PostgreSQL only appends added columns to the end of a table.
|
|
552
552
|
- **Indexes & Foreign Keys:** `table.unique(cols, name=None)`, `table.index(cols, name=None)`, `table.foreign(col, name=None).references("id").on("users").cascade_on_delete()` (also `.null_on_delete()`, `.cascade_on_update()`, `.on_delete(...)`, `.on_update(...)`), or one-call `table.foreign_key(column, references, on, on_delete=..., on_update=..., name=None)`.
|
|
553
|
-
- **Altering & Inspecting Tables:** `await Schema.table("articles", fn)` supports `drop_column(*names)
|
|
553
|
+
- **Altering & Inspecting Tables:** `await Schema.table("articles", fn)` supports `.change()` (modifying column types/nullability/defaults/constraints in place), `drop_column(*names)` (accepting variadic strings or sequences such as `["col_a", "col_b"]`), `rename_column(old, new)`, `drop_index(name)`, `drop_unique(name)`, and `drop_foreign(name)` alongside adding new columns/indexes/foreign keys. Drops always execute before renames and adds/modifications, so a single `Schema.table` call can drop and re-add a constraint or column cleanly. You can also inspect schema state with `await Schema.has_table("articles")`, `await Schema.has_column("articles", "title")`, `await Schema.has_columns("articles", ["title", "body"])`, and `await Schema.has_index("articles", "idx_articles_title")`.
|
|
554
554
|
|
|
555
555
|
### Running Migrations with the CLI
|
|
556
556
|
|
|
@@ -627,8 +627,12 @@ from database.seeders.user_seeder import UserSeeder
|
|
|
627
627
|
class DatabaseSeeder(Seeder):
|
|
628
628
|
async def run(self) -> None:
|
|
629
629
|
await self.call(UserSeeder)
|
|
630
|
+
# Seed sample data cleanly with Model Factories:
|
|
631
|
+
# await User.factory().count(25).has_posts(3).create()
|
|
630
632
|
```
|
|
631
633
|
|
|
634
|
+
Generate a factory for any model with `swiftpy make:factory UserFactory` (or `swiftpy make:model Post -f`); see [Model Factories](2026-11-15-orm-models-and-relationships.md#model-factories-factory-fake--sequence) for `Factory`, `Fake`, `Sequence`, states, and relationship helpers.
|
|
635
|
+
|
|
632
636
|
### Running Seeders
|
|
633
637
|
|
|
634
638
|
```bash
|
|
@@ -40,6 +40,12 @@ swiftpy make:model Post
|
|
|
40
40
|
# Create the model and a matching create_posts_table migration
|
|
41
41
|
swiftpy make:model Post -m
|
|
42
42
|
|
|
43
|
+
# Create the model, migration, and database/factories/post_factory.py together
|
|
44
|
+
swiftpy make:model Post -m -f
|
|
45
|
+
|
|
46
|
+
# Create a standalone factory later
|
|
47
|
+
swiftpy make:factory PostFactory
|
|
48
|
+
|
|
43
49
|
# Override the inferred table name
|
|
44
50
|
swiftpy make:model AuditEntry --table audit_entries --migration
|
|
45
51
|
|
|
@@ -47,7 +53,7 @@ swiftpy make:model AuditEntry --table audit_entries --migration
|
|
|
47
53
|
swiftpy make:model Billing/Invoice --migration
|
|
48
54
|
|
|
49
55
|
# Specify custom output directories or overwrite an existing file
|
|
50
|
-
swiftpy make:model Post --path app/models --migration-path database/migrations --force
|
|
56
|
+
swiftpy make:model Post --path app/models --migration-path database/migrations --factory-path database/factories --force
|
|
51
57
|
```
|
|
52
58
|
|
|
53
59
|
Available flags on `swiftpy make:model`:
|
|
@@ -55,9 +61,11 @@ Available flags on `swiftpy make:model`:
|
|
|
55
61
|
| Flag | Description |
|
|
56
62
|
| :--- | :--- |
|
|
57
63
|
| `-m`, `--migration` | Also generate a migration file for the model's table |
|
|
64
|
+
| `-f`, `--factory` | Also generate a `Factory` subclass under `database/factories/` |
|
|
58
65
|
| `--table` | Explicit table name instead of auto-pluralizing the snake-case model name |
|
|
59
66
|
| `--path` | Output directory for the model (defaults to `app/models`) |
|
|
60
67
|
| `--migration-path` | Output directory for `-m` migrations (defaults to `database/migrations`) |
|
|
68
|
+
| `--factory-path` | Output directory for `-f` factories (defaults to `database/factories`) |
|
|
61
69
|
| `--force` | Overwrite the target file if it already exists |
|
|
62
70
|
|
|
63
71
|
### Table Name Inference & Primary Keys
|
|
@@ -305,7 +313,7 @@ author: User | None = await versions[0].author
|
|
|
305
313
|
> **Repository & IDE Type-Checking Best Practices:**
|
|
306
314
|
> - **Assign the model class, not an instance:** Set `model = DocVersion` on the repository class (or `self.model = DocVersion` in `__init__(self) -> None:`), never `self.model = DocVersion()` (which instantiates an unsaved model object on every repository initialization).
|
|
307
315
|
> - **Handle nullable `.first()` and `.find()` lookups:** `.first()` and `.find()` return `T | None`. In repository methods declared to return `-> T`, either check `if not record: raise NotFoundError(...)` before returning or call `.first_or_fail()` / `.find_or_fail()`.
|
|
308
|
-
> - **Ensure your host
|
|
316
|
+
> - **Ensure your host Python has `swiftpy-framework` installed:** When developing with Docker on Windows, macOS, or Linux, your IDE (Pyrefly, Pylance, Mypy) runs on your host OS outside the container. Install `swiftpy-framework` once into your host Python (`python -m pip install -U swiftpy-framework`) so your IDE resolves `swiftpy` globally across all projects without needing a `.venv` or `.devcontainer` in every project folder. Never set global `ignore_missing_imports = true` under `[tool.mypy]` in `pyproject.toml`—Pyrefly imports `[tool.mypy]` when `pyrefly.toml` is absent and will silently turn unresolved `Model` imports into `Unknown` (`[no-any-return-implicit]`) instead of reporting a missing import.
|
|
309
317
|
|
|
310
318
|
#### Query Builder Methods on `Model`
|
|
311
319
|
|
|
@@ -582,6 +590,102 @@ await post.tags.sync([tag_a.id, tag_b])
|
|
|
582
590
|
|
|
583
591
|
---
|
|
584
592
|
|
|
593
|
+
### Model Factories (`Factory`, `Fake`, & `Sequence`)
|
|
594
|
+
|
|
595
|
+
Model factories generate typed `Model` instances and persisted PostgreSQL test/seed records cleanly without repetitive boilerplate. Starter projects generated by `swiftpy new` do not pre-create `database/factories/`; generate factory files on demand with `swiftpy make:factory` or `swiftpy make:model -f`:
|
|
596
|
+
|
|
597
|
+
```bash
|
|
598
|
+
swiftpy make:factory UserFactory # creates database/factories/user_factory.py
|
|
599
|
+
swiftpy make:model Post -m -f # creates app/models/post.py, migration, & post_factory.py
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
#### Defining a Factory
|
|
603
|
+
|
|
604
|
+
Subclass `Factory[YourModel]`, set `model = YourModel`, and implement `definition()` using `self.fake` (`Fake`):
|
|
605
|
+
|
|
606
|
+
```python
|
|
607
|
+
from __future__ import annotations
|
|
608
|
+
|
|
609
|
+
from typing import Any
|
|
610
|
+
|
|
611
|
+
from swiftpy.database import Factory, Fake
|
|
612
|
+
from app.models.user import User
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
class UserFactory(Factory[User]):
|
|
616
|
+
model = User
|
|
617
|
+
|
|
618
|
+
def definition(self) -> dict[str, Any]:
|
|
619
|
+
return {
|
|
620
|
+
"name": self.fake.name(),
|
|
621
|
+
"email": self.fake.unique_email(),
|
|
622
|
+
"is_admin": False,
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
def admin(self) -> UserFactory:
|
|
626
|
+
return self.state({"is_admin": True})
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
#### Resolution, `.make()`, `await .create()`, `.raw()`, and Counts
|
|
630
|
+
|
|
631
|
+
`Model.factory()` resolves a model's factory in this order: explicit `Model.__factory__` attribute -> registered `Factory` subclasses -> disk convention (`database/factories/<model_snake>_factory.py`) -> fallback default factory.
|
|
632
|
+
|
|
633
|
+
```python
|
|
634
|
+
# Single instance (User.factory() -> Factory[User])
|
|
635
|
+
unsaved = User.factory().make() # returns User
|
|
636
|
+
saved = await User.factory().create(name="Ada") # returns persisted User
|
|
637
|
+
payload = User.factory().seed(42).raw() # returns dict[str, Any]
|
|
638
|
+
|
|
639
|
+
# Multiple instances (FactoryBatch[User])
|
|
640
|
+
users = await User.factory().count(10).create() # returns list[User]
|
|
641
|
+
batch = User.factory(5).make() # shorthand for .count(5)
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
#### States, Sequences, & Lifecycle Hooks
|
|
645
|
+
|
|
646
|
+
```python
|
|
647
|
+
from swiftpy.database import Sequence
|
|
648
|
+
|
|
649
|
+
users = await (
|
|
650
|
+
User.factory()
|
|
651
|
+
.count(4)
|
|
652
|
+
.sequence({"role": "editor"}, {"role": "viewer"})
|
|
653
|
+
.state(Sequence(lambda idx: {"email": f"member{idx}@example.com"}))
|
|
654
|
+
.after_creating(lambda u: print(f"Created user {u.id}"))
|
|
655
|
+
.create()
|
|
656
|
+
)
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
- `.state(...)` accepts a mapping, `BaseSchema`, `Sequence`, or callable `(attrs) -> dict`.
|
|
660
|
+
- `.sequence(*states)` cycles deterministically through state overrides on each generated record.
|
|
661
|
+
- `.after_making(cb)` and `.after_creating(cb)` accept sync or async callbacks receiving the generated model instance.
|
|
662
|
+
|
|
663
|
+
#### Factory Relationships (`.has()`, `.has_<relation>()`, `.has_attached()`, `.for_()`)
|
|
664
|
+
|
|
665
|
+
```python
|
|
666
|
+
# HasMany / HasOne (dynamically resolves .has_<relation> or explicit .has(..., relationship=...))
|
|
667
|
+
author = await (
|
|
668
|
+
User.factory()
|
|
669
|
+
.has_profile(1, bio="Core Maintainer")
|
|
670
|
+
.has_posts(3, lambda _attrs, parent: {"title": f"Post by {parent.name}"})
|
|
671
|
+
.create()
|
|
672
|
+
)
|
|
673
|
+
|
|
674
|
+
# BelongsTo (.for_(parent_instance_or_factory) or .for_<relation>(...))
|
|
675
|
+
posts = await Post.factory().count(3).for_(author).create()
|
|
676
|
+
shared = await Post.factory().count(2).for_(User.factory()).create() # shares 1 created User
|
|
677
|
+
|
|
678
|
+
# BelongsToMany pivot attachment (.has_attached)
|
|
679
|
+
members = await (
|
|
680
|
+
User.factory()
|
|
681
|
+
.count(2)
|
|
682
|
+
.has_attached(Role.factory().count(2), {"active": True})
|
|
683
|
+
.create()
|
|
684
|
+
)
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
---
|
|
688
|
+
|
|
585
689
|
## Important Defaults & Production Safeguards
|
|
586
690
|
|
|
587
691
|
- **Deny-all mass assignment by default**: Leaving both `__fillable__` and `__guarded__` unset (`None`) blocks all mass assignment via `Model(...)`, `.fill(...)`, and `.create(...)`. Always declare an explicit `__fillable__` allowlist on models populated from request input, and reserve `.force_fill()` / `.force_create()` for trusted internal code.
|
|
@@ -166,9 +166,31 @@ If a client submits extra unvalidated keys such as `{"name": "Jane", "is_admin":
|
|
|
166
166
|
|
|
167
167
|
---
|
|
168
168
|
|
|
169
|
-
##
|
|
169
|
+
## Inline Validation with `await request.validate()` & Standalone `validate()`
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
For inline controller and route validation, call `await request.validate(schema, messages=None, *, stop_on_first_error=False)`. It validates query, JSON, or form input automatically, raises `ValidationException` (`HTTP 422`) on failure, and returns `ValidatedData` (supporting both dict indexing and dot access):
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
from __future__ import annotations
|
|
175
|
+
|
|
176
|
+
from swiftpy.http.request import Request
|
|
177
|
+
from swiftpy.http.response import Response, json_response
|
|
178
|
+
from swiftpy.http.router import Router
|
|
179
|
+
|
|
180
|
+
router = Router()
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
@router.put("/users/{id}")
|
|
184
|
+
async def update_user(request: Request, id: int) -> Response:
|
|
185
|
+
validated = await request.validate({
|
|
186
|
+
"email": f"required|email|unique:users,email,{id}",
|
|
187
|
+
})
|
|
188
|
+
return json_response({"id": id, "email": validated.email})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
You can also read matched route path parameters via `request.route("id")` (or `self.route("id")` inside a dynamic `FormRequest.rules()` method).
|
|
192
|
+
|
|
193
|
+
Or use `await validate(data_or_request, schema, ...)` (`Validator(data, schema, ...).validate()`) when you want a `ValidationResult` instead of raising immediately in services, WebSocket handlers, or background jobs:
|
|
172
194
|
|
|
173
195
|
```python
|
|
174
196
|
from __future__ import annotations
|
|
@@ -348,20 +370,22 @@ def build_update_user_rules(user_id: int) -> dict[str, Any]:
|
|
|
348
370
|
}
|
|
349
371
|
```
|
|
350
372
|
|
|
351
|
-
### Rule Arguments in String Syntax
|
|
373
|
+
### Rule Arguments in String Syntax & Fluent `.ignore()`
|
|
352
374
|
|
|
353
375
|
- **`exists:<table>,<column>`**: Passes if at least one matching row exists.
|
|
354
376
|
- **`unique:<table>,<column>[,<ignore_id>][,<id_column>][,ci]`**: Passes if no matching row exists:
|
|
355
377
|
- `unique:users,email` — exact match against `users.email`.
|
|
356
|
-
- `unique:users,email,
|
|
357
|
-
- `unique:users,email,42,user_uuid` —
|
|
378
|
+
- `f"unique:users,email,{id}"` — ignore the row where `id = id` (stringified integer, UUID, or string primary keys are coerced cleanly; `"NULL"`, `"None"`, or empty strings keep `ignore_id=None` without shifting `id_column`).
|
|
379
|
+
- `unique:users,email,42,user_uuid` or `unique:users,email,NULL,user_uuid` — use custom ID column `user_uuid`.
|
|
358
380
|
- `unique:users,email,ci` or `unique:users,email,42,ci` — case-insensitive match via `LOWER("email") = LOWER($1)`.
|
|
381
|
+
- `unique("users", "email").ignore(user_or_id, id_column=...)` — fluent helper also accepting a `Model` (auto-inferring `__primary_key__`) or `AuthUser` / `CurrentUser` instance.
|
|
359
382
|
|
|
360
383
|
### Connection Resolution, Transactions & Safety
|
|
361
384
|
|
|
362
385
|
- **Connection pool resolution:** Both `UniqueRule` and `ExistsRule` resolve `DatabasePool` automatically from the application `Container` (or accept an explicit `pool=` argument).
|
|
363
386
|
- **Transaction & SAVEPOINT safety:** When executed inside `async with db.transaction():`, both rules reuse the active transaction connection (seeing uncommitted writes in the same transaction) and wrap each check in a sub-transaction (`SAVEPOINT`) so a database type mismatch (such as passing `"abc"` for an integer column) returns a clean `422` validation failure without poisoning the outer transaction.
|
|
364
387
|
- **SQL injection defense:** Table and column identifiers are checked by `validate_identifier()` at rule construction time, rejecting unsafe identifiers upfront with `ValueError`, and field values are always bound as `$1` / `$2` parameters.
|
|
388
|
+
- **Database `UNIQUE` constraints remain mandatory under concurrency:** Application-level `unique` checks query PostgreSQL before inserting or updating, so two concurrent requests can still pass pre-write validation before either commits. Always declare a real database `UNIQUE` constraint (such as `table.string("email").unique()` in migrations) as your final integrity guarantee.
|
|
365
389
|
- **Empty values:** When a value is `None` or `""`, `ExistsRule` and `UniqueRule` return `True` — always pair them with `required` when the field cannot be omitted or blank.
|
|
366
390
|
|
|
367
391
|
---
|
{swiftpy_framework-0.3.9 → swiftpy_framework-0.4.1}/documentations/2026-11-19-cli-and-testing.md
RENAMED
|
@@ -26,8 +26,9 @@ Use the `make:*` commands to generate typed stubs conforming to SwiftPY's conven
|
|
|
26
26
|
|
|
27
27
|
| Command | Default Destination | Extra Options |
|
|
28
28
|
|---|---|---|
|
|
29
|
-
| `swiftpy make:model <Name>` | `app/models/` | `-m` / `--migration`, `--table <table>`, `--migration-path <dir>`, `--path`, `--force` |
|
|
29
|
+
| `swiftpy make:model <Name>` | `app/models/` | `-m` / `--migration`, `-f` / `--factory`, `--table <table>`, `--migration-path <dir>`, `--factory-path <dir>`, `--path`, `--force` |
|
|
30
30
|
| `swiftpy make:migration <name>` | `database/migrations/` | `--create <table>`, `--table <table>`, `--path`, `--force` |
|
|
31
|
+
| `swiftpy make:factory <Name>` | `database/factories/` | `--model <Model>`, `--path`, `--force` |
|
|
31
32
|
| `swiftpy make:controller <Name>` | `app/http/controllers/` | `--path`, `--force` |
|
|
32
33
|
| `swiftpy make:resource <Name>` | `app/http/resources/` | `--path`, `--force` |
|
|
33
34
|
| `swiftpy make:request <Name>` | `app/http/requests/` | `--path`, `--force` |
|
|
@@ -245,13 +246,14 @@ SwiftPY ships a PEP 561 `py.typed` marker inside the built wheel alongside gener
|
|
|
245
246
|
# Type-check application code strictly with Mypy
|
|
246
247
|
uv run mypy --strict .
|
|
247
248
|
|
|
248
|
-
# Type-check with Pyrefly
|
|
249
|
-
|
|
249
|
+
# Type-check with Pyrefly
|
|
250
|
+
pyrefly check --error=no-any-return-implicit .
|
|
250
251
|
```
|
|
251
252
|
|
|
252
253
|
Key configuration rules for Pyrefly, Mypy, and Ruff (configured automatically by `swiftpy new` in `pyproject.toml`):
|
|
253
254
|
|
|
254
|
-
- **
|
|
255
|
+
- **Install `swiftpy-framework` on your host Python for zero-setup Dockerized IDE type checking:** When running your app in Docker on Windows, macOS, or Linux, your IDE and Pyrefly run on the host OS outside the Docker container. Installing `swiftpy-framework` once into your host Python (`python -m pip install -U swiftpy-framework`) makes SwiftPY's `py.typed` definitions available globally to your IDE — so you do not need a `.venv`, `.devcontainer`, or custom `.vscode/settings.json` in your project folder. (If you prefer per-project virtual environments instead of a host install, run `uv sync` in the project and pass `--python-interpreter-path .venv/bin/python` or select `.venv` in your IDE.)
|
|
256
|
+
- **Never set global `ignore_missing_imports = true` under `[tool.mypy]`:** When no `pyrefly.toml` is present, Pyrefly automatically imports `[tool.mypy]` settings from `pyproject.toml`. A global `ignore_missing_imports = true` suppresses `[missing-import]` diagnostics when an IDE interpreter lacks `swiftpy-framework` and silently turns `Model` into `Unknown`—causing every repository query chain to fail with `Returning implicit Any [no-any-return-implicit]` (`where: Unknown`, `doc: Unknown`). Scope `ignore_missing_imports = true` only to untyped third-party libraries via `[[tool.mypy.overrides]]`:
|
|
255
257
|
```toml
|
|
256
258
|
[tool.mypy]
|
|
257
259
|
strict = true
|