Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Add support for pip install "fastapi[standard]" with standard dependencies and python -m fastapi #11935

Merged
merged 9 commits into from
Aug 2, 2024

Conversation

tiangolo
Copy link
Member

@tiangolo tiangolo commented Aug 2, 2024

♻️ Add support for pip install "fastapi[standard]" including the standard dependencies, the CLI, Uvicorn, etc. and make fastapi not include the optional standard dependencies. fastapi and fastapi-slim are now the same.

This also adds support for calling it with:

python -m fastapi

And if someone doesn't install fastapi[standard] and tries to call the fastapi command, it will show them an error telling them to install fastapi[standard].

Summary

Install with:

pip install "fastapi[standard]"

This also upgrades fastapi-cli[standard] >=0.0.5.

Technical Details

Before this, fastapi would include the standard dependencies, with Uvicorn and the fastapi-cli, etc.

And fastapi-slim would not include those standard dependencies.

Now fastapi doesn't include those standard dependencies unless you install with pip install "fastapi[standard]".

Before, you would install pip install fastapi, now you should include the standard optional dependencies (unless you want to exclude one of those): pip install "fastapi[standard]".

This change is because having the standard optional dependencies installed by default was being inconvenient to several users, and having to install instead fastapi-slim was not being a feasible solution.

Discussed here: #11522 and here: #11525

@tiangolo tiangolo changed the title ♻️ Add support for pip install "fastapi[standard]" including the standard dependencies, the CLI, Uvicorn, etc. and make fastapi not include the optional standard dependencies. fastapi and fastapi-slim are now the same. ♻️ Add support for pip install "fastapi[standard]" with standard dependencies Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

📝 Docs preview for commit 15f0b97 at: https://61384e88.fastapitiangolo.pages.dev

Copy link
Contributor

github-actions bot commented Aug 2, 2024

📝 Docs preview for commit c4282be at: https://ad2ec833.fastapitiangolo.pages.dev

@tiangolo tiangolo changed the title ♻️ Add support for pip install "fastapi[standard]" with standard dependencies ♻️ Add support for pip install "fastapi[standard]" with standard dependencies and python -m fastapi Aug 2, 2024
@tiangolo tiangolo added breaking and removed refactor labels Aug 2, 2024
@tiangolo tiangolo merged commit a25c92c into master Aug 2, 2024
46 checks passed
@tiangolo tiangolo deleted the fastapi-standard branch August 2, 2024 06:03
@hamadrehman
Copy link

image
is this a typo ?
python -m fastapi instead of python -m python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants