Skip to content

Commit

Permalink
Break up uvicorn[standard] optional dependencies (#60)
Browse files Browse the repository at this point in the history
Uvicorn lumps several optional dependencies into a "standard" extra:

- `colorama` (for Windows)
- `httptools`
- `python-dotenv`
- `pyyaml`
- `uvloop`
- `watchgod`/`watchfiles` (`watchgod` was renamed to `watchfiles`)
- `websockets`

There has been some discussion about the drawbacks of this approach:

- encode/uvicorn#219
- encode/uvicorn#1274
- encode/uvicorn#1547

inboard has previously installed the "standard" extra by default. This
commit will change the default to installing Uvicorn without "standard."
This is a **BREAKING CHANGE** to inboard's dependencies.

A new `inboard[uvicorn-fast]` extra will be added for dependencies from
`uvicorn[standard]` related to web server performance, and can be
installed by specifying the extra when installing inboard, like
`python -m pip install 'inboard[fastapi,uvicorn-fast]'`:

- `httptools`
- `uvloop`
- `websockets`

For users who still need all the `uvicorn[standard]` extras, a new
`inboard[uvicorn-standard]` extra will be added to the inboard package,
and can be installed by specifying the extra when installing inboard,
like `python -m pip install 'inboard[fastapi,uvicorn-standard]'`.
  • Loading branch information
br3ndonland authored Dec 31, 2022
1 parent 49d3b96 commit 01ad352
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
]
dependencies = [
"gunicorn>=20,<21",
"uvicorn[standard]>=0.17,<0.18",
"uvicorn>=0.17,<0.18",
]
description = "Docker images and utilities to power your Python APIs and help you ship faster."
dynamic = ["version"]
Expand Down Expand Up @@ -57,6 +57,14 @@ tests = [
"pytest-mock>=3,<4",
"pytest-timeout>=1,<2",
]
uvicorn-fast = [
"httptools>=0.4.0",
"uvloop>=0.14.0,!=0.15.0,!=0.15.1; sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')",
"websockets>=10.0",
]
uvicorn-standard = [
"uvicorn[standard]>=0.17,<0.18",
]

[project.urls]
Docker = "https://github.com/br3ndonland/inboard/pkgs/container/inboard"
Expand Down Expand Up @@ -86,6 +94,7 @@ features = [
"checks",
"fastapi",
"tests",
"uvicorn-fast",
]
path = ".venv"

Expand All @@ -96,6 +105,7 @@ features = [
"docs",
"fastapi",
"tests",
"uvicorn-fast",
]
path = ".venv"

Expand Down

0 comments on commit 01ad352

Please sign in to comment.