uvicorn icon indicating copy to clipboard operation
uvicorn copied to clipboard

split "standard" packaging extra

Open deronnax opened this issue 3 months ago • 3 comments

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.

deronnax avatar Sep 24 '25 14:09 deronnax

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.

Kludex avatar Oct 12 '25 21:10 Kludex

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.

deniszitu avatar Oct 13 '25 23:10 deniszitu

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.

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.

Kludex avatar Oct 21 '25 18:10 Kludex