-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Remove asgiref
from minimal requirements
#1460
Conversation
asgiref
from minimal requirements
In general I think this looks fine, and I'm glad to see Uvicorn entering the There's been a lot of discussion about lumping all the optional dependencies into Related: |
You have a good point. Then, are we against having it as optional but not on the standard extras? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this worth it? I understand that Uvicorn wants to be minimal on dependencies, but I'm not sure the internal complexity with TYPE_CHECKING
is worth it. I also agree that due to how the extras are currently specified it's problematic to ask users to install a bunch of dependencies just to get type checking, and in fact that is contrary to the goal of not forcing dependencies on users (granted, users could look into the extra and cherry pick what they want but that's quite a bit to ask and defeats the point of extras in the first place). Somewhat tangential, but I think this would be a good fit for a default-extras
if it existed.
if typing.TYPE_CHECKING: | ||
from asgiref.typing import ( | ||
ASGI2Application, | ||
ASGIReceiveCallable, | ||
ASGISendCallable, | ||
Scope, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite a bit of boilerplate that we'll have to have in every module
@@ -1,12 +1,16 @@ | |||
from typing import List, Union | |||
from __future__ import annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this __future__
is in somewhat of a limbo, I would be reluctant to merge it.
This is more for |
|
This PR removes
asgiref
from the minimal requirements.Changes:
from __future__ import annotations
to get a small diff - besides the collateral benefits.asgiref
fromminimal_requirements
toextra_requirements
.