File tree 9 files changed +99
-7
lines changed
src/{{ project_name_snake_case }}
{{ cookiecutter.__project_name_kebab_case }}
src/{{ cookiecutter.__project_name_snake_case }}
9 files changed +99
-7
lines changed Original file line number Diff line number Diff line change 63
63
.terraform /
64
64
65
65
# VS Code
66
- .vscode /
66
+ .vscode /*
67
67
68
68
# Default template
69
69
my-project /
Original file line number Diff line number Diff line change 62
62
# Terraform
63
63
.terraform /
64
64
65
- # VS Code
66
- .vscode /
65
+ # VS Code (but still include launch configurations)
66
+ .vscode /*
67
+ ! /.vscode /launch.json *
Original file line number Diff line number Diff line change
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {% - if with_fastapi_api %}
5
+ {
6
+ "name": "API [debug]",
7
+ "type": "debugpy",
8
+ "request": "launch",
9
+ "module": "uvicorn",
10
+ "args": [
11
+ "{{ project_name_snake_case }}.api:app",
12
+ "--reload"
13
+ ],
14
+ "jinja": true,
15
+ "justMyCode": true,
16
+ "console": "integratedTerminal"
17
+ },
18
+ {% - endif %}
19
+ {% - if with_typer_cli %}
20
+ {
21
+ "name": "CLI [debug]",
22
+ "type": "debugpy",
23
+ "request": "launch",
24
+ "program": "${workspaceFolder}//src//{{ project_name_snake_case }}//cli.py",
25
+ "args": [
26
+ "--name",
27
+ "Someone"
28
+ ],
29
+ "justMyCode": true,
30
+ "console": "integratedTerminal"
31
+ },
32
+ {% - endif %}
33
+ {
34
+ "name": "Python file [debug]",
35
+ "type": "debugpy",
36
+ "request": "launch",
37
+ "program": "${file}",
38
+ "console": "integratedTerminal"
39
+ }
40
+ ]
41
+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ from fastapi import FastAPI
9
9
10
10
11
11
@asynccontextmanager
12
- async def lifespan(app: FastAPI) -> AsyncGenerator[None, None ]:
12
+ async def lifespan(app: FastAPI) -> AsyncGenerator[None]:
13
13
"""Handle FastAPI startup and shutdown events."""
14
14
# Startup events.
15
15
for handler in logging.root.handlers:
Original file line number Diff line number Diff line change @@ -10,3 +10,7 @@ app = typer.Typer()
10
10
def fire(name: str = "Chell") -> None:
11
11
"""Fire portal gun."""
12
12
rprint(f"[bold red]Alert![/bold red] {name} fired [green]portal gun[/green] :boom:")
13
+
14
+
15
+ if __name__ == "__main__":
16
+ app()
Original file line number Diff line number Diff line change @@ -64,5 +64,6 @@ __pycache__/
64
64
# Terraform
65
65
.terraform /
66
66
67
- # VS Code
68
- .vscode /
67
+ # VS Code (but still include launch configurations)
68
+ .vscode /*
69
+ ! /.vscode /launch.json *
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 0.2.0" ,
3
+ "configurations" : [
4
+ {%- if with_fastapi_api % }
5
+ {
6
+ "name" : " API [debug]" ,
7
+ "type" : " debugpy" ,
8
+ "request" : " launch" ,
9
+ "module" : " uvicorn" ,
10
+ "args" : [
11
+ " {{ project_name_snake_case }}.api:app" ,
12
+ " --reload"
13
+ ],
14
+ "jinja" : true ,
15
+ "justMyCode" : true ,
16
+ "console" : " integratedTerminal"
17
+ },
18
+ {%- endif % }
19
+ {%- if with_typer_cli % }
20
+ {
21
+ "name" : " CLI [debug]" ,
22
+ "type" : " debugpy" ,
23
+ "request" : " launch" ,
24
+ "program" : " ${workspaceFolder}//src//{{ project_name_snake_case }}//cli.py" ,
25
+ "args" : [
26
+ " --name" ,
27
+ " Someone"
28
+ ],
29
+ "justMyCode" : true ,
30
+ "console" : " integratedTerminal"
31
+ },
32
+ {%- endif % }
33
+ {
34
+ "name" : " Python file [debug]" ,
35
+ "type" : " debugpy" ,
36
+ "request" : " launch" ,
37
+ "program" : " ${file}" ,
38
+ "console" : " integratedTerminal"
39
+ }
40
+ ]
41
+ }
Original file line number Diff line number Diff line change 9
9
10
10
11
11
@asynccontextmanager
12
- async def lifespan (app : FastAPI ) -> AsyncGenerator [None , None ]:
12
+ async def lifespan (app : FastAPI ) -> AsyncGenerator [None ]:
13
13
"""Handle FastAPI startup and shutdown events."""
14
14
# Startup events.
15
15
for handler in logging .root .handlers :
Original file line number Diff line number Diff line change 10
10
def fire (name : str = "Chell" ) -> None :
11
11
"""Fire portal gun."""
12
12
print (f"[bold red]Alert![/bold red] { name } fired [green]portal gun[/green] :boom:" )
13
+
14
+
15
+ if __name__ == "__main__" :
16
+ app ()
You can’t perform that action at this time.
0 commit comments