instant-python 0.3.0__tar.gz → 0.5.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.3.0 → instant_python-0.5.0}/.github/workflows/release.yml +6 -5
- {instant_python-0.3.0 → instant_python-0.5.0}/CHANGELOG.md +36 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/PKG-INFO +1 -1
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/getting-started/installation.md +1 -1
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/guide/custom-templates.md +46 -29
- instant_python-0.3.0/docs/welcome.md → instant_python-0.5.0/docs/index.md +0 -1
- instant_python-0.5.0/instant_python/cli.py +28 -0
- instant_python-0.5.0/instant_python/errors/application_error.py +11 -0
- instant_python-0.5.0/instant_python/errors/command_execution_error.py +20 -0
- instant_python-0.5.0/instant_python/errors/error_types.py +6 -0
- instant_python-0.5.0/instant_python/errors/template_file_not_found_error.py +18 -0
- instant_python-0.5.0/instant_python/errors/unknown_dependency_manager_error.py +18 -0
- instant_python-0.5.0/instant_python/errors/unknown_node_typer_error.py +16 -0
- instant_python-0.5.0/instant_python/errors/unknown_template_error.py +16 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/dependency_manager_factory.py +5 -1
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/git_configurer.py +3 -0
- instant_python-0.5.0/instant_python/installer/installer.py +24 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/managers.py +0 -1
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/pdm_manager.py +7 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/uv_manager.py +4 -0
- instant_python-0.5.0/instant_python/intant_python_typer.py +30 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/custom_template_manager.py +2 -3
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/folder_tree.py +3 -8
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/jinja_custom_filters.py +2 -1
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/project_generator.py +12 -7
- instant_python-0.5.0/instant_python/templates/boilerplate/README.md +5 -0
- instant_python-0.5.0/instant_python/templates/boilerplate/value_object/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/clean_architecture/main_structure.yml.j2 +1 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/domain_driven_design/main_structure.yml.j2 +1 -0
- instant_python-0.5.0/instant_python/templates/project_structure/readme.yml.j2 +3 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/standard_project/main_structure.yml.j2 +1 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/mkdocs.yml +1 -2
- {instant_python-0.3.0 → instant_python-0.5.0}/pyproject.toml +1 -1
- {instant_python-0.3.0 → instant_python-0.5.0}/uv.lock +1 -1
- instant_python-0.3.0/instant_python/cli.py +0 -11
- instant_python-0.3.0/instant_python/installer/installer.py +0 -18
- {instant_python-0.3.0 → instant_python-0.5.0}/.github/FUNDING.yml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.github/actions/python_setup/action.yml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.github/workflows/pages.yml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.github/workflows/publish.yml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.gitignore +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/.python-version +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/LICENSE +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/README.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/cz.yaml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/assets/favicon.svg +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/assets/logo.svg +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/contributing.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/getting-started/features_overview.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/getting-started/first-steps.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/getting-started/index.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/guide/creating-a-project.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/guide/features.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/guide/folder-structure.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/guide/index.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/docs/guide/when-to-use-commands.md +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/__init__.py +0 -0
- {instant_python-0.3.0/instant_python/installer → instant_python-0.5.0/instant_python/errors}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/folder_cli.py +0 -0
- {instant_python-0.3.0/instant_python/project_generator → instant_python-0.5.0/instant_python/installer}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/dependency_manager.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_cli.py +0 -0
- {instant_python-0.3.0/instant_python/question_prompter → instant_python-0.5.0/instant_python/project_generator}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/boilerplate_file.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/directory.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/file.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/jinja_environment.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/jinja_template_manager.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/node.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/template_manager.py +0 -0
- {instant_python-0.3.0/instant_python/question_prompter/question → instant_python-0.5.0/instant_python/question_prompter}/__init__.py +0 -0
- {instant_python-0.3.0/instant_python/question_prompter/step → instant_python-0.5.0/instant_python/question_prompter/question}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/boolean_question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/choice_question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/conditional_question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/dependencies_question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/free_text_question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/multiple_choice_question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question/question.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/question_wizard.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/requirements_configuration.py +0 -0
- {instant_python-0.3.0/instant_python/templates → instant_python-0.5.0/instant_python/question_prompter/step}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/step/dependencies_step.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/step/general_custom_template_project_step.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/step/general_project_step.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/step/git_step.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/step/steps.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/step/template_step.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/question_prompter/template_types.py +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/event_bus → instant_python-0.5.0/instant_python/templates}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/.gitignore +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/.pre-commit-config.yml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/.python-version +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/LICENSE +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/exceptions → instant_python-0.5.0/instant_python/templates/boilerplate/event_bus}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/aggregate_root.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/domain_event.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/domain_event_json_deserializer.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/domain_event_json_serializer.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/domain_event_subscriber.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/event_bus.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/exchange_type.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/mock_event_bus.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_configurer.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_connection.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_consumer.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_event_bus.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_queue_formatter.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/event_bus/rabbit_mq_settings.py +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/fastapi → instant_python-0.5.0/instant_python/templates/boilerplate/exceptions}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/domain_error.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/domain_event_type_not_found_error.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/incorrect_value_type_error.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/invalid_id_format_error.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/invalid_negative_value_error.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/rabbit_mq_connection_not_established_error.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/exceptions/required_value_error.py +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/logger → instant_python-0.5.0/instant_python/templates/boilerplate/fastapi}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/fastapi/application.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/fastapi/http_response.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/fastapi/lifespan.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/fastapi/status_code.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/github/action.yml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/github/test_lint.yml +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/persistence → instant_python-0.5.0/instant_python/templates/boilerplate/logger}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/logger/json_formatter.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/logger/logger.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/mypy.ini +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/persistence/async → instant_python-0.5.0/instant_python/templates/boilerplate/persistence}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/alembic_migrator.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/README.md +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/persistence/synchronous → instant_python-0.5.0/instant_python/templates/boilerplate/persistence/async}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/alembic.ini +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/async_engine_fixture.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/env.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/models_metadata.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/postgres_settings.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/script.py.mako +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/async/sqlalchemy_repository.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/base.py +0 -0
- {instant_python-0.3.0/instant_python/templates/boilerplate/value_object → instant_python-0.5.0/instant_python/templates/boilerplate/persistence/synchronous}/__init__.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/synchronous/session_maker.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/persistence/synchronous/sqlalchemy_repository.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/pyproject.toml +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/pytest.ini +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/random_generator.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/add_dependency.sh +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/create_aggregate.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/insert_template.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/integration.sh +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/local_setup.sh +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/makefile +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/post-merge +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/pre-commit +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/pre-push +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/remove_dependency.sh +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/scripts/unit.sh +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/value_object/int_value_object.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/value_object/string_value_object.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/value_object/uuid.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/boilerplate/value_object/value_object.py +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/alembic_migrator.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/async_alembic.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/async_sqlalchemy.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/clean_architecture/source.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/clean_architecture/test.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/domain_driven_design/bounded_context.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/domain_driven_design/source.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/domain_driven_design/test.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/event_bus_domain.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/event_bus_infra.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/fastapi_app.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/fastapi_infra.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/github_action.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/gitignore.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/license.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/logger.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/macros.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/makefile.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/mypy.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/pre_commit.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/pyproject.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/pytest.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/python_version.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/standard_project/source.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/standard_project/test.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/synchronous_sqlalchemy.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/instant_python/templates/project_structure/value_objects.yml.j2 +0 -0
- {instant_python-0.3.0 → instant_python-0.5.0}/tox.ini +0 -0
|
@@ -4,11 +4,11 @@ on:
|
|
|
4
4
|
workflow_dispatch:
|
|
5
5
|
|
|
6
6
|
jobs:
|
|
7
|
-
|
|
7
|
+
bump_version:
|
|
8
8
|
if: "!startsWith(github.event.head_commit.message, 'bump:')"
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
outputs:
|
|
11
|
-
tag: ${{ steps.bump.outputs.
|
|
11
|
+
tag: ${{ steps.bump.outputs.version }}
|
|
12
12
|
steps:
|
|
13
13
|
- name: Check out
|
|
14
14
|
uses: actions/checkout@v3
|
|
@@ -17,12 +17,13 @@ jobs:
|
|
|
17
17
|
fetch-depth: 0
|
|
18
18
|
|
|
19
19
|
- name: Bump version and update changelog
|
|
20
|
+
id: bump
|
|
20
21
|
uses: commitizen-tools/commitizen-action@master
|
|
21
22
|
with:
|
|
22
23
|
github_token: ${{ secrets.CHANGELOG_TOKEN }}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
needs:
|
|
25
|
+
create_release:
|
|
26
|
+
needs: bump_version
|
|
26
27
|
runs-on: ubuntu-latest
|
|
27
28
|
steps:
|
|
28
29
|
- name: Check out
|
|
@@ -46,7 +47,7 @@ jobs:
|
|
|
46
47
|
- name: Extract Changelog for Release
|
|
47
48
|
id: extract_changelog
|
|
48
49
|
run: |
|
|
49
|
-
release="${{ steps.
|
|
50
|
+
release="${{ steps.release_tag.outputs.release_tag }}"
|
|
50
51
|
echo "Extracting changelog for tag: ${release}"
|
|
51
52
|
|
|
52
53
|
awk -v tag="$release" '
|
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
## 0.5.0 (2025-04-15)
|
|
2
|
+
|
|
3
|
+
### ✨ Features
|
|
4
|
+
|
|
5
|
+
- **cli**: create main application based on custom implementation and add error handlers
|
|
6
|
+
- **cli**: implement a custom version of Typer application to be able to handle exceptions in FastAPI way using decorators
|
|
7
|
+
- **errors**: add UnknownTemplateError for handling unknown template types
|
|
8
|
+
- **errors**: add TemplateFileNotFoundError for missing template files and extend ErrorTypes with GENERATOR
|
|
9
|
+
- **errors**: add ErrorTypes enum for categorizing error types
|
|
10
|
+
- **errors**: add CommandExecutionError for handling command execution failures
|
|
11
|
+
- **errors**: add UnknownDependencyManagerError for handling unknown dependency managers
|
|
12
|
+
- **installer**: remove unused PYENV manager from Enum
|
|
13
|
+
- **errors**: create application error to be able to capture all expected errors
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug Fixes
|
|
16
|
+
|
|
17
|
+
- **errors**: correct typo in UnknownTemplateError message
|
|
18
|
+
|
|
19
|
+
### ♻️ Code Refactoring
|
|
20
|
+
|
|
21
|
+
- **project-generator**: manage when a command fails by raising custom CommandExecutionError
|
|
22
|
+
- **installer**: manage when a command fails by raising custom CommandExecutionError
|
|
23
|
+
- **cli**: enhance error handling with rich console output
|
|
24
|
+
- **project-generator**: raise UnknownTemplateError for unknown template types
|
|
25
|
+
- **project-generator**: move UnknownErrorTypeError to errors module and inherit from ApplicationError
|
|
26
|
+
- **project-generator**: raise TemplateFileNotFoundError for missing template files
|
|
27
|
+
- **errors**: use ErrorTypes enum for error type in CommandExecutionError and UnknownDependencyManagerError
|
|
28
|
+
- **installer**: add stderr handling for subprocess calls
|
|
29
|
+
- **installer**: raise UnknownDependencyManagerError for unknown user managers
|
|
30
|
+
|
|
31
|
+
## 0.4.0 (2025-04-11)
|
|
32
|
+
|
|
33
|
+
### ✨ Features
|
|
34
|
+
|
|
35
|
+
- **template**: add README template and include in main structure
|
|
36
|
+
|
|
1
37
|
## 0.3.0 (2025-04-11)
|
|
2
38
|
|
|
3
39
|
### ✨ Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: instant-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.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/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Installation
|
|
2
2
|
|
|
3
3
|
!!! important
|
|
4
|
-
For the moment, `instant-python` is only supported in Unix-like systems. Windows support is coming soon.
|
|
4
|
+
For the moment, `instant-python` is only supported in Unix-like systems. Windows support is coming soon.
|
|
5
5
|
|
|
6
6
|
To ensure a clean and isolated environment, we recommend installing `instant-python` using a virtual environment. At your
|
|
7
7
|
own risk, you can install it at you system Python installation, but this is not recommended.
|
|
@@ -21,43 +21,60 @@ offers a Domain Driven Design, Clean Architecture and Standard templates.
|
|
|
21
21
|
|
|
22
22
|
## Examples
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Let's imagine that you want to create a new project using a custom template with Hexagonal Architecture.
|
|
24
|
+
Let's imagine that you want to create a new project using a custom template with Cockburn-style Hexagonal Architecture,
|
|
25
|
+
including a gitignore, README and mypy configuration files.
|
|
27
26
|
You can create a yaml file with the following content:
|
|
28
27
|
|
|
29
28
|
```yaml
|
|
30
29
|
root:
|
|
31
30
|
- name: src
|
|
32
31
|
type: directory
|
|
33
|
-
python:
|
|
34
|
-
children:
|
|
35
|
-
- name: domain
|
|
36
|
-
type: directory
|
|
37
|
-
python: true
|
|
38
|
-
- name: application
|
|
39
|
-
type: directory
|
|
40
|
-
python: true
|
|
41
|
-
- name: ports
|
|
42
|
-
type: directory
|
|
43
|
-
python: true
|
|
44
|
-
- name: adapters
|
|
45
|
-
type: directory
|
|
46
|
-
python: true
|
|
47
|
-
- name: test
|
|
48
|
-
type: directory
|
|
49
|
-
python: true
|
|
32
|
+
python: True
|
|
50
33
|
children:
|
|
51
|
-
- name:
|
|
52
|
-
type: directory
|
|
53
|
-
python: true
|
|
54
|
-
- name: application
|
|
34
|
+
- name: driven_adapters
|
|
55
35
|
type: directory
|
|
56
|
-
python:
|
|
57
|
-
|
|
36
|
+
python: True
|
|
37
|
+
children:
|
|
38
|
+
- name: adapter_for_paying_spy
|
|
39
|
+
type: file
|
|
40
|
+
extension: .py
|
|
41
|
+
- name: adapter_for_obtaining_grates_stup
|
|
42
|
+
type: file
|
|
43
|
+
extension: .py
|
|
44
|
+
- name: driving_adapters
|
|
58
45
|
type: directory
|
|
59
|
-
python:
|
|
60
|
-
|
|
46
|
+
python: True
|
|
47
|
+
children:
|
|
48
|
+
- name: adapter_for_checking_cars_test
|
|
49
|
+
type: file
|
|
50
|
+
extension: .py
|
|
51
|
+
- name: tax_calculator_app
|
|
61
52
|
type: directory
|
|
62
|
-
python:
|
|
53
|
+
python: True
|
|
54
|
+
children:
|
|
55
|
+
- name: driven_ports
|
|
56
|
+
type: directory
|
|
57
|
+
python: True
|
|
58
|
+
children:
|
|
59
|
+
- name: for_paying
|
|
60
|
+
type: file
|
|
61
|
+
extension: .py
|
|
62
|
+
- name: driving_ports
|
|
63
|
+
type: directory
|
|
64
|
+
python: True
|
|
65
|
+
children:
|
|
66
|
+
- name: for_checking_cars
|
|
67
|
+
type: file
|
|
68
|
+
extension: .py
|
|
69
|
+
- name: tax_calculator
|
|
70
|
+
type: directory
|
|
71
|
+
python: True
|
|
72
|
+
- name: .gitignore
|
|
73
|
+
type: file
|
|
74
|
+
- name: README
|
|
75
|
+
type: file
|
|
76
|
+
extension: .md
|
|
77
|
+
- name: mypy
|
|
78
|
+
type: file
|
|
79
|
+
extension: .ini
|
|
63
80
|
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from rich.console import Console
|
|
2
|
+
from rich.panel import Panel
|
|
3
|
+
|
|
4
|
+
from instant_python import folder_cli, project_cli
|
|
5
|
+
from instant_python.errors.application_error import ApplicationError
|
|
6
|
+
from instant_python.intant_python_typer import InstantPythonTyper
|
|
7
|
+
|
|
8
|
+
app = InstantPythonTyper()
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
app.add_typer(folder_cli.app, name="folder", help="Generate only the folder structure for a new project")
|
|
12
|
+
app.add_typer(project_cli.app, name="project", help="Generate a full project ready to be used")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@app.error_handler(ApplicationError)
|
|
16
|
+
def handle_application_error(exc: ApplicationError) -> None:
|
|
17
|
+
error_panel = Panel(exc.message, title="Error", border_style="red")
|
|
18
|
+
console.print(error_panel)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@app.error_handler(Exception)
|
|
22
|
+
def handle_unexpected_error(exc: Exception) -> None:
|
|
23
|
+
error_panel = Panel(f"An unexpected error occurred: {exc}", title="Error", border_style="red")
|
|
24
|
+
console.print(error_panel)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if __name__ == "__main__":
|
|
28
|
+
app()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from instant_python.errors.application_error import ApplicationError
|
|
2
|
+
from instant_python.errors.error_types import ErrorTypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CommandExecutionError(ApplicationError):
|
|
6
|
+
def __init__(self, exit_code: int, stderr_output=None):
|
|
7
|
+
self._message = (
|
|
8
|
+
f"Unexpected error when executing a command, exit code {exit_code}"
|
|
9
|
+
)
|
|
10
|
+
if stderr_output:
|
|
11
|
+
self._message += f": {stderr_output.decode('utf-8').strip()}"
|
|
12
|
+
super().__init__(self._message)
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def type(self) -> str:
|
|
16
|
+
return ErrorTypes.INSTALLER.value
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def message(self) -> str:
|
|
20
|
+
return self._message
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from instant_python.errors.application_error import ApplicationError
|
|
4
|
+
from instant_python.errors.error_types import ErrorTypes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TemplateFileNotFoundError(ApplicationError):
|
|
8
|
+
def __init__(self, template_path: str | Path) -> None:
|
|
9
|
+
self._message = f"Could not find YAML file at: {template_path}"
|
|
10
|
+
super().__init__(self._message)
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def type(self) -> str:
|
|
14
|
+
return ErrorTypes.GENERATOR.value
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def message(self) -> str:
|
|
18
|
+
return self._message
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from instant_python.errors.application_error import ApplicationError
|
|
2
|
+
from instant_python.errors.error_types import ErrorTypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UnknownDependencyManagerError(ApplicationError):
|
|
6
|
+
def __init__(self, manager: str) -> None:
|
|
7
|
+
self._message = (
|
|
8
|
+
f"Unknown dependency manager: {manager}. Please use 'pdm' or 'uv'."
|
|
9
|
+
)
|
|
10
|
+
super().__init__(self._message)
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def type(self) -> str:
|
|
14
|
+
return ErrorTypes.INSTALLER.value
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def message(self) -> str:
|
|
18
|
+
return self._message
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from instant_python.errors.application_error import ApplicationError
|
|
2
|
+
from instant_python.errors.error_types import ErrorTypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UnknownNodeTypeError(ApplicationError):
|
|
6
|
+
def __init__(self, node_type: str) -> None:
|
|
7
|
+
self._message = f"Unknown node type: {node_type}"
|
|
8
|
+
super().__init__(self._message)
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def type(self) -> str:
|
|
12
|
+
return ErrorTypes.GENERATOR.value
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def message(self) -> str:
|
|
16
|
+
return self._message
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from instant_python.errors.application_error import ApplicationError
|
|
2
|
+
from instant_python.errors.error_types import ErrorTypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UnknownTemplateError(ApplicationError):
|
|
6
|
+
def __init__(self, template_name: str) -> None:
|
|
7
|
+
self._message = f"Unknown template type: {template_name}"
|
|
8
|
+
super().__init__(self._message)
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def type(self) -> str:
|
|
12
|
+
return ErrorTypes.GENERATOR.value
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def message(self) -> str:
|
|
16
|
+
return self._message
|
{instant_python-0.3.0 → instant_python-0.5.0}/instant_python/installer/dependency_manager_factory.py
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from instant_python.errors.unknown_dependency_manager_error import UnknownDependencyManagerError
|
|
1
2
|
from instant_python.installer.dependency_manager import DependencyManager
|
|
2
3
|
from instant_python.installer.managers import Managers
|
|
3
4
|
from instant_python.installer.pdm_manager import PdmManager
|
|
@@ -11,4 +12,7 @@ class DependencyManagerFactory:
|
|
|
11
12
|
Managers.UV: UvManager,
|
|
12
13
|
Managers.PDM: PdmManager,
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
try:
|
|
16
|
+
return managers[Managers(user_manager)](project_path)
|
|
17
|
+
except KeyError:
|
|
18
|
+
raise UnknownDependencyManagerError(user_manager)
|
|
@@ -21,6 +21,7 @@ class GitConfigurer:
|
|
|
21
21
|
check=True,
|
|
22
22
|
cwd=self._project_directory,
|
|
23
23
|
stdout=subprocess.DEVNULL,
|
|
24
|
+
stderr=subprocess.PIPE,
|
|
24
25
|
)
|
|
25
26
|
print(">>> Git repository initialized successfully")
|
|
26
27
|
|
|
@@ -32,6 +33,7 @@ class GitConfigurer:
|
|
|
32
33
|
check=True,
|
|
33
34
|
cwd=self._project_directory,
|
|
34
35
|
stdout=subprocess.DEVNULL,
|
|
36
|
+
stderr=subprocess.PIPE,
|
|
35
37
|
)
|
|
36
38
|
print(">>> Git user and email configured successfully")
|
|
37
39
|
|
|
@@ -43,5 +45,6 @@ class GitConfigurer:
|
|
|
43
45
|
check=True,
|
|
44
46
|
cwd=self._project_directory,
|
|
45
47
|
stdout=subprocess.DEVNULL,
|
|
48
|
+
stderr=subprocess.PIPE,
|
|
46
49
|
)
|
|
47
50
|
print(">>> Initial commit made successfully")
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
|
|
3
|
+
from instant_python.errors.command_execution_error import CommandExecutionError
|
|
4
|
+
from instant_python.installer.dependency_manager import DependencyManager
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Installer:
|
|
8
|
+
_dependency_manager: DependencyManager
|
|
9
|
+
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
dependency_manager: DependencyManager,
|
|
13
|
+
) -> None:
|
|
14
|
+
self._dependency_manager = dependency_manager
|
|
15
|
+
|
|
16
|
+
def perform_installation(
|
|
17
|
+
self, python_version: str, dependencies: list[str]
|
|
18
|
+
) -> None:
|
|
19
|
+
try:
|
|
20
|
+
self._dependency_manager.install()
|
|
21
|
+
self._dependency_manager.install_python(python_version)
|
|
22
|
+
self._dependency_manager.install_dependencies(dependencies)
|
|
23
|
+
except subprocess.CalledProcessError as error:
|
|
24
|
+
raise CommandExecutionError(exit_code=error.returncode, stderr_output=error.stderr)
|
|
@@ -16,6 +16,8 @@ class PdmManager(DependencyManager):
|
|
|
16
16
|
"curl -sSL https://pdm-project.org/install-pdm.py | python3 -",
|
|
17
17
|
shell=True,
|
|
18
18
|
check=True,
|
|
19
|
+
stdout=subprocess.DEVNULL,
|
|
20
|
+
stderr=subprocess.PIPE,
|
|
19
21
|
)
|
|
20
22
|
print(">>> pdm installed successfully")
|
|
21
23
|
|
|
@@ -27,6 +29,8 @@ class PdmManager(DependencyManager):
|
|
|
27
29
|
shell=True,
|
|
28
30
|
check=True,
|
|
29
31
|
cwd=self._project_directory,
|
|
32
|
+
stdout=subprocess.DEVNULL,
|
|
33
|
+
stderr=subprocess.PIPE,
|
|
30
34
|
)
|
|
31
35
|
print(f">>> Python {version} installed successfully")
|
|
32
36
|
|
|
@@ -55,6 +59,8 @@ class PdmManager(DependencyManager):
|
|
|
55
59
|
shell=True,
|
|
56
60
|
check=True,
|
|
57
61
|
cwd=self._project_directory,
|
|
62
|
+
stdout=subprocess.DEVNULL,
|
|
63
|
+
stderr=subprocess.PIPE,
|
|
58
64
|
)
|
|
59
65
|
|
|
60
66
|
@staticmethod
|
|
@@ -76,4 +82,5 @@ class PdmManager(DependencyManager):
|
|
|
76
82
|
check=True,
|
|
77
83
|
cwd=self._project_directory,
|
|
78
84
|
stdout=subprocess.DEVNULL,
|
|
85
|
+
stderr=subprocess.PIPE,
|
|
79
86
|
)
|
|
@@ -17,6 +17,7 @@ class UvManager(DependencyManager):
|
|
|
17
17
|
shell=True,
|
|
18
18
|
check=True,
|
|
19
19
|
stdout=subprocess.DEVNULL,
|
|
20
|
+
stderr=subprocess.PIPE,
|
|
20
21
|
)
|
|
21
22
|
print(">>> uv installed successfully")
|
|
22
23
|
|
|
@@ -29,6 +30,7 @@ class UvManager(DependencyManager):
|
|
|
29
30
|
check=True,
|
|
30
31
|
cwd=self._project_directory,
|
|
31
32
|
stdout=subprocess.DEVNULL,
|
|
33
|
+
stderr=subprocess.PIPE,
|
|
32
34
|
)
|
|
33
35
|
print(f">>> Python {version} installed successfully")
|
|
34
36
|
|
|
@@ -58,6 +60,7 @@ class UvManager(DependencyManager):
|
|
|
58
60
|
check=True,
|
|
59
61
|
cwd=self._project_directory,
|
|
60
62
|
stdout=subprocess.DEVNULL,
|
|
63
|
+
stderr=subprocess.PIPE,
|
|
61
64
|
)
|
|
62
65
|
print(f">>> {dependency_name} installed successfully")
|
|
63
66
|
|
|
@@ -81,4 +84,5 @@ class UvManager(DependencyManager):
|
|
|
81
84
|
check=True,
|
|
82
85
|
cwd=self._project_directory,
|
|
83
86
|
stdout=subprocess.DEVNULL,
|
|
87
|
+
stderr=subprocess.PIPE,
|
|
84
88
|
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from collections.abc import Callable
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
|
|
5
|
+
ExceptionType = type[Exception]
|
|
6
|
+
ErrorHandlingCallback = Callable[[Exception], None]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class InstantPythonTyper(typer.Typer):
|
|
10
|
+
error_handlers: dict[ExceptionType, ErrorHandlingCallback] = {}
|
|
11
|
+
|
|
12
|
+
def error_handler(self, exc: ExceptionType):
|
|
13
|
+
"""Registers a callback function to be called when 'exc' (the given exception) is raised."""
|
|
14
|
+
|
|
15
|
+
def decorator(func: ErrorHandlingCallback):
|
|
16
|
+
self.error_handlers[exc] = func
|
|
17
|
+
return func
|
|
18
|
+
|
|
19
|
+
return decorator
|
|
20
|
+
|
|
21
|
+
def __call__(self, *args, **kwargs):
|
|
22
|
+
"""Overrides Typer.__call__ so that when we run the CLI,
|
|
23
|
+
we can catch any exception that's raised and see if there's
|
|
24
|
+
a matching error handler for it.
|
|
25
|
+
"""
|
|
26
|
+
try:
|
|
27
|
+
super().__call__(*args, **kwargs)
|
|
28
|
+
except Exception as error:
|
|
29
|
+
callback = self.error_handlers.get(error.__class__.__base__)
|
|
30
|
+
callback(error)
|
|
@@ -2,6 +2,7 @@ from pathlib import Path
|
|
|
2
2
|
|
|
3
3
|
import yaml
|
|
4
4
|
|
|
5
|
+
from instant_python.errors.template_file_not_found_error import TemplateFileNotFoundError
|
|
5
6
|
from instant_python.project_generator.template_manager import TemplateManager
|
|
6
7
|
|
|
7
8
|
|
|
@@ -11,8 +12,6 @@ class CustomTemplateManager(TemplateManager):
|
|
|
11
12
|
|
|
12
13
|
def get_project(self, template_name: str) -> dict[str, str]:
|
|
13
14
|
if not self._template_path.is_file():
|
|
14
|
-
raise
|
|
15
|
-
f"Could not find YAML file at: {self._template_path}"
|
|
16
|
-
)
|
|
15
|
+
raise TemplateFileNotFoundError(self._template_path)
|
|
17
16
|
with open(self._template_path, "r", encoding="utf-8") as f:
|
|
18
17
|
return yaml.safe_load(f)
|
{instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/folder_tree.py
RENAMED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
from instant_python.
|
|
3
|
+
from instant_python.errors.unknown_node_typer_error import UnknownNodeTypeError
|
|
4
4
|
from instant_python.project_generator.boilerplate_file import BoilerplateFile
|
|
5
|
+
from instant_python.project_generator.directory import Directory
|
|
5
6
|
from instant_python.project_generator.file import File
|
|
6
7
|
from instant_python.project_generator.node import Node, NodeType
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class UnknownNodeType(ValueError):
|
|
10
|
-
def __init__(self, node_type: str) -> None:
|
|
11
|
-
self._message = f"Unknown node type: {node_type}"
|
|
12
|
-
super().__init__(self._message)
|
|
13
|
-
|
|
14
|
-
|
|
15
10
|
class FolderTree:
|
|
16
11
|
def __init__(self, project_directory: str) -> None:
|
|
17
12
|
self._project_directory = Path(project_directory)
|
|
@@ -41,4 +36,4 @@ class FolderTree:
|
|
|
41
36
|
extension = node.get("extension", "")
|
|
42
37
|
return File(name=name, extension=extension)
|
|
43
38
|
else:
|
|
44
|
-
raise
|
|
39
|
+
raise UnknownNodeTypeError(node_type)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from instant_python.errors.unknown_template_error import UnknownTemplateError
|
|
1
2
|
from instant_python.question_prompter.template_types import TemplateTypes
|
|
2
3
|
|
|
3
4
|
|
|
@@ -15,4 +16,4 @@ def compute_base_path(initial_path: str, template_type: str) -> str:
|
|
|
15
16
|
elif template_type == TemplateTypes.STANDARD:
|
|
16
17
|
return ".".join(path_components[2:])
|
|
17
18
|
else:
|
|
18
|
-
raise
|
|
19
|
+
raise UnknownTemplateError(template_type)
|
{instant_python-0.3.0 → instant_python-0.5.0}/instant_python/project_generator/project_generator.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
|
|
3
|
+
from instant_python.errors.command_execution_error import CommandExecutionError
|
|
3
4
|
from instant_python.project_generator.folder_tree import FolderTree
|
|
4
5
|
from instant_python.project_generator.jinja_template_manager import TemplateManager
|
|
5
6
|
|
|
@@ -18,13 +19,17 @@ class ProjectGenerator:
|
|
|
18
19
|
self._format_project_files()
|
|
19
20
|
|
|
20
21
|
def _format_project_files(self) -> None:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
try:
|
|
23
|
+
subprocess.run(
|
|
24
|
+
"uvx ruff format",
|
|
25
|
+
shell=True,
|
|
26
|
+
check=True,
|
|
27
|
+
cwd=self._folder_tree.project_directory,
|
|
28
|
+
stdout=subprocess.DEVNULL,
|
|
29
|
+
stderr=subprocess.PIPE,
|
|
30
|
+
)
|
|
31
|
+
except subprocess.CalledProcessError as error:
|
|
32
|
+
raise CommandExecutionError(exit_code=error.returncode, stderr_output=error.stderr)
|
|
28
33
|
|
|
29
34
|
@property
|
|
30
35
|
def path(self) -> str:
|
|
File without changes
|
|
@@ -11,6 +11,7 @@ root:
|
|
|
11
11
|
{{ macros.include_and_indent("project_structure/pyproject.yml.j2", 2) }}
|
|
12
12
|
{% if git %}
|
|
13
13
|
{{ macros.include_and_indent("project_structure/gitignore.yml.j2", 2) }}
|
|
14
|
+
{{ macros.include_and_indent("project_structure/readme.yml.j2", 2) }}
|
|
14
15
|
{% endif %}
|
|
15
16
|
{{ macros.include_and_indent("project_structure/python_version.yml.j2", 2) }}
|
|
16
17
|
{% if "pytest" in dependencies %}
|
|
@@ -11,6 +11,7 @@ root:
|
|
|
11
11
|
{{ macros.include_and_indent("project_structure/pyproject.yml.j2", 2) }}
|
|
12
12
|
{% if git %}
|
|
13
13
|
{{ macros.include_and_indent("project_structure/gitignore.yml.j2", 2) }}
|
|
14
|
+
{{ macros.include_and_indent("project_structure/readme.yml.j2", 2) }}
|
|
14
15
|
{% endif %}
|
|
15
16
|
{{ macros.include_and_indent("project_structure/python_version.yml.j2", 2) }}
|
|
16
17
|
{% if "pytest" in dependencies %}
|
|
@@ -11,6 +11,7 @@ root:
|
|
|
11
11
|
{{ macros.include_and_indent("project_structure/pyproject.yml.j2", 2) }}
|
|
12
12
|
{% if git %}
|
|
13
13
|
{{ macros.include_and_indent("project_structure/gitignore.yml.j2", 2) }}
|
|
14
|
+
{{ macros.include_and_indent("project_structure/readme.yml.j2", 2) }}
|
|
14
15
|
{% endif %}
|
|
15
16
|
{{ macros.include_and_indent("project_structure/python_version.yml.j2", 2) }}
|
|
16
17
|
{% if "pytest" in dependencies %}
|