Skip to content

Commit

Permalink
Merge branch 'release/4.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Mar 27, 2023
2 parents 3145317 + f7ead66 commit 6f23554
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Generator features:
- Optional Sentry integration;
- Optional Loguru logger;
- Optional Opentelemetry integration.
- Optional taskiq integration.


This project can handle arguments passed through command line.
Expand All @@ -88,6 +89,7 @@ Options:
--ci [none|gitlab_ci|github] Select a CI for your app
--redis Add redis support
--rabbit Add RabbitMQ support
--taskiq Add Taskiq support
--migrations Add Migrations
--kube Add kubernetes configs
--dummy Add dummy model
Expand Down
1 change: 0 additions & 1 deletion fastapi_template/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
from pathlib import Path

from cookiecutter.exceptions import FailedHookException, OutputDirExistsException
Expand Down
15 changes: 15 additions & 0 deletions fastapi_template/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import shutil
from fastapi_template.input_model import (
BuilderContext,
MenuEntry,
Expand Down Expand Up @@ -585,4 +586,18 @@ def run_command(callback: Callable[[BuilderContext], None]) -> None:
)
for menu in menus:
cmd.params.extend(menu.get_cli_options())
required_commands = {
"poetry": "https://python-poetry.org/docs/#installation",
"git": "https://git-scm.com/",
}
for prog, link in required_commands.items():
if shutil.which(prog) is None:
print(
"Please install {prog} before generating project. Link: {link}".format(
prog=colored(prog, "green"),
link=colored(link, "cyan"),
),
)
return

cmd.main()
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ src_folder = "./{{cookiecutter.project_name}}"
{%- endif %}
{%- endif %}

[fastapi-template.options]
{%- for key, value in cookiecutter.items() %}
{%- if not key.startswith("_") and not key == "db_info" %}
{{key}} = "{{value}}"
{%- endif %}
{%- endfor %}

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fastapi_template"
version = "4.1.0"
version = "4.1.1"
description = "Feature-rich robust FastAPI template"
authors = ["Pavel Kirilin <win10@list.ru>"]
packages = [{ include = "fastapi_template" }]
Expand Down

0 comments on commit 6f23554

Please sign in to comment.