split "standard" packaging extra
Discussion Link
https://github.com/Kludex/uvicorn/discussions/2688
Description
As discussed in the discussion, standard brings too many opposite things. Split this extra into at least two, like a "development" with watchman and colorama, and "performance", with uvloop and websocket. Of course, it can be other names than those. I will do the PR.
I'm not sure what's the best separation.
We currently have the following:
dependencies = [
"click>=7.0",
"h11>=0.8",
"typing_extensions>=4.0; python_version < '3.11'",
]
[project.optional-dependencies]
standard = [
"colorama>=0.4; sys_platform == 'win32'",
"httptools>=0.6.3",
"python-dotenv>=0.13",
"PyYAML>=5.1",
"uvloop>=0.15.1; sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')",
"watchfiles>=0.13",
"websockets>=10.4",
]
I'm opened to suggestions.
To be completely honest, we could potentially even make h11 and click optional - but that would be a bad experience? But maybe provide a uvicorn-slim package that holds only typing_extensions, and then uvicorn that has everything?
Would that maybe be a better experience?
EDIT: I just registered uvicorn-slim.
I support the idea of a slim version without click and h11.
While exploring the repository, I noticed that click.style is used not only in main.py but in other parts of the codebase as well.
I'm not sure what the best approach would be to handle that dependency.
I support the idea of a slim version without
clickandh11.While exploring the repository, I noticed that
click.styleis used not only in main.py but in other parts of the codebase as well. I'm not sure what the best approach would be to handle that dependency.
Yeah, that is actually quite annoying. 😅
Dropping click.style from all those code paths may take a bit - also, it may introduce annoyances to users, so I think the best course of action is to create the uvicorn-slim with click and typing_extensions as dependency.