Skip to content

Commit 53ba96d

Browse files
committed
Merge branch 'release/4.0.4'
2 parents 5fad73e + 259e2b6 commit 53ba96d

File tree

19 files changed

+41
-46
lines changed

19 files changed

+41
-46
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ python3 -m pip install .
3535
python3 -m fastapi_template
3636
```
3737

38-
Also you can use it with docker.
38+
Also, you can use it with docker.
3939
```bash
4040
docker run --rm -it -v "$(pwd):/projects" s3rius/fastapi_template
4141
```

fastapi_template/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
SKIP_ENTRY,
99
)
1010
from importlib.metadata import version
11-
from typing import Callable, Optional
11+
from typing import Callable, List, Optional
1212
from click import Command, Option
1313
import re
1414

@@ -40,20 +40,20 @@ def disable_orm(ctx: BuilderContext) -> MenuEntry:
4040
return None
4141

4242

43-
def do_not_ask_features_if_quite(ctx: BuilderContext) -> Optional[list[MenuEntry]]:
43+
def do_not_ask_features_if_quite(ctx: BuilderContext) -> Optional[List[MenuEntry]]:
4444
if ctx.quite:
4545
return [SKIP_ENTRY]
4646
return None
4747

4848

49-
def check_db(allowed_values: list[str]) -> Callable[[BuilderContext], bool]:
49+
def check_db(allowed_values: List[str]) -> Callable[[BuilderContext], bool]:
5050
def checker(ctx: BuilderContext) -> bool:
5151
return ctx.db not in allowed_values
5252

5353
return checker
5454

5555

56-
def check_orm(allowed_values: list[str]) -> Callable[[BuilderContext], bool]:
56+
def check_orm(allowed_values: List[str]) -> Callable[[BuilderContext], bool]:
5757
def checker(ctx: BuilderContext) -> bool:
5858
return ctx.orm not in allowed_values
5959

@@ -499,7 +499,7 @@ def checker(ctx: BuilderContext) -> bool:
499499

500500

501501
def handle_cli(
502-
menus: list[BaseMenuModel],
502+
menus: List[BaseMenuModel],
503503
callback: Callable[[BuilderContext], None],
504504
):
505505
def inner_callback(**cli_args: Any):
@@ -532,7 +532,7 @@ def inner_callback(**cli_args: Any):
532532

533533

534534
def run_command(callback: Callable[[BuilderContext], None]) -> None:
535-
menus: "list[BaseMenuModel]" = [
535+
menus: "List[BaseMenuModel]" = [
536536
api_menu,
537537
db_menu,
538538
orm_menu,

fastapi_template/input_model.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import enum
2-
from typing import Optional, Callable, Any
2+
from typing import List, Optional, Callable, Any
33

44
from pydantic import BaseModel
55
import click
@@ -54,7 +54,7 @@ def generated_name(self) -> str:
5454

5555
class BaseMenuModel(BaseModel, abc.ABC):
5656
title: str
57-
entries: list[MenuEntry]
57+
entries: List[MenuEntry]
5858
description: str = ""
5959

6060
def _preview(self, current_value: str):
@@ -65,7 +65,7 @@ def _preview(self, current_value: str):
6565
return "Unknown value"
6666

6767
@abc.abstractmethod
68-
def get_cli_options(self) -> list[click.Option]:
68+
def get_cli_options(self) -> List[click.Option]:
6969
pass
7070

7171
@abc.abstractmethod
@@ -91,7 +91,7 @@ class SingularMenuModel(BaseMenuModel):
9191
]
9292
parser: Optional[Callable[[str], Any]]
9393

94-
def get_cli_options(self) -> list[click.Option]:
94+
def get_cli_options(self) -> List[click.Option]:
9595
cli_name = self.code
9696
if self.cli_name is not None:
9797
cli_name = self.cli_name
@@ -168,9 +168,9 @@ def after_ask(self, context: "BuilderContext") -> "BuilderContext":
168168

169169

170170
class MultiselectMenuModel(BaseMenuModel):
171-
before_ask: Optional[Callable[["BuilderContext"], Optional[list[MenuEntry]]]]
171+
before_ask: Optional[Callable[["BuilderContext"], Optional[List[MenuEntry]]]]
172172

173-
def get_cli_options(self) -> list[click.Option]:
173+
def get_cli_options(self) -> List[click.Option]:
174174
options = []
175175
for entry in self.entries:
176176
options.append(

fastapi_template/template/{{cookiecutter.project_name}}/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ This application can be configured with environment variables.
7373
You can create `.env` file in the root directory and place all
7474
environment variables here.
7575
76-
All environment variabels should start with "{{cookiecutter.project_name | upper}}_" prefix.
76+
All environment variables should start with "{{cookiecutter.project_name | upper}}_" prefix.
7777
7878
For example if you see in your "{{cookiecutter.project_name}}/settings.py" a variable named like
7979
`random_parameter`, you should provide the "{{cookiecutter.project_name | upper}}_RANDOM_PARAMETER"
8080
variable to configure the value. This behaviour can be changed by overriding `env_prefix` property
8181
in `{{cookiecutter.project_name}}.settings.Settings.Config`.
8282
83-
An exmaple of .env file:
83+
An example of .env file:
8484
```bash
8585
{{cookiecutter.project_name | upper}}_RELOAD="True"
8686
{{cookiecutter.project_name | upper}}_PORT="8000"
@@ -156,7 +156,7 @@ docker save --output {{cookiecutter.project_name}}.tar {{cookiecutter.project_na
156156
If you want to migrate your database, you should run following commands:
157157
```bash
158158
{%- if cookiecutter.orm in ['sqlalchemy', 'ormar'] %}
159-
# To run all migrations untill the migration with revision_id.
159+
# To run all migrations until the migration with revision_id.
160160
alembic upgrade "<revision_id>"
161161
162162
# To perform all pending migrations.
@@ -168,7 +168,7 @@ aerich upgrade
168168
{%- elif cookiecutter.orm == 'piccolo' %}
169169
# You have to set a PICCOLO_CONF variable
170170
export PICCOLO_CONF="{{cookiecutter.project_name}}.piccolo_conf"
171-
# Now you can easily run migrations usuing
171+
# Now you can easily run migrations using
172172
piccolo migrations forwards all
173173
{%- endif %}
174174
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"Self-hosted swagger": {
148148
"enabled": "{{cookiecutter.self_hosted_swagger}}",
149149
"resources": [
150-
"{{cookiecutter.project_name}}/web/static",
150+
"{{cookiecutter.project_name}}/static/docs",
151151
"{{cookiecutter.project_name}}/web/api/docs"
152152
]
153153
},
@@ -210,4 +210,4 @@
210210
"{{cookiecutter.project_name}}/db_tortoise/migrations/models/1_20210928165300_init_dummy_sqlite.sql"
211211
]
212212
}
213-
}
213+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ aiokafka = "^0.8.0"
123123
[tool.poetry.dev-dependencies]
124124
pytest = "^7.2.1"
125125
flake8 = "~4.0.1"
126-
mypy = "^0.991"
126+
mypy = "^1.1.1"
127127
isort = "^5.11.4"
128128
pre-commit = "^3.0.1"
129129
wemake-python-styleguide = "^0.17.0"

fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ async def test_exchange_name() -> str:
354354
@pytest.fixture
355355
async def test_routing_key() -> str:
356356
"""
357-
Name of routing key to use whild binding test queue.
357+
Name of routing key to use while binding test queue.
358358
359359
:return: key string.
360360
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Alembic migraions."""
1+
"""Alembic migrations."""

fastapi_template/template/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/db_ormar/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{% if cookiecutter.db_info.name == "postgresql" -%}
88
def create_database() -> None:
9-
"""Create a databse."""
9+
"""Create a database."""
1010
db_url = make_url(str(settings.db_url.with_path('/postgres')))
1111
engine = create_engine(db_url, isolation_level="AUTOCOMMIT")
1212

@@ -46,7 +46,7 @@ def drop_database() -> None:
4646
{%- endif %}
4747
{%- if cookiecutter.db_info.name == "mysql" %}
4848
def create_database() -> None:
49-
"""Create a databse."""
49+
"""Create a database."""
5050
engine = create_engine(str(settings.db_url.with_path("/mysql")))
5151

5252
with engine.connect() as conn:
@@ -76,7 +76,7 @@ def drop_database() -> None:
7676
{%- endif %}
7777
{%- if cookiecutter.db_info.name == "sqlite" %}
7878
def create_database() -> None:
79-
"""Create a databse."""
79+
"""Create a database."""
8080

8181
def drop_database() -> None:
8282
"""Drop current database."""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Alembic migraions."""
1+
"""Alembic migrations."""

0 commit comments

Comments
 (0)