-
Notifications
You must be signed in to change notification settings - Fork 6
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
FastAPI dependency makes difficult to use new fastapi-slim #29
Comments
Sorry, submitted inadvertently with no contents 🤦 Just amended the title and description. |
Hi, thanks for bringing this up. I have to say that the way they chose to implement this is a bit annoying. Doesn't it break every single library that depends on I'd be fine with what you proposed - making it an optional dependency.
If you could make a PR, that would be great. |
Thanks for looking into this so quickly!
Yeah agree, it probably does not break any project, but it could inadvertently add a bunch of new irrelevant dependencies...
We can at least set the minimum versions even if they are optional so that they are explicit. I think it would also enforce them in the projects where they are used, at least when I used Poetry it'd complain if the optional ranges would not allow to resolve the right sub-dependencies, so maybe it prevents using it when the versions from the project don't align?
I guess that's reasonable too.
I think it'd make sense to create 2 groups, we cannot make one a default, but hopefully by reading the names it is quite straightforward, something like
Just opened #30, happy to hear your thoughts 🙂 |
Problem
With the inclusion of the new
fastapi-slim
package, it meansfastapi
now includes all the extra dependencies FastAPI does not strictly need. We are looking at usingfastapi-slim
and manually adding only the dependencies we need. However, asfastapi-injector
depends onfastapi
directly, we cannot really do that.Possible solutions
fastapi
does not even depend onfastapi-slim
, it'd be weard to tweak the dependency tofastapi-slim
, as their projects would not directly resolve tofastapi
, and they'd end up installing both. This probably has no impact in the final bundle, but it does not look like the tidiest outcome.fastapi-injector
to not define either as a direct dependency, only keep one of them as optional, and let the users choose whichever they prefer, similar to what the OpenTelemetry packages do.Let me know if any of these (or any other ideas) are interesting to you, happy to work on a PR to get it done. Thanks for your time and effort!
The text was updated successfully, but these errors were encountered: