Skip to content

Commit a00e0d1

Browse files
committed
Merge branch 'release/4.1.2'
2 parents 6f23554 + 30b5c52 commit a00e0d1

File tree

9 files changed

+43
-33
lines changed

9 files changed

+43
-33
lines changed

fastapi_template/template/{{cookiecutter.project_name}}/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ cover/
6262
# Django stuff:
6363
*.log
6464
local_settings.py
65-
db.sqlite3
66-
db.sqlite3-journal
65+
*.sqlite3
66+
*.sqlite3-journal
6767

6868
# Flask stuff:
6969
instance/

fastapi_template/template/{{cookiecutter.project_name}}/.gitlab-ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,8 @@ pytest:
104104
artifacts:
105105
when: always
106106
reports:
107-
cobertura: coverage.xml
108107
junit: report.xml
108+
coverage_report:
109+
coverage_format: cobertura
110+
path: coverage.xml
111+

fastapi_template/template/{{cookiecutter.project_name}}/conditional_files.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"Taskiq support":{
214214
"enabled": "{{cookiecutter.enable_taskiq}}",
215215
"resources": [
216-
"{{cookiecutter.project_name}}/taskiq.py"
216+
"{{cookiecutter.project_name}}/tkq.py"
217217
]
218218
}
219219
}

fastapi_template/template/{{cookiecutter.project_name}}/deploy/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ services:
8080
command:
8181
- taskiq
8282
- worker
83-
- {{cookiecutter.project_name}}.taskiq:broker
83+
- {{cookiecutter.project_name}}.tkq:broker
8484
{%- endif %}
8585

8686
{%- if cookiecutter.db_info.name == "postgresql" %}

fastapi_template/template/{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ loguru = "^0.6.0"
119119
{%- if cookiecutter.enable_kafka == "True" %}
120120
aiokafka = "^0.8.0"
121121
{%- endif %}
122+
{%- if cookiecutter.enable_taskiq == "True" %}
123+
taskiq = "^0"
124+
taskiq-fastapi = "^0"
125+
126+
{%- if cookiecutter.enable_redis == "True" %}
127+
taskiq-redis = "^0"
128+
{%- endif %}
129+
130+
{%- if cookiecutter.enable_rmq == "True" %}
131+
taskiq-aio-pika = "^0"
132+
{%- endif %}
133+
134+
{%- if (cookiecutter.enable_rmq or cookiecutter.enable_rmq) != "True" %}
135+
pyzmq = "^25.0.2"
136+
{%- endif %}
137+
138+
{%- endif %}
139+
122140

123141
[tool.poetry.dev-dependencies]
124142
pytest = "^7.2.1"
@@ -140,23 +158,7 @@ asynctest = "^0.13.0"
140158
nest-asyncio = "^1.5.6"
141159
{%- endif %}
142160
httpx = "^0.23.3"
143-
{%- if cookiecutter.enable_taskiq == "True" %}
144-
taskiq = "^0"
145-
taskiq-fastapi = "^0"
146-
147-
{%- if cookiecutter.enable_redis == "True" %}
148-
taskiq-redis = "^0"
149-
{%- endif %}
150-
151-
{%- if cookiecutter.enable_rmq == "True" %}
152-
taskiq-aio-pika = "^0"
153-
{%- endif %}
154-
155-
{%- if (cookiecutter.enable_rmq or cookiecutter.enable_rmq) != "True" %}
156-
pyzmq = "^25.0.2"
157-
{%- endif %}
158-
159-
{%- endif %}
161+
taskiq = { version = "^0", extras = ["reload"] }
160162

161163
[tool.isort]
162164
profile = "black"

fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/taskiq.py renamed to fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/tkq.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
from taskiq_aio_pika import AioPikaBroker
1212
{%- endif %}
1313

14-
{%- if cookiecutter.enable_loguru %}
15-
from {{cookiecutter.project_name}}.logging import configure_logging
16-
{%- endif %}
17-
18-
1914
{%- if cookiecutter.enable_redis == "True" %}
2015
result_backend = RedisAsyncResultBackend(
2116
redis_url=str(settings.redis_url.with_path("/1")),
@@ -24,14 +19,23 @@
2419

2520

2621
{%- if cookiecutter.enable_rmq == "True" %}
27-
broker = AioPikaBroker(str(settings.rabbit_url), {%- if cookiecutter.enable_redis == "True" %}result_backend=result_backend, {%- endif %})
22+
broker = AioPikaBroker(
23+
str(settings.rabbit_url),
24+
{%- if cookiecutter.enable_redis == "True" %}result_backend=result_backend, {%- endif %}
25+
)
2826
{%- elif cookiecutter.enable_redis == "True" %}
29-
broker = ListQueueBroker(str(settings.redis_url.with_path("/1")), result_backend=result_backend,)
27+
broker = ListQueueBroker(
28+
str(settings.redis_url.with_path("/1")),
29+
result_backend=result_backend,
30+
)
3031
{%- else %}
3132
broker = ZeroMQBroker()
3233
{%- endif %}
3334

3435
if settings.environment.lower() == "pytest":
3536
broker = InMemoryBroker()
3637

37-
taskiq_fastapi.init(broker, "tkiqtest.web.application:get_app")
38+
taskiq_fastapi.init(
39+
broker,
40+
"{{cookiecutter.project_name}}.web.application:get_app",
41+
)

fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/web/lifetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{%- endif %}
2222

2323
{%- if cookiecutter.enable_taskiq == "True" %}
24-
from {{cookiecutter.project_name}}.taskiq import broker
24+
from {{cookiecutter.project_name}}.tkq import broker
2525
{%- endif %}
2626

2727

fastapi_template/tests/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import shlex
23
import subprocess
34
from typing import Optional
45
from fastapi_template.input_model import BuilderContext
@@ -26,7 +27,7 @@ def run_docker_compose_command(
2627
".",
2728
]
2829
if command:
29-
docker_command.extend(command.split())
30+
docker_command.extend(shlex.split(command))
3031
else:
3132
docker_command.extend(
3233
[

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fastapi_template"
3-
version = "4.1.1"
3+
version = "4.1.2"
44
description = "Feature-rich robust FastAPI template"
55
authors = ["Pavel Kirilin <[email protected]>"]
66
packages = [{ include = "fastapi_template" }]

0 commit comments

Comments
 (0)