(
name: str,
interactive: bool = typer.Option(False, help="Run in interactive mode."),
database: Optional[Database] = typer.Option(None, case_sensitive=False),
docker: bool = typer.Option(False),
license_: Optional[License] = typer.Option(None, "--license", case_sensitive=False),
packaging: PackageManager = typer.Option(PackageManager.PIP),
pre_commit: bool = typer.Option(False, "--pre-commit"),
python: PythonVersion = typer.Option(PythonVersion.THREE_DOT_EIG),
)
| 20 | |
| 21 | @app.command(help="Creates a FastAPI project.") |
| 22 | def startproject( |
| 23 | name: str, |
| 24 | interactive: bool = typer.Option(False, help="Run in interactive mode."), |
| 25 | database: Optional[Database] = typer.Option(None, case_sensitive=False), |
| 26 | docker: bool = typer.Option(False), |
| 27 | license_: Optional[License] = typer.Option(None, "--license", case_sensitive=False), |
| 28 | packaging: PackageManager = typer.Option(PackageManager.PIP), |
| 29 | pre_commit: bool = typer.Option(False, "--pre-commit"), |
| 30 | python: PythonVersion = typer.Option(PythonVersion.THREE_DOT_EIG), |
| 31 | ): |
| 32 | if interactive: |
| 33 | result = form( |
| 34 | packaging=question(PackageManager), |
| 35 | python=question(PythonVersion), |
| 36 | license=question(License), |
| 37 | pre_commit=binary_question("pre commit"), |
| 38 | docker=binary_question("docker"), |
| 39 | database=question(Database), |
| 40 | ).ask() |
| 41 | context = ProjectContext(name=name, **result) |
| 42 | else: |
| 43 | context = ProjectContext( |
| 44 | name=name, |
| 45 | packaging=packaging, |
| 46 | python=python, |
| 47 | license=license_, |
| 48 | pre_commit=pre_commit, |
| 49 | docker=docker, |
| 50 | database=database, |
| 51 | ) |
| 52 | generate_project(context) |
| 53 | |
| 54 | |
| 55 | @app.command(help="Creates a FastAPI component.") |
nothing calls this directly
no test coverage detected