instant-python 0.15.1__tar.gz → 0.16.0__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.
- {instant_python-0.15.1 → instant_python-0.16.0}/CHANGELOG.md +88 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/PKG-INFO +1 -1
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/renderer/jinja_environment.py +6 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/renderer/jinja_project_renderer.py +1 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/.pre-commit-config.yml +2 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/event_bus/domain_event_json_deserializer.py +25 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/domain_event_json_serializer.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/domain_event_subscriber.py +2 -11
- instant_python-0.16.0/instant_python/templates/boilerplate/event_bus/event_aggregate.py +18 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/event_bus/event_bus.py +9 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/event_bus/mock_event_bus.py +16 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_configurer.py +4 -23
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_connection.py +3 -18
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_consumer.py +5 -26
- instant_python-0.16.0/instant_python/templates/boilerplate/event_bus/rabbit_mq_event_bus.py +26 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_queue_formatter.py +2 -10
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/domain_error.py +6 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/domain_event_type_not_found_error.py +6 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/incorrect_value_type_error.py +10 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/invalid_id_format_error.py +6 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/invalid_negative_value_error.py +6 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/rabbit_mq_connection_not_established_error.py +7 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/required_value_error.py +6 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/fastapi/application.py +2 -12
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/fastapi/error_handlers.py +3 -17
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/fastapi/fastapi_log_middleware.py +1 -6
- instant_python-0.16.0/instant_python/templates/boilerplate/fastapi/lifespan.py +13 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/github/ci.yml +2 -2
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/github/release.yml +1 -1
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/logger/file_logger.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/logger/file_rotating_handler.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/alembic_migrator.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/async_engine_fixture.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/async_session.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/env.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/models_metadata.py +1 -6
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/sqlalchemy_repository.py +2 -12
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/synchronous/session_maker.py +1 -8
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/synchronous/sqlalchemy_repository.py +3 -16
- instant_python-0.16.0/instant_python/templates/boilerplate/pyproject.toml +134 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/makefile +35 -42
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/aggregate.py +1 -6
- instant_python-0.16.0/instant_python/templates/boilerplate/value_object/int_primitives_mother.py +7 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/value_object/int_value_object.py +22 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/value_object/string_primitives_mother.py +7 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/value_object/string_value_object.py +16 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/test_int_value_object.py +5 -22
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/test_string_value_object.py +4 -18
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/test_uuid_value_object.py +5 -22
- instant_python-0.16.0/instant_python/templates/boilerplate/value_object/uuid.py +26 -0
- instant_python-0.16.0/instant_python/templates/boilerplate/value_object/uuid_primitives_mother.py +11 -0
- instant_python-0.16.0/instant_python/templates/project_structure/alembic_migrator.yml.j2 +6 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/async_alembic.yml.j2 +2 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/async_sqlalchemy.yml.j2 +3 -9
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/event_bus_infra.yml.j2 +2 -2
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/github_action.yml.j2 +3 -3
- instant_python-0.16.0/instant_python/templates/project_structure/persistence.yml.j2 +8 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/value_objects.yml.j2 +1 -1
- {instant_python-0.15.1 → instant_python-0.16.0}/pyproject.toml +1 -1
- instant_python-0.16.0/test/initialize/infra/renderer/test_jinja_environment.py +145 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/uv.lock +1 -1
- instant_python-0.15.1/instant_python/templates/boilerplate/event_bus/domain_event_json_deserializer.py +0 -36
- instant_python-0.15.1/instant_python/templates/boilerplate/event_bus/event_aggregate.py +0 -24
- instant_python-0.15.1/instant_python/templates/boilerplate/event_bus/event_bus.py +0 -14
- instant_python-0.15.1/instant_python/templates/boilerplate/event_bus/mock_event_bus.py +0 -22
- instant_python-0.15.1/instant_python/templates/boilerplate/event_bus/rabbit_mq_event_bus.py +0 -42
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/domain_error.py +0 -11
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/domain_event_type_not_found_error.py +0 -10
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/incorrect_value_type_error.py +0 -15
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/invalid_id_format_error.py +0 -11
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/invalid_negative_value_error.py +0 -11
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/rabbit_mq_connection_not_established_error.py +0 -12
- instant_python-0.15.1/instant_python/templates/boilerplate/exceptions/required_value_error.py +0 -11
- instant_python-0.15.1/instant_python/templates/boilerplate/fastapi/lifespan.py +0 -18
- instant_python-0.15.1/instant_python/templates/boilerplate/pyproject.toml +0 -126
- instant_python-0.15.1/instant_python/templates/boilerplate/value_object/int_primitives_mother.py +0 -12
- instant_python-0.15.1/instant_python/templates/boilerplate/value_object/int_value_object.py +0 -31
- instant_python-0.15.1/instant_python/templates/boilerplate/value_object/string_primitives_mother.py +0 -12
- instant_python-0.15.1/instant_python/templates/boilerplate/value_object/string_value_object.py +0 -24
- instant_python-0.15.1/instant_python/templates/boilerplate/value_object/uuid.py +0 -33
- instant_python-0.15.1/instant_python/templates/boilerplate/value_object/uuid_primitives_mother.py +0 -16
- instant_python-0.15.1/instant_python/templates/project_structure/alembic_migrator.yml.j2 +0 -4
- instant_python-0.15.1/test/initialize/infra/renderer/test_jinja_environment.py +0 -33
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/FUNDING.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/actions/python_setup/action.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/pull_request_template.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/workflows/ci.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/workflows/pages.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.github/workflows/release.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.gitignore +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.pre-commit-config.yaml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/.python-version +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/CITATION.cff +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/LICENSE +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/README.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/SECURITY.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/codeql-config.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/assets/favicon.svg +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/assets/logo.svg +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/changelog_header.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/changelog_init.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/changelog_update.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/changes.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/first_release.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/macros.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.components/versioned_changes.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/.release_notes.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/changelog/CHANGELOG.md.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/development/contributing.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/development/releases.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/development/security.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/downloads_macro.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/getting_started/first_steps.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/getting_started/installation.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/guide/command_config.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/guide/command_init.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/guide/custom_projects.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/guide/default_features.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/guide/index.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/docs/home/index.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/cli/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/cli/cli.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/cli/instant_python_typer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/application/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/application/config_generator.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/delivery/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/delivery/cli.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/domain/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/domain/config_writer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/domain/question_wizard.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/questionary_console_wizard.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/dependencies_step.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/general_step.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/git_step.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/questionary.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/steps.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/question_wizard/step/template_step.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/writer/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/config/infra/writer/yaml_config_writer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/application/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/application/project_initializer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/delivery/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/delivery/cli.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/config_repository.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/env_manager.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/node.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/project_formatter.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/project_renderer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/project_structure.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/project_writer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/domain/version_control_configurer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/env_manager/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/env_manager/env_manager_factory.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/env_manager/pdm_env_manager.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/env_manager/system_console.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/env_manager/uv_env_manager.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/formatter/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/formatter/ruff_project_formatter.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/persistence/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/persistence/yaml_config_repository.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/renderer/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/version_control/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/version_control/git_configurer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/writer/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/initialize/infra/writer/file_system_project_writer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/application_error.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/domain/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/domain/config_schema.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/domain/dependency_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/domain/general_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/domain/git_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/domain/template_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/supported_built_in_features.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/supported_licenses.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/supported_managers.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/supported_python_versions.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/shared/supported_templates.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/.gitignore +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/.python-version +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/CITATION.cff +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/LICENSE +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/README.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/SECURITY.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/domain_event.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/exchange_type.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_settings.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/exceptions/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/exceptions/base_error.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/fastapi/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/fastapi/error_response.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/fastapi/success_response.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/github/action.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/github/bug_report.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/github/feature_request.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/logger/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/logger/json_formatter.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/mypy.ini +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/README.md +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/alembic.ini +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/postgres_settings.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/async/script.py.mako +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/base.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/persistence/synchronous/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/pytest.ini +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/random_generator.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/add_dependency.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/create_aggregate.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/insert_template.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/integration.sh +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/local_setup.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/post-merge.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/pre-commit.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/pre-push.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/remove_dependency.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/scripts/unit.sh +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/validation.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/value_object/value_object.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/citation.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/clean_architecture/main_structure.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/clean_architecture/source.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/clean_architecture/test.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/domain_driven_design/bounded_context.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/domain_driven_design/main_structure.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/domain_driven_design/source.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/domain_driven_design/test.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/event_bus_domain.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/fastapi_app.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/fastapi_domain.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/fastapi_infra.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/github_issues_template.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/gitignore.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/license.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/logger.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/macros.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/makefile.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/mypy.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/precommit_hook.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/pyproject.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/pytest.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/python_version.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/readme.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/security.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/standard_project/main_structure.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/standard_project/source.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/standard_project/test.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/synchronous_sqlalchemy.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/project_structure/test_value_objects.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/makefile +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/mkdocs.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/mypy.ini +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/scripts/add_dependency.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/scripts/remove_dependency.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/config/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/config/application/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/config/application/test_config_generator.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/config/infra/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/config/infra/writer/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/config/infra/writer/test_yaml_config_writer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/application/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/application/test_project_initializer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/approvaltests_config.json +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/approved_files/TestInitCli.test_should_initialize_project_with_custom_project_structure.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/approved_files/TestInitCli.test_should_initialize_project_with_general_section_combinations.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/approved_files/TestInitCli.test_should_initialize_project_with_git_section_combinations.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/approved_files/TestInitCli.test_should_initialize_project_with_predefined_dependencies_and_different_managers.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/approved_files/TestInitCli.test_should_initialize_project_with_template_section_combinations.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/delivery/test_init_cli.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/domain/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/domain/mothers/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/domain/mothers/node_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/domain/mothers/project_structure_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/domain/test_node.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/env_manager/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/env_manager/mother/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/env_manager/mother/command_execution_result_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/env_manager/test_pdm_env_manager.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/env_manager/test_system_console.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/env_manager/test_uv_env_manager.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/formatter/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/formatter/test_ruff_project_formatter.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/persistence/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/persistence/approvaltests_config.json +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/persistence/approved_files/TestYamlConfigRepository.test_should_read_existing_config_file.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/persistence/test_yaml_config_repository.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/renderer/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/renderer/test_jinja_project_renderer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/version_control/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/version_control/test_git_configurer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/writer/TestFileSystemProjectWriter.test_should_create_file_in_file_system.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/writer/TestFileSystemProjectWriter.test_should_create_python_module_in_file_system.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/writer/TestFileSystemProjectWriter.test_should_create_standard_directory_in_file_system.approved.txt +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/writer/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/initialize/infra/writer/test_file_system_project_writer.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/random_generator.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/resources/base_ipy_config.yml +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/resources/domain_error_template.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/resources/hello_world.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/resources/main_structure.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/resources/standard_project/main_structure.yml.j2 +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/mothers/__init__.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/mothers/config_schema_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/mothers/dependency_config_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/mothers/general_config_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/mothers/git_config_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/mothers/template_config_mother.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/test_config_schema.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/test_dependency_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/test_general_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/test_git_config.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/shared/domain/test_template_configuration.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/test/utils.py +0 -0
- {instant_python-0.15.1 → instant_python-0.16.0}/tox.ini +0 -0
|
@@ -2,6 +2,94 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- version list -->
|
|
4
4
|
|
|
5
|
+
## v0.16.0 (2025-11-12)
|
|
6
|
+
|
|
7
|
+
### ✨ Features
|
|
8
|
+
|
|
9
|
+
- **initialize**: Add resolve_import_path filter to jinja environment
|
|
10
|
+
([`22d7fa7`](https://github.com/dimanu-py/instant-python/commit/22d7fa7d9d671f21a9807e8f08ea5882f99eefcb))
|
|
11
|
+
|
|
12
|
+
- **initialize**: Add _resolve_import_path function to be able to get the full import path
|
|
13
|
+
([`1b284ab`](https://github.com/dimanu-py/instant-python/commit/1b284ab4821d3ff91c73bac00717dd96b366b566))
|
|
14
|
+
|
|
15
|
+
### 🪲 Bug Fixes
|
|
16
|
+
|
|
17
|
+
- **templates**: Include pydantic and pydantic settings deps by default when async sqlalchemy is
|
|
18
|
+
selected
|
|
19
|
+
([`a8b1f5d`](https://github.com/dimanu-py/instant-python/commit/a8b1f5df7ffb96040ea0abaa78c4f884b6eaa097))
|
|
20
|
+
|
|
21
|
+
- **templates**: Correct import in domain_event_json_deserializer.py template
|
|
22
|
+
([`33a8864`](https://github.com/dimanu-py/instant-python/commit/33a88646e57251b7c818839388373a1c0ee9ca6d))
|
|
23
|
+
|
|
24
|
+
- **templates**: Correct templates names in event_bus_infra.yml.j2
|
|
25
|
+
([`41a49f8`](https://github.com/dimanu-py/instant-python/commit/41a49f8ddb5a7c456025e7996a511fe8f4fdb1fb))
|
|
26
|
+
|
|
27
|
+
- **templates**: Write correct names in GitHub action and value object templates
|
|
28
|
+
([`7b96b4c`](https://github.com/dimanu-py/instant-python/commit/7b96b4c0378a0b92cf65c5ad5d43ada73e87e4fa))
|
|
29
|
+
|
|
30
|
+
- **templates**: Import UUID inside uuid.py template
|
|
31
|
+
([`c5d0045`](https://github.com/dimanu-py/instant-python/commit/c5d0045defadf3d36f323a0e878dce32abc89b70))
|
|
32
|
+
|
|
33
|
+
- **templates**: Correct wrong indentation in dependencies in pyproject.toml file and write them in
|
|
34
|
+
separate lines
|
|
35
|
+
([`60c6ca0`](https://github.com/dimanu-py/instant-python/commit/60c6ca059d99451a73287d147e107581c95e3f96))
|
|
36
|
+
|
|
37
|
+
### ♻️ Refactoring
|
|
38
|
+
|
|
39
|
+
- **templates**: Move persistence folder with postgres settings structure to its separate template
|
|
40
|
+
and import it as expected in sqlalchemy and migrator
|
|
41
|
+
([`022ead8`](https://github.com/dimanu-py/instant-python/commit/022ead8119bcb53147e796311a6396643d1fb102))
|
|
42
|
+
|
|
43
|
+
- **templates**: Modify imports in boilerplate to import postgres settings from persistence
|
|
44
|
+
([`f5cefc3`](https://github.com/dimanu-py/instant-python/commit/f5cefc333c268a26cf8e95c7684df7dfda1c158c))
|
|
45
|
+
|
|
46
|
+
- **templates**: Write postgres settings file inside persistence folder instead of
|
|
47
|
+
persistence/sqlalchemy
|
|
48
|
+
([`841f24e`](https://github.com/dimanu-py/instant-python/commit/841f24ea8c39967f759ae1b1e0210f4e50697ce4))
|
|
49
|
+
|
|
50
|
+
- **templates**: Include models metadata file only if async sqlalchemy has been included
|
|
51
|
+
([`ca892e6`](https://github.com/dimanu-py/instant-python/commit/ca892e61973761b6dba52ccdb813ea99a0e69a0b))
|
|
52
|
+
|
|
53
|
+
- **templates**: Remove extra empty lines in makefile template
|
|
54
|
+
([`1cb2153`](https://github.com/dimanu-py/instant-python/commit/1cb2153f6c7a59bebb751c5d07452a21faae75c8))
|
|
55
|
+
|
|
56
|
+
- **templates**: Update how development dependencies are set in the pyproject.toml template file
|
|
57
|
+
([`9613543`](https://github.com/dimanu-py/instant-python/commit/961354338756f6d8d2f95eaca173fdc540ecd67f))
|
|
58
|
+
|
|
59
|
+
- **templates**: Update how production dependencies are set in the pyproject.toml template file
|
|
60
|
+
([`7dd9be7`](https://github.com/dimanu-py/instant-python/commit/7dd9be7051cae7dacb7c780c072383410111602b))
|
|
61
|
+
|
|
62
|
+
- **templates**: Update pyproject.toml to support dynamic dependency manager and conditional ruff
|
|
63
|
+
configuration
|
|
64
|
+
([`5209286`](https://github.com/dimanu-py/instant-python/commit/52092862625d8d75d920afabf266562f92c32fb5))
|
|
65
|
+
|
|
66
|
+
- **templates**: Modify github release workflow to use user's dependency manager to build library
|
|
67
|
+
instead of hardcoding uv
|
|
68
|
+
([`6555ba1`](https://github.com/dimanu-py/instant-python/commit/6555ba12921c4e052bce1d64ed093cb339b8d6bb))
|
|
69
|
+
|
|
70
|
+
- **templates**: Modify default github ci workflow to use user's dependency manager to run tests
|
|
71
|
+
instead of hardcoding uv
|
|
72
|
+
([`d2a8fd0`](https://github.com/dimanu-py/instant-python/commit/d2a8fd014e3988a0aa5874202a77d07e8b4bb3cd))
|
|
73
|
+
|
|
74
|
+
- **templates**: Modify makefile template to be easier to change with local variables
|
|
75
|
+
([`9ba8ead`](https://github.com/dimanu-py/instant-python/commit/9ba8eadc8578c2a93f0b6a21906d09adbb2abcc3))
|
|
76
|
+
|
|
77
|
+
- **templates**: Include pre push stages in pre commit hook file only if makefile built in feature
|
|
78
|
+
is selected
|
|
79
|
+
([`e138a0e`](https://github.com/dimanu-py/instant-python/commit/e138a0ec765cabcb1cd7d028fa805a42916df8ef))
|
|
80
|
+
|
|
81
|
+
- **templates**: Simplify import statements using resolve_import_path filter
|
|
82
|
+
([`644da31`](https://github.com/dimanu-py/instant-python/commit/644da319a4a8694aa235ee855e0282f10e5a17a9))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## v0.15.2 (2025-11-10)
|
|
86
|
+
|
|
87
|
+
### 🪲 Bug Fixes
|
|
88
|
+
|
|
89
|
+
- **initialize**: Add warning for missing templates in file content
|
|
90
|
+
([`6574822`](https://github.com/dimanu-py/instant-python/commit/65748223287161c86d7e663e28a8f2a7bd786624))
|
|
91
|
+
|
|
92
|
+
|
|
5
93
|
## v0.15.1 (2025-11-10)
|
|
6
94
|
|
|
7
95
|
### 🪲 Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: instant-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Instant boilerplate generation for Python projects
|
|
5
5
|
Project-URL: documentation, https://dimanu-py.github.io/instant-python/
|
|
6
6
|
Project-URL: repository, https://github.com/dimanu-py/instant-python/
|
|
@@ -30,6 +30,7 @@ class JinjaEnvironment:
|
|
|
30
30
|
self.add_filter("is_in", _is_in)
|
|
31
31
|
self.add_filter("compute_base_path", _compute_base_path)
|
|
32
32
|
self.add_filter("has_dependency", _has_dependency)
|
|
33
|
+
self.add_filter("resolve_import_path", _resolve_import_path)
|
|
33
34
|
|
|
34
35
|
def render_template(self, name: str, context: dict[str, Any] | None = None) -> str:
|
|
35
36
|
template = self._env.get_template(name)
|
|
@@ -63,3 +64,8 @@ def _compute_base_path(initial_path: str, template_type: str) -> str:
|
|
|
63
64
|
return ".".join(path_components[2:])
|
|
64
65
|
else:
|
|
65
66
|
raise UnknownTemplateError(template_type)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _resolve_import_path(initial_path: str, template_type: str) -> str:
|
|
70
|
+
base_path = _compute_base_path(initial_path, template_type)
|
|
71
|
+
return f".{base_path}" if base_path else ""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
4
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event_subscriber" | resolve_import_path(template.name) }} import (
|
|
5
|
+
DomainEventSubscriber,
|
|
6
|
+
)
|
|
7
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event_type_not_found_errorr" | resolve_import_path(template.name) }} import (
|
|
8
|
+
DomainEventTypeNotFoundError,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DomainEventJsonDeserializer:
|
|
13
|
+
_events_mapping: dict[str, type[DomainEvent]]
|
|
14
|
+
|
|
15
|
+
def __init__(self, subscriber: DomainEventSubscriber[DomainEvent]) -> None:
|
|
16
|
+
self._events_mapping = {event.name(): event for event in subscriber.subscribed_to()}
|
|
17
|
+
|
|
18
|
+
def deserialize(self, body: bytes) -> DomainEvent:
|
|
19
|
+
content = json.loads(body)
|
|
20
|
+
event_class = self._events_mapping.get(content["data"]["type"])
|
|
21
|
+
|
|
22
|
+
if not event_class:
|
|
23
|
+
raise DomainEventTypeNotFoundError(content["data"]["type"])
|
|
24
|
+
|
|
25
|
+
return event_class(**content["data"]["attributes"])
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
1
|
import json
|
|
3
2
|
|
|
4
|
-
{
|
|
5
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
|
|
6
|
-
{% else %}
|
|
7
|
-
from {{ general.source_name }}.event.domain_event import DomainEvent
|
|
8
|
-
{% endif %}
|
|
3
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
9
4
|
|
|
10
5
|
|
|
11
6
|
class DomainEventJsonSerializer:
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
1
|
{% if python_version in ["3.12", "3.13"] %}
|
|
3
2
|
from abc import ABC, abstractmethod
|
|
4
3
|
|
|
5
|
-
{
|
|
6
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
|
|
7
|
-
{% else %}
|
|
8
|
-
from {{ general.source_name }}.event.domain_event import DomainEvent
|
|
9
|
-
{% endif %}
|
|
4
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
10
5
|
|
|
11
6
|
|
|
12
7
|
class DomainEventSubscriber[EventType: DomainEvent](ABC):
|
|
@@ -22,11 +17,7 @@ class DomainEventSubscriber[EventType: DomainEvent](ABC):
|
|
|
22
17
|
from abc import ABC, abstractmethod
|
|
23
18
|
from typing import Generic, TypeVar
|
|
24
19
|
|
|
25
|
-
{
|
|
26
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
|
|
27
|
-
{% else %}
|
|
28
|
-
from {{ general.source_name }}.event.domain_event import DomainEvent
|
|
29
|
-
{% endif %}
|
|
20
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
30
21
|
|
|
31
22
|
EventType = TypeVar("EventType", bound=DomainEvent)
|
|
32
23
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
2
|
+
from {{ general.source_name }}{{ "shared.domain.value_objects.aggregate" | resolve_import_path(template.name) }} import Aggregate
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class EventAggregate(Aggregate):
|
|
6
|
+
_domain_events: list[DomainEvent]
|
|
7
|
+
|
|
8
|
+
def __init__(self) -> None:
|
|
9
|
+
self._domain_events = []
|
|
10
|
+
|
|
11
|
+
def record(self, event: DomainEvent) -> None:
|
|
12
|
+
self._domain_events.append(event)
|
|
13
|
+
|
|
14
|
+
def pull_domain_events(self) -> list[DomainEvent]:
|
|
15
|
+
recorded_domain_events = self._domain_events
|
|
16
|
+
self._domain_events = []
|
|
17
|
+
|
|
18
|
+
return recorded_domain_events
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EventBus(ABC):
|
|
7
|
+
@abstractmethod
|
|
8
|
+
async def publish(self, events: list[DomainEvent]) -> None:
|
|
9
|
+
raise NotImplementedError
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from unittest.mock import AsyncMock
|
|
2
|
+
|
|
3
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
4
|
+
from {{ general.source_name }}{{ "shared.domain.event.event_bus" | resolve_import_path(template.name) }} import EventBus
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MockEventBus(EventBus):
|
|
8
|
+
def __init__(self) -> None:
|
|
9
|
+
self._mock_publish = AsyncMock()
|
|
10
|
+
|
|
11
|
+
async def publish(self, events: list[DomainEvent]) -> None:
|
|
12
|
+
await self._mock_publish(events)
|
|
13
|
+
|
|
14
|
+
def should_have_published(self, event: DomainEvent) -> None:
|
|
15
|
+
self._mock_publish.assert_awaited_once_with([event])
|
|
16
|
+
self._mock_publish.reset_mock()
|
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
{
|
|
3
|
-
|
|
4
|
-
{% if template_domain_import %}
|
|
5
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
|
|
6
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event_subscriber import (
|
|
7
|
-
DomainEventSubscriber,
|
|
8
|
-
)
|
|
9
|
-
{% else %}
|
|
10
|
-
from {{ general.source_name }}.event.domain_event import DomainEvent
|
|
11
|
-
from {{ general.source_name }}.event.domain_event_subscriber import (
|
|
1
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
2
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event_subscriber" | resolve_import_path(template.name) }} import (
|
|
12
3
|
DomainEventSubscriber,
|
|
13
4
|
)
|
|
14
|
-
{
|
|
15
|
-
{% if template_infra_import %}
|
|
16
|
-
from {{ general.source_name }}.{{ template_infra_import }}.event.rabbit_mq.rabbit_mq_connection import (
|
|
17
|
-
RabbitMqConnection,
|
|
18
|
-
)
|
|
19
|
-
from {{ general.source_name }}.{{ template_infra_import }}.event.rabbit_mq.rabbit_mq_queue_formatter import (
|
|
20
|
-
RabbitMqQueueFormatter,
|
|
21
|
-
)
|
|
22
|
-
{% else %}
|
|
23
|
-
from {{ general.source_name }}.event.rabbit_mq.rabbit_mq_connection import (
|
|
5
|
+
from {{ general.source_name }}{{ "shared.infra.event.rabbit_mq.rabbit_mq_connection" | resolve_import_path(template.name) }} import (
|
|
24
6
|
RabbitMqConnection,
|
|
25
7
|
)
|
|
26
|
-
from {{ general.source_name }}.event.rabbit_mq.rabbit_mq_queue_formatter import (
|
|
8
|
+
from {{ general.source_name }}{{ "shared.infra.event.rabbit_mq.rabbit_mq_queue_formatter" | resolve_import_path(template.name) }} import (
|
|
27
9
|
RabbitMqQueueFormatter,
|
|
28
10
|
)
|
|
29
|
-
{% endif %}
|
|
30
11
|
|
|
31
12
|
|
|
32
13
|
class RabbitMqConfigurer:
|
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
3
1
|
from typing import Callable
|
|
4
2
|
|
|
5
3
|
import pika
|
|
6
4
|
from pika.adapters.blocking_connection import BlockingChannel
|
|
7
5
|
|
|
8
|
-
{
|
|
9
|
-
from {{ general.source_name }}
|
|
10
|
-
from {{ general.source_name }}.{{ template_domain_import }}.errors.rabbit_mq_connection_not_established_error import (
|
|
6
|
+
from {{ general.source_name }}{{ "shared.domain.event.exchange_type" | resolve_import_path(template.name) }} import ExchangeType
|
|
7
|
+
from {{ general.source_name }}{{ "shared.domain.errors.rabbit_mq_connection_not_established_error" | resolve_import_path(template.name) }} import (
|
|
11
8
|
RabbitMqConnectionNotEstablishedError,
|
|
12
9
|
)
|
|
13
|
-
{
|
|
14
|
-
from {{ general.source_name }}.event.exchange_type import ExchangeType
|
|
15
|
-
from {{ general.source_name }}.errors.rabbit_mq_connection_not_established_error import (
|
|
16
|
-
RabbitMqConnectionNotEstablishedError,
|
|
17
|
-
)
|
|
18
|
-
{% endif %}
|
|
19
|
-
{% if template_infra_import %}
|
|
20
|
-
from {{ general.source_name }}.{{ template_infra_import }}.event.rabbit_mq.rabbit_mq_settings import (
|
|
21
|
-
RabbitMqSettings,
|
|
22
|
-
)
|
|
23
|
-
{% else %}
|
|
24
|
-
from {{ general.source_name }}.event.rabbit_mq.rabbit_mq_settings import (
|
|
10
|
+
from {{ general.source_name }}{{ "shared.infra.event.rabbit_mq.rabbit_mq_settings" | resolve_import_path(template.name) }} import (
|
|
25
11
|
RabbitMqSettings,
|
|
26
12
|
)
|
|
27
|
-
{% endif %}
|
|
28
13
|
|
|
29
14
|
|
|
30
15
|
class RabbitMqConnection:
|
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
3
1
|
from pika.adapters.blocking_connection import BlockingChannel
|
|
4
2
|
from pika.spec import Basic, BasicProperties
|
|
5
3
|
|
|
6
|
-
{
|
|
7
|
-
from {{ general.source_name }}
|
|
8
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event_subscriber import (
|
|
4
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
5
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event_subscriber" | resolve_import_path(template.name) }} import (
|
|
9
6
|
DomainEventSubscriber,
|
|
10
7
|
)
|
|
11
|
-
{
|
|
12
|
-
from {{ general.source_name }}.event.domain_event import DomainEvent
|
|
13
|
-
from {{ general.source_name }}.event.domain_event_subscriber import (
|
|
14
|
-
DomainEventSubscriber,
|
|
15
|
-
)
|
|
16
|
-
{% endif %}
|
|
17
|
-
{% if template_infra_import %}
|
|
18
|
-
from {{ general.source_name }}.{{ template_infra_import }}.event.domain_event_json_deserializer import (
|
|
19
|
-
DomainEventJsonDeserializer,
|
|
20
|
-
)
|
|
21
|
-
from {{ general.source_name }}.{{ template_infra_import }}.event.rabbit_mq.rabbit_mq_connection import (
|
|
22
|
-
RabbitMqConnection,
|
|
23
|
-
)
|
|
24
|
-
from {{ general.source_name }}.{{ template_infra_import }}.event.rabbit_mq.rabbit_mq_queue_formatter import (
|
|
25
|
-
RabbitMqQueueFormatter,
|
|
26
|
-
)
|
|
27
|
-
{% else %}
|
|
28
|
-
from {{ general.source_name }}.event.domain_event_json_deserializer import (
|
|
8
|
+
from {{ general.source_name }}{{ "shared.infra.event.domain_event_json_deserializer" | resolve_import_path(template.name) }} import (
|
|
29
9
|
DomainEventJsonDeserializer,
|
|
30
10
|
)
|
|
31
|
-
from {{ general.source_name }}.event.rabbit_mq.rabbit_mq_connection import (
|
|
11
|
+
from {{ general.source_name }}{{ "shared.infra.event.rabbit_mq.rabbit_mq_connection" | resolve_import_path(template.name) }} import (
|
|
32
12
|
RabbitMqConnection,
|
|
33
13
|
)
|
|
34
|
-
from {{ general.source_name }}.event.rabbit_mq.rabbit_mq_queue_formatter import (
|
|
14
|
+
from {{ general.source_name }}{{ "shared.infra.event.rabbit_mq.rabbit_mq_queue_formatter" | resolve_import_path(template.name) }} import (
|
|
35
15
|
RabbitMqQueueFormatter,
|
|
36
16
|
)
|
|
37
|
-
{% endif %}
|
|
38
17
|
|
|
39
18
|
|
|
40
19
|
class RabbitMqConsumer:
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
2
|
+
from {{ general.source_name }}{{ "shared.domain.event.event_bus" | resolve_import_path(template.name) }} import EventBus
|
|
3
|
+
from {{ general.source_name }}{{ "shared.infra.event.domain_event_json_serializer" | resolve_import_path(template.name) }} import (
|
|
4
|
+
DomainEventJsonSerializer,
|
|
5
|
+
)
|
|
6
|
+
from {{ general.source_name }}{{ "shared.infra.event.rabbit_mq.rabbit_mq_connection" | resolve_import_path(template.name) }} import (
|
|
7
|
+
RabbitMqConnection,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RabbitMqEventBus(EventBus):
|
|
12
|
+
def __init__(self, client: RabbitMqConnection, exchange_name: str) -> None:
|
|
13
|
+
self._client = client
|
|
14
|
+
self._exchange_name = exchange_name
|
|
15
|
+
self._event_serializer = DomainEventJsonSerializer()
|
|
16
|
+
|
|
17
|
+
def publish(self, events: list[DomainEvent]) -> None:
|
|
18
|
+
for event in events:
|
|
19
|
+
self._client.publish(
|
|
20
|
+
content=self._serialize_event(event),
|
|
21
|
+
exchange=self._exchange_name,
|
|
22
|
+
routing_key=event.name(),
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def _serialize_event(self, event: DomainEvent) -> str:
|
|
26
|
+
return self._event_serializer.serialize(event)
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
1
|
import re
|
|
3
2
|
|
|
4
|
-
{
|
|
5
|
-
from {{ general.source_name }}
|
|
6
|
-
from {{ general.source_name }}.{{ template_domain_import }}.event.domain_event_subscriber import (
|
|
3
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event" | resolve_import_path(template.name) }} import DomainEvent
|
|
4
|
+
from {{ general.source_name }}{{ "shared.domain.event.domain_event_subscriber" | resolve_import_path(template.name) }} import (
|
|
7
5
|
DomainEventSubscriber,
|
|
8
6
|
)
|
|
9
|
-
{% else %}
|
|
10
|
-
from {{ general.source_name }}.event.domain_event import DomainEvent
|
|
11
|
-
from {{ general.source_name }}.event.domain_event_subscriber import (
|
|
12
|
-
DomainEventSubscriber,
|
|
13
|
-
)
|
|
14
|
-
{% endif %}
|
|
15
7
|
|
|
16
8
|
|
|
17
9
|
class RabbitMqQueueFormatter:
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
from {{ general.source_name }}{{ "shared.domain.errors.domain_error" | resolve_import_path(template.name) }} import DomainError
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DomainEventTypeNotFoundError(DomainError):
|
|
5
|
+
def __init__(self, name: str) -> None:
|
|
6
|
+
super().__init__(message=f"Event type {name} not found among subscriber.")
|
instant_python-0.16.0/instant_python/templates/boilerplate/exceptions/incorrect_value_type_error.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from typing import TypeVar
|
|
2
|
+
|
|
3
|
+
from {{ general.source_name }}{{ "shared.domain.errors.domain_error" | resolve_import_path(template.name) }} import DomainError
|
|
4
|
+
|
|
5
|
+
T = TypeVar("T")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class IncorrectValueTypeError(DomainError):
|
|
9
|
+
def __init__(self, value: T) -> None:
|
|
10
|
+
super().__init__(message=f"Value '{value}' is not of type {type(value).__name__}")
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
from {{ general.source_name }}{{ "shared.domain.errors.domain_error" | resolve_import_path(template.name) }} import DomainError
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class InvalidNegativeValueError(DomainError):
|
|
5
|
+
def __init__(self, value: int) -> None:
|
|
6
|
+
super().__init__(message=f"Invalid negative value: {value}")
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from {{ general.source_name }}{{ "shared.domain.errors.domain_error" | resolve_import_path(template.name) }} import DomainError
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RabbitMqConnectionNotEstablishedError(DomainError):
|
|
6
|
+
def __init__(self) -> None:
|
|
7
|
+
super().__init__(message="RabbitMQ connection not established.")
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
3
1
|
from fastapi import FastAPI
|
|
4
2
|
{% if "logger" in template.built_in_features %}
|
|
5
3
|
from fastapi.errors import RequestValidationError
|
|
@@ -40,17 +38,9 @@ from {{ general.source_name }}.api.lifespan import lifespan
|
|
|
40
38
|
from {{ general.source_name }}.delivery.api.lifespan import lifespan
|
|
41
39
|
{% endif %}
|
|
42
40
|
{% endif %}
|
|
43
|
-
{
|
|
44
|
-
from {{ general.source_name }}.{{ template_domain_import }}.errors.domain_error import DomainError
|
|
45
|
-
{% else %}
|
|
46
|
-
from {{ general.source_name }}.errors.domain_error import DomainError
|
|
47
|
-
{% endif %}
|
|
41
|
+
from {{ general.source_name }}{{ "shared.domain.errors.domain_error" | resolve_import_path(template.name) }} import DomainError
|
|
48
42
|
{% if "logger" in template.built_in_features %}
|
|
49
|
-
{
|
|
50
|
-
from {{ general.source_name }}.{{ template_infra_import }}.logger.file_logger import create_file_logger
|
|
51
|
-
{% else %}
|
|
52
|
-
from {{ general.source_name }}.logger.file_logger import create_file_logger
|
|
53
|
-
{% endif %}
|
|
43
|
+
from {{ general.source_name }}{{ "shared.infra.logger.file_logger" | resolve_import_path(template.name) }} import create_file_logger
|
|
54
44
|
{% if template.name == template_types.STANDARD %}
|
|
55
45
|
from {{ general.source_name }}.api.middleare.fast_api_log_middleware import FastapiLogMiddleware
|
|
56
46
|
{% else %}
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
{% set template_domain_import = "shared.domain"|compute_base_path(template.name) %}
|
|
2
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
3
1
|
from fastapi import Request
|
|
4
2
|
from fastapi.responses import JSONResponse
|
|
5
3
|
{% if "logger" in template.built_in_features %}
|
|
6
4
|
from fastapi.errors import RequestValidationError
|
|
7
5
|
from fastapi.exception_handlers import request_validation_exception_handler
|
|
8
|
-
{
|
|
9
|
-
from {{ general.source_name }}.{{ template_infra_import }}.logger.file_logger import create_file_logger
|
|
10
|
-
{% else %}
|
|
11
|
-
from {{ general.source_name }}.logger.file_logger import create_file_logger
|
|
12
|
-
{% endif %}
|
|
13
|
-
{% endif %}
|
|
14
|
-
{% if template_infra_import %}
|
|
15
|
-
from {{ general.source_name }}.{{ template_infra_import }}.http.error_response import InternalServerError, UnprocessableEntityError
|
|
16
|
-
{% else %}
|
|
17
|
-
from {{ general.source_name }}.http.error_response import InternalServerError, UnprocessableEntityError
|
|
18
|
-
{% endif %}
|
|
19
|
-
{% if template_domain_import %}
|
|
20
|
-
from {{ general.source_name }}.{{ template_domain_import }}.errors.domain_error import DomainError
|
|
21
|
-
{% else %}
|
|
22
|
-
from {{ general.source_name }}.errors.domain_error import DomainError
|
|
6
|
+
from {{ general.source_name }}{{ "shared.infra.logger.file_logger" | resolve_import_path(template.name) }} import create_file_logger
|
|
23
7
|
{% endif %}
|
|
8
|
+
from {{ general.source_name }}{{ "shared.infra.http.error_response" | resolve_import_path(template.name) }} import InternalServerError, UnprocessableEntityError
|
|
9
|
+
from {{ general.source_name }}{{ "shared.domain.errors.domain_error" | resolve_import_path(template.name) }} import DomainError
|
|
24
10
|
|
|
25
11
|
|
|
26
12
|
{% if "logger" in template.built_in_features %}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
2
1
|
import time
|
|
3
2
|
|
|
4
3
|
from fastapi import Request, Response, FastAPI
|
|
5
4
|
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
|
|
6
5
|
|
|
7
|
-
{
|
|
8
|
-
from {{ general.source_name }}.{{ template_infra_import }}.logger.file_logger import FileLogger
|
|
9
|
-
{% else %}
|
|
10
|
-
from {{ general.source_name }}.logger.file_logger import FileLogger
|
|
11
|
-
{% endif %}
|
|
6
|
+
from {{ general.source_name }}{{ "shared.infra.logger.file_logger" | resolve_import_path(template.name) }} import FileLogger
|
|
12
7
|
|
|
13
8
|
|
|
14
9
|
class FastapiLogMiddleware(BaseHTTPMiddleware):
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from collections.abc import AsyncGenerator
|
|
2
|
+
from contextlib import asynccontextmanager
|
|
3
|
+
|
|
4
|
+
from fastapi import FastAPI
|
|
5
|
+
|
|
6
|
+
from {{ general.source_name }}{{ "shared.infra.alembic_migrator" | resolve_import_path(template.name) }} import AlembicMigrator
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@asynccontextmanager
|
|
10
|
+
async def lifespan(_: FastAPI) -> AsyncGenerator[None, None]:
|
|
11
|
+
migrator = AlembicMigrator()
|
|
12
|
+
await migrator.migrate()
|
|
13
|
+
yield
|
{instant_python-0.15.1 → instant_python-0.16.0}/instant_python/templates/boilerplate/github/ci.yml
RENAMED
|
@@ -183,10 +183,10 @@ jobs:
|
|
|
183
183
|
uses: ./.github/actions/python_setup
|
|
184
184
|
|
|
185
185
|
- name: 📦 Install test dependencies
|
|
186
|
-
run:
|
|
186
|
+
run: {{ general.dependency_manager }} add pytest pytest-cov
|
|
187
187
|
|
|
188
188
|
- name: 🏃 Run tests
|
|
189
|
-
run:
|
|
189
|
+
run: {{ general.dependency_manager }} run pytest --cov --cov-report=xml --cov-branch test -ra -s
|
|
190
190
|
|
|
191
191
|
- name: 📥 Upload coverage report to Codecov
|
|
192
192
|
uses: codecov/codecov-action@v5
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
2
1
|
import logging
|
|
3
2
|
|
|
4
|
-
{
|
|
5
|
-
from {{ general.source_name }}.{{ template_infra_import }}.logger.file_rotating_handler import TimeRotatingFileHandler
|
|
6
|
-
{% else %}
|
|
7
|
-
from {{ general.source_name }}.logger.file_rotating_handler import TimeRotatingFileHandler
|
|
8
|
-
{% endif %}
|
|
3
|
+
from {{ general.source_name }}{{ "shared.infra.logger.file_rotating_handler" | resolve_import_path(template.name) }} import TimeRotatingFileHandler
|
|
9
4
|
|
|
10
5
|
|
|
11
6
|
class FileLogger:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
{% set template_infra_import = "shared.infra"|compute_base_path(template.name) %}
|
|
2
1
|
import logging
|
|
3
2
|
from collections.abc import Sequence
|
|
4
3
|
from datetime import date
|
|
@@ -6,11 +5,7 @@ from logging.handlers import TimedRotatingFileHandler
|
|
|
6
5
|
from pathlib import Path
|
|
7
6
|
from typing import Self
|
|
8
7
|
|
|
9
|
-
{
|
|
10
|
-
from {{ general.source_name }}.{{ template_infra_import }}.logger.json_formatter import JSONFormatter
|
|
11
|
-
{% else %}
|
|
12
|
-
from {{ general.source_name }}.logger.json_formatter import JSONFormatter
|
|
13
|
-
{% endif %}
|
|
8
|
+
from {{ general.source_name }}{{ "shared.infra.logger.json_formatter" | resolve_import_path(template.name) }} import JSONFormatter
|
|
14
9
|
|
|
15
10
|
|
|
16
11
|
class TimeRotatingFileHandler(logging.Handler):
|