instant-python 0.1.1__tar.gz → 0.2.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.
Files changed (176) hide show
  1. instant_python-0.2.0/.github/workflows/pages.yml +34 -0
  2. {instant_python-0.1.1 → instant_python-0.2.0}/.github/workflows/release.yml +1 -3
  3. {instant_python-0.1.1 → instant_python-0.2.0}/CHANGELOG.md +25 -0
  4. {instant_python-0.1.1 → instant_python-0.2.0}/PKG-INFO +1 -1
  5. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/pdm_manager.py +10 -3
  6. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/uv_manager.py +11 -0
  7. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/conditional_question.py +9 -3
  8. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/template_step.py +21 -13
  9. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/user_requirements.py +1 -0
  10. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/domain_event_json_deserializer.py +3 -3
  11. instant_python-0.2.0/instant_python/templates/boilerplate/event_bus/domain_event_subscriber.py +34 -0
  12. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/event_bus.py +1 -1
  13. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/domain_event_type_not_found_error.py +1 -1
  14. instant_python-0.2.0/instant_python/templates/boilerplate/exceptions/rabbit_mq_connection_not_established_error.py +17 -0
  15. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/synchronous/sqlalchemy_repository.py +1 -1
  16. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/value_object/int_value_object.py +1 -1
  17. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/value_object/string_value_object.py +1 -1
  18. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/value_object/uuid.py +1 -1
  19. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/clean_architecture/source.yml.j2 +2 -2
  20. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/domain_driven_design/source.yml.j2 +5 -3
  21. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/domain_driven_design/test.yml.j2 +2 -0
  22. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/event_bus_domain.yml.j2 +3 -0
  23. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/standard_project/source.yml.j2 +2 -2
  24. {instant_python-0.1.1 → instant_python-0.2.0}/pyproject.toml +1 -1
  25. {instant_python-0.1.1 → instant_python-0.2.0}/uv.lock +1 -1
  26. instant_python-0.1.1/instant_python/templates/boilerplate/event_bus/domain_event_subscriber.py +0 -15
  27. {instant_python-0.1.1 → instant_python-0.2.0}/.github/FUNDING.yml +0 -0
  28. {instant_python-0.1.1 → instant_python-0.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  29. {instant_python-0.1.1 → instant_python-0.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  30. {instant_python-0.1.1 → instant_python-0.2.0}/.github/actions/python_setup/action.yml +0 -0
  31. {instant_python-0.1.1 → instant_python-0.2.0}/.github/workflows/publish.yml +0 -0
  32. {instant_python-0.1.1 → instant_python-0.2.0}/.gitignore +0 -0
  33. {instant_python-0.1.1 → instant_python-0.2.0}/.python-version +0 -0
  34. {instant_python-0.1.1 → instant_python-0.2.0}/LICENSE +0 -0
  35. {instant_python-0.1.1 → instant_python-0.2.0}/README.md +0 -0
  36. {instant_python-0.1.1 → instant_python-0.2.0}/cz.yaml +0 -0
  37. {instant_python-0.1.1 → instant_python-0.2.0}/docs/assets/favicon.svg +0 -0
  38. {instant_python-0.1.1 → instant_python-0.2.0}/docs/assets/logo.svg +0 -0
  39. {instant_python-0.1.1 → instant_python-0.2.0}/docs/contributing.md +0 -0
  40. {instant_python-0.1.1 → instant_python-0.2.0}/docs/getting-started/features.md +0 -0
  41. {instant_python-0.1.1 → instant_python-0.2.0}/docs/getting-started/first-steps.md +0 -0
  42. {instant_python-0.1.1 → instant_python-0.2.0}/docs/getting-started/index.md +0 -0
  43. {instant_python-0.1.1 → instant_python-0.2.0}/docs/getting-started/installation.md +0 -0
  44. {instant_python-0.1.1 → instant_python-0.2.0}/docs/guide/creating-a-project.md +0 -0
  45. {instant_python-0.1.1 → instant_python-0.2.0}/docs/guide/custom-templates.md +0 -0
  46. {instant_python-0.1.1 → instant_python-0.2.0}/docs/guide/features.md +0 -0
  47. {instant_python-0.1.1 → instant_python-0.2.0}/docs/guide/folder-structure.md +0 -0
  48. {instant_python-0.1.1 → instant_python-0.2.0}/docs/guide/index.md +0 -0
  49. {instant_python-0.1.1 → instant_python-0.2.0}/docs/index.md +0 -0
  50. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/__init__.py +0 -0
  51. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/cli.py +0 -0
  52. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/folder_cli.py +0 -0
  53. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/__init__.py +0 -0
  54. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/dependency_manager.py +0 -0
  55. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/dependency_manager_factory.py +0 -0
  56. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/git_configurer.py +0 -0
  57. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/installer.py +0 -0
  58. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/installer/managers.py +0 -0
  59. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_cli.py +0 -0
  60. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/__init__.py +0 -0
  61. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/custom_template_manager.py +0 -0
  62. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/default_template_manager.py +0 -0
  63. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/directory.py +0 -0
  64. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/file.py +0 -0
  65. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/folder_tree.py +0 -0
  66. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/jinja_custom_filters.py +0 -0
  67. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/node.py +0 -0
  68. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/project_generator.py +0 -0
  69. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/project_generator/template_manager.py +0 -0
  70. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/__init__.py +0 -0
  71. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/__init__.py +0 -0
  72. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/boolean_question.py +0 -0
  73. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/choice_question.py +0 -0
  74. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/dependencies_question.py +0 -0
  75. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/free_text_question.py +0 -0
  76. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/multiple_choice_question.py +0 -0
  77. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question/question.py +0 -0
  78. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/question_wizard.py +0 -0
  79. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/__init__.py +0 -0
  80. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/dependencies_step.py +0 -0
  81. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/general_custom_template_project_step.py +0 -0
  82. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/general_project_step.py +0 -0
  83. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/git_step.py +0 -0
  84. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/step/steps.py +0 -0
  85. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/question_prompter/template_types.py +0 -0
  86. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/__init__.py +0 -0
  87. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/.gitignore +0 -0
  88. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/.pre-commit-config.yml +0 -0
  89. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/.python-version +0 -0
  90. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/LICENSE +0 -0
  91. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/__init__.py +0 -0
  92. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/aggregate_root.py +0 -0
  93. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/domain_event.py +0 -0
  94. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/domain_event_json_serializer.py +0 -0
  95. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/exchange_type.py +0 -0
  96. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/mock_event_bus.py +0 -0
  97. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_configurer.py +0 -0
  98. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_connection.py +0 -0
  99. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_consumer.py +0 -0
  100. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_event_bus.py +0 -0
  101. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_queue_formatter.py +0 -0
  102. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_settings.py +0 -0
  103. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/__init__.py +0 -0
  104. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/domain_error.py +0 -0
  105. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/incorrect_value_type_error.py +0 -0
  106. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/invalid_id_format_error.py +0 -0
  107. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/invalid_negative_value_error.py +0 -0
  108. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/exceptions/required_value_error.py +0 -0
  109. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/fastapi/__init__.py +0 -0
  110. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/fastapi/application.py +0 -0
  111. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/fastapi/http_response.py +0 -0
  112. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/fastapi/lifespan.py +0 -0
  113. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/fastapi/status_code.py +0 -0
  114. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/github/action.yml +0 -0
  115. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/github/test_lint.yml +0 -0
  116. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/logger/__init__.py +0 -0
  117. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/logger/json_formatter.py +0 -0
  118. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/logger/logger.py +0 -0
  119. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/mypy.ini +0 -0
  120. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/__init__.py +0 -0
  121. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/alembic_migrator.py +0 -0
  122. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/README.md +0 -0
  123. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/__init__.py +0 -0
  124. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/alembic.ini +0 -0
  125. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/async_engine_fixture.py +0 -0
  126. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/env.py +0 -0
  127. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/models_metadata.py +0 -0
  128. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/postgres_settings.py +0 -0
  129. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/script.py.mako +0 -0
  130. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/async/sqlalchemy_repository.py +0 -0
  131. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/base.py +0 -0
  132. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/synchronous/__init__.py +0 -0
  133. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/persistence/synchronous/session_maker.py +0 -0
  134. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/pyproject.toml +0 -0
  135. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/pytest.ini +0 -0
  136. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/random_generator.py +0 -0
  137. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/add_dependency.sh +0 -0
  138. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/create_aggregate.py +0 -0
  139. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/insert_template.py +0 -0
  140. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/integration.sh +0 -0
  141. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/local_setup.sh +0 -0
  142. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/makefile +0 -0
  143. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/post-merge +0 -0
  144. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/pre-commit +0 -0
  145. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/pre-push +0 -0
  146. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/remove_dependency.sh +0 -0
  147. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/scripts/unit.sh +0 -0
  148. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/value_object/__init__.py +0 -0
  149. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/boilerplate/value_object/value_object.py +0 -0
  150. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/alembic_migrator.yml.j2 +0 -0
  151. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/async_alembic.yml.j2 +0 -0
  152. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/async_sqlalchemy.yml.j2 +0 -0
  153. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/clean_architecture/main_structure.yml.j2 +0 -0
  154. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/clean_architecture/test.yml.j2 +0 -0
  155. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/domain_driven_design/bounded_context.yml.j2 +0 -0
  156. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/domain_driven_design/main_structure.yml.j2 +0 -0
  157. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/event_bus_infra.yml.j2 +0 -0
  158. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/fastapi_app.yml.j2 +0 -0
  159. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/fastapi_infra.yml.j2 +0 -0
  160. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/github_action.yml.j2 +0 -0
  161. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/gitignore.yml.j2 +0 -0
  162. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/license.yml.j2 +0 -0
  163. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/logger.yml.j2 +0 -0
  164. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/macros.j2 +0 -0
  165. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/makefile.yml.j2 +0 -0
  166. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/mypy.yml.j2 +0 -0
  167. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/pre_commit.yml.j2 +0 -0
  168. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/pyproject.yml.j2 +0 -0
  169. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/pytest.yml.j2 +0 -0
  170. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/python_version.yml.j2 +0 -0
  171. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/standard_project/main_structure.yml.j2 +0 -0
  172. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/standard_project/test.yml.j2 +0 -0
  173. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/synchronous_sqlalchemy.yml.j2 +0 -0
  174. {instant_python-0.1.1 → instant_python-0.2.0}/instant_python/templates/project_structure/value_objects.yml.j2 +0 -0
  175. {instant_python-0.1.1 → instant_python-0.2.0}/mkdocs.yml +0 -0
  176. {instant_python-0.1.1 → instant_python-0.2.0}/tox.ini +0 -0
@@ -0,0 +1,34 @@
1
+ name: Publish to GitHub pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch:
10
+
11
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12
+ permissions:
13
+ contents: write
14
+ pages: write
15
+ id-token: write
16
+
17
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19
+ concurrency:
20
+ group: "pages"
21
+ cancel-in-progress: true
22
+
23
+ jobs:
24
+ pages:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - uses: ./.github/actions/python_setup
29
+ - name: Build documentation
30
+ run: uv run mkdocs build
31
+ - name: Deploy to GitHub Pages
32
+ run: uv run mkdocs gh-deploy --force
33
+ env:
34
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,9 +1,7 @@
1
1
  name: Generate Release
2
2
 
3
3
  on:
4
- push:
5
- branches:
6
- - main
4
+ workflow_dispatch:
7
5
 
8
6
  jobs:
9
7
  bump-version:
@@ -1,3 +1,28 @@
1
+ ## 0.2.0 (2025-04-08)
2
+
3
+ ### ✨ Features
4
+
5
+ - **template**: add new rabbit mq error when user selects event bus built in feature
6
+ - **template**: create rabbit_mq_connection_not_established_error.py boilerplate
7
+
8
+ ### 🐛 Bug Fixes
9
+
10
+ - **template**: correct domain event type not found error import and class name
11
+ - **template**: set event bus publish method async
12
+ - **template**: correct imports in value objects boilerplate
13
+
14
+ ### ♻️ Code Refactoring
15
+
16
+ - **installer**: add virtual environment creation before installing dependencies
17
+ - **template**: conditionally include bounded context based on specify_bounded_context field
18
+ - **template**: add specify_bounded_context field to user requirements
19
+ - **prompter**: be able to execute nested conditional questions
20
+ - **template**: update subquestions structure to use ConditionalQuestion for bounded context specification
21
+ - **prompter**: extend ConditionalQuestion subquestions type hint
22
+ - **prompter**: remove note when prompting built in features for the user to select and remove temporarily synch sql alchemy option
23
+ - **template**: modify project structure templates to include logger and alembic migrator automatically if fastapi application is selected
24
+ - **template**: modify DomainEventSubscriber boilerplate to follow generic type syntax depending on python version
25
+
1
26
  ## 0.1.1 (2025-04-08)
2
27
 
3
28
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: instant-python
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: Python automatic project generator
5
5
  Author-email: dimanu-py <diegomtz126@gmail.com>
6
6
  License: Apache License
@@ -31,6 +31,7 @@ class PdmManager(DependencyManager):
31
31
  print(f">>> Python {version} installed successfully")
32
32
 
33
33
  def install_dependencies(self, dependencies: list[str]) -> None:
34
+ self._create_virtual_environment()
34
35
  for dependency_name in dependencies:
35
36
  self._install_dependency(dependency_name)
36
37
 
@@ -67,6 +68,12 @@ class PdmManager(DependencyManager):
67
68
  group_flag += f"--group {group_name}"
68
69
  return f"{dev_flag} {group_flag}"
69
70
 
70
-
71
-
72
-
71
+ def _create_virtual_environment(self) -> None:
72
+ command = f"{self._pdm} install"
73
+ subprocess.run(
74
+ command,
75
+ shell=True,
76
+ check=True,
77
+ cwd=self._project_directory,
78
+ stdout=subprocess.DEVNULL,
79
+ )
@@ -33,6 +33,7 @@ class UvManager(DependencyManager):
33
33
  print(f">>> Python {version} installed successfully")
34
34
 
35
35
  def install_dependencies(self, dependencies: list[str]) -> None:
36
+ self._create_virtual_environment()
36
37
  for dependency_name in dependencies:
37
38
  self._install_dependency(dependency_name)
38
39
 
@@ -71,3 +72,13 @@ class UvManager(DependencyManager):
71
72
  ).ask()["group_name"]
72
73
  flag = f"--group {group_name}"
73
74
  return flag
75
+
76
+ def _create_virtual_environment(self) -> None:
77
+ command = f"{self._uv} sync"
78
+ subprocess.run(
79
+ command,
80
+ shell=True,
81
+ check=True,
82
+ cwd=self._project_directory,
83
+ stdout=subprocess.DEVNULL,
84
+ )
@@ -1,9 +1,11 @@
1
+ from typing import Union
2
+
1
3
  from instant_python.question_prompter.question.question import Question
2
4
 
3
5
 
4
6
  class ConditionalQuestion:
5
7
  def __init__(
6
- self, base_question: Question, subquestions: list[Question], condition: str | bool
8
+ self, base_question: Question, subquestions: Union[list[Question], "ConditionalQuestion"], condition: str | bool
7
9
  ) -> None:
8
10
  self._base_question = base_question
9
11
  self._subquestions = subquestions
@@ -16,8 +18,12 @@ class ConditionalQuestion:
16
18
  return base_answer
17
19
 
18
20
  answers = base_answer
19
- for question in self._subquestions:
20
- answers.update(question.ask())
21
+
22
+ if isinstance(self._subquestions, ConditionalQuestion):
23
+ answers.update(self._subquestions.ask())
24
+ else:
25
+ for question in self._subquestions:
26
+ answers.update(question.ask())
21
27
  return answers
22
28
 
23
29
  def _base_answer_does_not_satisfies_condition(self, base_answer: dict[str, str]) -> bool:
@@ -1,3 +1,4 @@
1
+ from instant_python.question_prompter.question.boolean_question import BooleanQuestion
1
2
  from instant_python.question_prompter.question.choice_question import ChoiceQuestion
2
3
  from instant_python.question_prompter.question.conditional_question import (
3
4
  ConditionalQuestion,
@@ -17,12 +18,11 @@ class TemplateStep(Step):
17
18
  self._questions = [
18
19
  MultipleChoiceQuestion(
19
20
  key="built_in_features",
20
- message="Select the built-in features you want to include (fastapi_application option requires logger)",
21
+ message="Select the built-in features you want to include",
21
22
  options=[
22
23
  "value_objects",
23
24
  "github_actions",
24
25
  "makefile",
25
- "synchronous_sqlalchemy",
26
26
  "logger",
27
27
  "event_bus",
28
28
  "async_sqlalchemy",
@@ -40,18 +40,26 @@ class TemplateStep(Step):
40
40
  "standard_project",
41
41
  ],
42
42
  ),
43
- subquestions=[
44
- FreeTextQuestion(
45
- key="bounded_context",
46
- message="Enter the bounded context name",
47
- default="backoffice",
43
+ subquestions=ConditionalQuestion(
44
+ base_question=BooleanQuestion(
45
+ key="specify_bounded_context",
46
+ message="Do you want to specify your first bounded context?",
47
+ default=True,
48
48
  ),
49
- FreeTextQuestion(
50
- key="aggregate_name",
51
- message="Enter the aggregate name",
52
- default="user",
53
- ),
54
- ],
49
+ subquestions=[
50
+ FreeTextQuestion(
51
+ key="bounded_context",
52
+ message="Enter the bounded context name",
53
+ default="backoffice",
54
+ ),
55
+ FreeTextQuestion(
56
+ key="aggregate_name",
57
+ message="Enter the aggregate name",
58
+ default="user",
59
+ ),
60
+ ],
61
+ condition=True,
62
+ ),
55
63
  condition=TemplateTypes.DDD,
56
64
  ),
57
65
  ]
@@ -20,6 +20,7 @@ class UserRequirements:
20
20
  git_email: str = field(default_factory=str)
21
21
  git_user_name: str = field(default_factory=str)
22
22
  dependencies: list[str] = field(default_factory=list)
23
+ specify_bounded_context: bool = field(default=False)
23
24
  bounded_context: str = field(default_factory=str)
24
25
  aggregate_name: str = field(default_factory=str)
25
26
  built_in_features: list[str] = field(default_factory=list)
@@ -5,8 +5,8 @@ from {{ source_name }}.{{ template_domain_import }}.event.domain_event import Do
5
5
  from {{ source_name }}.{{ template_domain_import }}.event.domain_event_subscriber import (
6
6
  DomainEventSubscriber,
7
7
  )
8
- from {{ source_name }}.{{ template_domain_import }}.exceptions.domain_event_type_not_found import (
9
- DomainEventTypeNotFound,
8
+ from {{ source_name }}.{{ template_domain_import }}.exceptions.domain_event_type_not_found_error import (
9
+ DomainEventTypeNotFoundError,
10
10
  )
11
11
 
12
12
 
@@ -23,6 +23,6 @@ class DomainEventJsonDeserializer:
23
23
  event_class = self._events_mapping.get(content["data"]["type"])
24
24
 
25
25
  if not event_class:
26
- raise DomainEventTypeNotFound(content["data"]["type"])
26
+ raise DomainEventTypeNotFoundError(content["data"]["type"])
27
27
 
28
28
  return event_class(**content["data"]["attributes"])
@@ -0,0 +1,34 @@
1
+ {% set template_domain_import = "shared.domain"|compute_base_path(template) %}
2
+ {% if pythono_version in ["3.12", "3.13"] %}
3
+ from abc import ABC, abstractmethod
4
+
5
+ from {{ source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
6
+
7
+
8
+ class DomainEventSubscriber[EventType: DomainEvent](ABC):
9
+ @staticmethod
10
+ @abstractmethod
11
+ def subscribed_to() -> list[type[EventType]]:
12
+ raise NotImplementedError
13
+
14
+ @abstractmethod
15
+ def on(self, event: EventType) -> None:
16
+ raise NotImplementedError
17
+ {% else %}
18
+ from abc import ABC, abstractmethod
19
+ from typing import Generic, TypeVar
20
+
21
+ from {{ source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
22
+
23
+ EventType = TypeVar("EventType", bound=DomainEvent)
24
+
25
+ class DomainEventSubscriber(Generic[EventType], ABC):
26
+ @staticmethod
27
+ @abstractmethod
28
+ def subscribed_to() -> list[type[EventType]]:
29
+ raise NotImplementedError
30
+
31
+ @abstractmethod
32
+ def on(self, event: EventType) -> None:
33
+ raise NotImplementedError
34
+ {% endif %}
@@ -6,5 +6,5 @@ from {{ source_name }}.{{ template_domain_import }}.event.domain_event import Do
6
6
 
7
7
  class EventBus(ABC):
8
8
  @abstractmethod
9
- def publish(self, events: list[DomainEvent]) -> None:
9
+ async def publish(self, events: list[DomainEvent]) -> None:
10
10
  raise NotImplementedError
@@ -2,7 +2,7 @@
2
2
  from {{ source_name }}.{{ template_domain_import }}.exceptions.domain_error import DomainError
3
3
 
4
4
 
5
- class DomainEventTypeNotFound(DomainError):
5
+ class DomainEventTypeNotFoundError(DomainError):
6
6
  def __init__(self, name: str) -> None:
7
7
  self._message = f"Event type {name} not found among subscriber."
8
8
  self._type = "domain_event_type_not_found"
@@ -0,0 +1,17 @@
1
+ {% set template_domain_import = "shared.domain"|compute_base_path(template) %}
2
+ from {{ source_name }}.{{ template_domain_import }}.exceptions.domain_error import DomainError
3
+
4
+
5
+ class RabbitMqConnectionNotEstablishedError(DomainError):
6
+ def __init__(self) -> None:
7
+ self._message = "RabbitMQ connection not established."
8
+ self._type = "rabbit_mq_connection"
9
+ super().__init__(self._message)
10
+
11
+ @property
12
+ def type(self) -> str:
13
+ return self._type
14
+
15
+ @property
16
+ def message(self) -> str:
17
+ return self._message
@@ -6,7 +6,7 @@ from typing import TypeVar
6
6
  from typing import TypeVar, Generic
7
7
  {% endif %}
8
8
 
9
- from {{ source_name }}.{{ template_domain_import }}.value_objects.uuid import Uuid
9
+ from {{ source_name }}.{{ template_domain_import }}.value_object.uuid import Uuid
10
10
  from {{ source_name }}.{{ template_infra_import }}.persistence.sqlalchemy.base import Base
11
11
  from {{ source_name }}.{{ template_infra_import }}.persistence.sqlalchemy.session_maker import (
12
12
  SessionMaker,
@@ -2,7 +2,7 @@
2
2
  from {{ source_name }}.{{ template_domain_import }}.exceptions.invalid_negative_value_error import (
3
3
  InvalidNegativeValueError,
4
4
  )
5
- from {{ source_name }}.{{ template_domain_import }}.value_objects.value_object import ValueObject
5
+ from {{ source_name }}.{{ template_domain_import }}.value_object.value_object import ValueObject
6
6
 
7
7
 
8
8
  class IntValueObject(ValueObject[int]):
@@ -5,7 +5,7 @@ from {{ source_name }}.{{ template_domain_import }}.exceptions.incorrect_value_t
5
5
  from {{ source_name }}.{{ template_domain_import }}.exceptions.required_value_error import (
6
6
  RequiredValueError,
7
7
  )
8
- from {{ source_name }}.{{ template_domain_import }}.value_objects.value_object import ValueObject
8
+ from {{ source_name }}.{{ template_domain_import }}.value_object.value_object import ValueObject
9
9
 
10
10
 
11
11
  class StringValueObject(ValueObject[str]):
@@ -4,7 +4,7 @@ from uuid import UUID
4
4
  from {{ source_name }}.{{ template_domain_import }}.exceptions.required_value_error import (
5
5
  RequiredValueError,
6
6
  )
7
- from {{ source_name }}.{{ template_domain_import }}.value_objects.value_object import ValueObject
7
+ from {{ source_name }}.{{ template_domain_import }}.value_object.value_object import ValueObject
8
8
 
9
9
 
10
10
  class Uuid(ValueObject[str]):
@@ -36,13 +36,13 @@
36
36
  {% if "event_bus" in built_in_features %}
37
37
  {{ macros.include_and_indent("project_structure/event_bus_infra.yml.j2", 8) }}
38
38
  {% endif %}
39
- {% if "logger" in built_in_features %}
39
+ {% if ["logger", "fastapi_application"] | is_in(built_in_features) %}
40
40
  {{ macros.include_and_indent("project_structure/logger.yml.j2", 8) }}
41
41
  {% endif %}
42
42
  {% if "async_sqlalchemy" in built_in_features %}
43
43
  {{ macros.include_and_indent("project_structure/async_sqlalchemy.yml.j2", 8) }}
44
44
  {% endif %}
45
- {% if "async_alembic" in built_in_features %}
45
+ {% if ["async_alembic", "fastapi_application"] | is_in(built_in_features) %}
46
46
  {{ macros.include_and_indent("project_structure/alembic_migrator.yml.j2", 8) }}
47
47
  {% endif %}
48
48
  {% if "fastapi_application" in built_in_features %}
@@ -38,13 +38,13 @@
38
38
  {% if "event_bus" in built_in_features %}
39
39
  {{ macros.include_and_indent("project_structure/event_bus_infra.yml.j2", 12) }}
40
40
  {% endif %}
41
- {% if "logger" in built_in_features %}
41
+ {% if ["logger", "fastapi_application"] | is_in(built_in_features) %}
42
42
  {{ macros.include_and_indent("project_structure/logger.yml.j2", 12) }}
43
43
  {% endif %}
44
44
  {% if "async_sqlalchemy" in built_in_features %}
45
45
  {{ macros.include_and_indent("project_structure/async_sqlalchemy.yml.j2", 12) }}
46
46
  {% endif %}
47
- {% if "async_alembic" in built_in_features %}
47
+ {% if ["async_alembic", "fastapi_application"] | is_in(built_in_features) %}
48
48
  {{ macros.include_and_indent("project_structure/alembic_migrator.yml.j2", 12) }}
49
49
  {% endif %}
50
50
  {% if "fastapi_application" in built_in_features %}
@@ -52,4 +52,6 @@
52
52
  {% endif %}
53
53
  {% endif %}
54
54
  {% endif %}
55
- {{ macros.include_and_indent("project_structure/domain_driven_design/bounded_context.yml.j2", 4) }}
55
+ {% if specify_bounded_context %}
56
+ {{ macros.include_and_indent("project_structure/domain_driven_design/bounded_context.yml.j2", 4) }}
57
+ {% endig %}
@@ -23,4 +23,6 @@
23
23
  type: file
24
24
  extension: .py
25
25
  {% endif %}
26
+ {% if specify_bounded_context %}
26
27
  {{ macros.include_and_indent("project_structure/domain_driven_design/bounded_context.yml.j2", 4) }}
28
+ {% endig %}
@@ -22,5 +22,8 @@
22
22
  python: True
23
23
  children:
24
24
  - name: exceptions/domain_event_type_not_found_error
25
+ type: file
26
+ extension: .py
27
+ - name: exceptions/rabbit_mq_connection_not_established_error
25
28
  type: file
26
29
  extension: .py
@@ -14,13 +14,13 @@
14
14
  {% if "synchronous_sqlalchemy" in built_in_features %}
15
15
  {{ macros.include_and_indent("project_structure/synchronous_sqlalchemy.yml.j2", 4) }}
16
16
  {% endif %}
17
- {% if "logger" in built_in_features %}
17
+ {% if ["logger", "fastapi_application"] | is_in(built_in_features) %}
18
18
  {{ macros.include_and_indent("project_structure/logger.yml.j2", 4) }}
19
19
  {% endif %}
20
20
  {% if "async_sqlalchemy" in built_in_features %}
21
21
  {{ macros.include_and_indent("project_structure/async_sqlalchemy.yml.j2", 4) }}
22
22
  {% endif %}
23
- {% if "async_alembic" in built_in_features %}
23
+ {% if ["async_alembic", "fastapi_application"] | is_in(built_in_features) %}
24
24
  {{ macros.include_and_indent("project_structure/alembic_migrator.yml.j2", 4) }}
25
25
  {% endif %}
26
26
  {% if "fastapi_application" in built_in_features %}
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "instant-python"
7
- version = "0.1.1"
7
+ version = "0.2.0"
8
8
  description = "Python automatic project generator"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -240,7 +240,7 @@ wheels = [
240
240
 
241
241
  [[package]]
242
242
  name = "instant-python"
243
- version = "0.1.1"
243
+ version = "0.2.0"
244
244
  source = { editable = "." }
245
245
  dependencies = [
246
246
  { name = "jinja2" },
@@ -1,15 +0,0 @@
1
- {% set template_domain_import = "shared.domain"|compute_base_path(template) %}
2
- from abc import ABC, abstractmethod
3
-
4
- from {{ source_name }}.{{ template_domain_import }}.event.domain_event import DomainEvent
5
-
6
-
7
- class DomainEventSubscriber[EventType: DomainEvent](ABC):
8
- @staticmethod
9
- @abstractmethod
10
- def subscribed_to() -> list[type[EventType]]:
11
- raise NotImplementedError
12
-
13
- @abstractmethod
14
- def on(self, event: EventType) -> None:
15
- raise NotImplementedError
File without changes
File without changes
File without changes
File without changes