Skip to content

Commit 9d9d991

Browse files
committed
Fixed infinite tests.
1 parent a52ddd3 commit 9d9d991

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

fastapi_template/cli.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ def checker(ctx: BuilderContext) -> bool:
8080
"Choose this option if you want to create a service with {name}.\n"
8181
"It's more suitable for {generic} web-services or services without databases.".format(
8282
name=colored("REST API", color="green"),
83-
generic=colored("generic", color="cyan",
84-
attrs=["underline"]),
83+
generic=colored("generic", color="cyan", attrs=["underline"]),
8584
)
8685
),
8786
),
@@ -152,8 +151,7 @@ def checker(ctx: BuilderContext) -> bool:
152151
"{name} is the most popular database made by oracle.\n"
153152
"It's a good fit for {prod} application.".format(
154153
name=colored("MySQL", color="green"),
155-
prod=colored("production-grade", color="cyan",
156-
attrs=["underline"]),
154+
prod=colored("production-grade", color="cyan", attrs=["underline"]),
157155
)
158156
),
159157
additional_info=Database(
@@ -172,8 +170,7 @@ def checker(ctx: BuilderContext) -> bool:
172170
"{name} is second most popular open-source relational database.\n"
173171
"It's a good fit for {prod} application.".format(
174172
name=colored("PostgreSQL", color="green"),
175-
prod=colored("production-grade", color="cyan",
176-
attrs=["underline"]),
173+
prod=colored("production-grade", color="cyan", attrs=["underline"]),
177174
)
178175
),
179176
additional_info=Database(
@@ -199,9 +196,9 @@ def checker(ctx: BuilderContext) -> bool:
199196
async_driver="beanie",
200197
driver_short="mongodb",
201198
driver="mongodb",
202-
port=27017
199+
port=27017,
203200
),
204-
)
201+
),
205202
],
206203
)
207204

@@ -265,8 +262,7 @@ def checker(ctx: BuilderContext) -> bool:
265262
"If you select this option, you will get only {what}.\n"
266263
"The rest {warn}.".format(
267264
what=colored("raw database", color="green"),
268-
warn=colored("is up to you", color="red",
269-
attrs=["underline"]),
265+
warn=colored("is up to you", color="red", attrs=["underline"]),
270266
)
271267
),
272268
),
@@ -342,7 +338,6 @@ def checker(ctx: BuilderContext) -> bool:
342338
)
343339
),
344340
),
345-
346341
],
347342
)
348343

@@ -365,8 +360,7 @@ def checker(ctx: BuilderContext) -> bool:
365360
color="green",
366361
),
367362
purpose1=colored("caching", color="cyan"),
368-
purpose2=colored(
369-
"storing temporary variables", color="cyan"),
363+
purpose2=colored("storing temporary variables", color="cyan"),
370364
)
371365
),
372366
),
@@ -419,7 +413,7 @@ def checker(ctx: BuilderContext) -> bool:
419413
code="enable_migrations",
420414
cli_name="migrations",
421415
user_view="Add Migrations",
422-
is_hidden=lambda ctx: ctx.db == "none",
416+
is_hidden=lambda ctx: ctx.db == "none" or ctx.orm == "psycopg",
423417
description=(
424418
"Add database {what} config.\n"
425419
"This options adds ability to {why} database schema.".format(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ services:
153153
- "{{cookiecutter.project_name}}-db-data:/var/lib/mysql"
154154
{%- endif %}
155155

156-
{%- if cookiecutter.enable_migrations == 'True' %}
156+
{%- if cookiecutter.enable_migrations == 'True' and cookiecutter.orm != 'psycopg' %}
157157

158158
migrator:
159159
<<: *main_app

0 commit comments

Comments
 (0)