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 configs and setup for fastapi-slim including optional extras fastapi-slim[standard], and fastapi including by default the same standard extras #11503

Merged
merged 7 commits into from
Apr 30, 2024

Conversation

tiangolo
Copy link
Owner

@tiangolo tiangolo commented Apr 30, 2024

🔧 Add configs and setup for fastapi-slim including optional extras fastapi-slim[standard], and fastapi including by default the same standard extras

The fastapi package now includes the standard default recommended packages, and fastapi-slim comes without those recommended standard packages and with a group of optional dependencies fastapi-slim[standard], equivalent to fastapi, for those that want to opt out of those default standard packages.

@tiangolo
Copy link
Owner Author

📝 Docs preview for commit 79621a3 at: https://28bb498b.fastapitiangolo.pages.dev

@tiangolo tiangolo enabled auto-merge (squash) April 30, 2024 06:34
@tiangolo tiangolo merged commit ea1f219 into master Apr 30, 2024
43 checks passed
@tiangolo tiangolo deleted the slim branch April 30, 2024 06:38
hsuanchi pushed a commit to hsuanchi/fastapi that referenced this pull request May 26, 2024
…`fastapi-slim[standard]`, and `fastapi` including by default the same `standard` extras (tiangolo#11503)
@noklam
Copy link

noklam commented Jun 18, 2024

Hi! https://discuss.python.org/t/optional-dependency-groups-omitting-package-requirements/20833 brought me to here as I am researching how to split out some optional dependencies in a nice way.

I see that you have taken a custom approach, here is what I understand:

  • fastapi-slim share the same codebase as fastapi
  • pip install fastapi installs the extra optional dependencies while pip install fastapi-slim doesn't
  • pip install fastapi[standard] is equivalent to pip install fastapi[standard] in terms of dependencies

I have a few questions:

  • What lead you to decide to implement a custom solution?
  • How does this actually work? I see that you are using pdm, but I am surprised when I clone the repository and do pip install -e . it also install the [standard] dependencies automatically, how does this work? I expect this is some "magic" that you add during build time only.

@edouardlp
Copy link
Contributor

This PR causes issues for library maintainers. See #11733

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.

None yet

3 participants