mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-16 18:08:02 -05:00
* ♻️ Add support for `pip install "fastapi[standard]"` and make `fastapi` not include the optional standard dependencies * 📝 Update docs to include new fastapi[standard] * ✨ Add new stub fastapi command that tells people to install fastapi[standard] * ✅ Add tests for new stub CLI * 🔧 Add new command fastapi in main fastapi project, for when fastapi-cli is not installed * ✏️ Fix types * 📝 Add note about quotes when installing fastapi[standard] * 📝 Update docs about standard extra dependencies * ⬆️ Upgrade fastapi-cli
14 lines
418 B
Python
14 lines
418 B
Python
try:
|
|
from fastapi_cli.cli import main as cli_main
|
|
|
|
except ImportError: # pragma: no cover
|
|
cli_main = None # type: ignore
|
|
|
|
|
|
def main() -> None:
|
|
if not cli_main: # type: ignore[truthy-function]
|
|
message = 'To use the fastapi command, please install "fastapi[standard]":\n\n\tpip install "fastapi[standard]"\n'
|
|
print(message)
|
|
raise RuntimeError(message) # noqa: B904
|
|
cli_main()
|