uvicorn 0.33.0__py3-none-any.whl → 0.34.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uvicorn/__init__.py +1 -1
- uvicorn/_types.py +5 -17
- uvicorn/config.py +2 -1
- uvicorn/middleware/wsgi.py +1 -1
- uvicorn/protocols/websockets/websockets_impl.py +2 -1
- uvicorn/protocols/websockets/wsproto_impl.py +1 -0
- uvicorn/server.py +3 -5
- uvicorn/supervisors/basereload.py +2 -1
- uvicorn/supervisors/statreload.py +2 -1
- {uvicorn-0.33.0.dist-info → uvicorn-0.34.0.dist-info}/METADATA +2 -3
- {uvicorn-0.33.0.dist-info → uvicorn-0.34.0.dist-info}/RECORD +14 -14
- {uvicorn-0.33.0.dist-info → uvicorn-0.34.0.dist-info}/WHEEL +0 -0
- {uvicorn-0.33.0.dist-info → uvicorn-0.34.0.dist-info}/entry_points.txt +0 -0
- {uvicorn-0.33.0.dist-info → uvicorn-0.34.0.dist-info}/licenses/LICENSE.md +0 -0
uvicorn/__init__.py
CHANGED
uvicorn/_types.py
CHANGED
@@ -32,20 +32,8 @@ from __future__ import annotations
|
|
32
32
|
|
33
33
|
import sys
|
34
34
|
import types
|
35
|
-
from
|
36
|
-
|
37
|
-
Awaitable,
|
38
|
-
Callable,
|
39
|
-
Iterable,
|
40
|
-
Literal,
|
41
|
-
MutableMapping,
|
42
|
-
Optional,
|
43
|
-
Protocol,
|
44
|
-
Tuple,
|
45
|
-
Type,
|
46
|
-
TypedDict,
|
47
|
-
Union,
|
48
|
-
)
|
35
|
+
from collections.abc import Awaitable, Iterable, MutableMapping
|
36
|
+
from typing import Any, Callable, Literal, Optional, Protocol, TypedDict, Union
|
49
37
|
|
50
38
|
if sys.version_info >= (3, 11): # pragma: py-lt-311
|
51
39
|
from typing import NotRequired
|
@@ -54,8 +42,8 @@ else: # pragma: py-gte-311
|
|
54
42
|
|
55
43
|
# WSGI
|
56
44
|
Environ = MutableMapping[str, Any]
|
57
|
-
ExcInfo =
|
58
|
-
StartResponse = Callable[[str, Iterable[
|
45
|
+
ExcInfo = tuple[type[BaseException], BaseException, Optional[types.TracebackType]]
|
46
|
+
StartResponse = Callable[[str, Iterable[tuple[str, str]], Optional[ExcInfo]], None]
|
59
47
|
WSGIApp = Callable[[Environ, StartResponse], Union[Iterable[bytes], BaseException]]
|
60
48
|
|
61
49
|
|
@@ -281,7 +269,7 @@ class ASGI2Protocol(Protocol):
|
|
281
269
|
async def __call__(self, receive: ASGIReceiveCallable, send: ASGISendCallable) -> None: ... # pragma: no cover
|
282
270
|
|
283
271
|
|
284
|
-
ASGI2Application =
|
272
|
+
ASGI2Application = type[ASGI2Protocol]
|
285
273
|
ASGI3Application = Callable[
|
286
274
|
[
|
287
275
|
Scope,
|
uvicorn/config.py
CHANGED
@@ -9,9 +9,10 @@ import os
|
|
9
9
|
import socket
|
10
10
|
import ssl
|
11
11
|
import sys
|
12
|
+
from collections.abc import Awaitable
|
12
13
|
from configparser import RawConfigParser
|
13
14
|
from pathlib import Path
|
14
|
-
from typing import IO, Any,
|
15
|
+
from typing import IO, Any, Callable, Literal
|
15
16
|
|
16
17
|
import click
|
17
18
|
|
uvicorn/middleware/wsgi.py
CHANGED
@@ -3,7 +3,8 @@ from __future__ import annotations
|
|
3
3
|
import asyncio
|
4
4
|
import http
|
5
5
|
import logging
|
6
|
-
from
|
6
|
+
from collections.abc import Sequence
|
7
|
+
from typing import Any, Literal, Optional, cast
|
7
8
|
from urllib.parse import unquote
|
8
9
|
|
9
10
|
import websockets
|
@@ -224,6 +224,7 @@ class WSProtocol(asyncio.Protocol):
|
|
224
224
|
headers: list[tuple[bytes, bytes]] = [
|
225
225
|
(b"content-type", b"text/plain; charset=utf-8"),
|
226
226
|
(b"connection", b"close"),
|
227
|
+
(b"content-length", b"21"),
|
227
228
|
]
|
228
229
|
output = self.conn.send(wsproto.events.RejectConnection(status_code=500, headers=headers, has_body=True))
|
229
230
|
output += self.conn.send(wsproto.events.RejectData(data=b"Internal Server Error"))
|
uvicorn/server.py
CHANGED
@@ -10,9 +10,10 @@ import socket
|
|
10
10
|
import sys
|
11
11
|
import threading
|
12
12
|
import time
|
13
|
+
from collections.abc import Generator, Sequence
|
13
14
|
from email.utils import formatdate
|
14
15
|
from types import FrameType
|
15
|
-
from typing import TYPE_CHECKING,
|
16
|
+
from typing import TYPE_CHECKING, Union
|
16
17
|
|
17
18
|
import click
|
18
19
|
|
@@ -284,10 +285,7 @@ class Server:
|
|
284
285
|
len(self.server_state.tasks),
|
285
286
|
)
|
286
287
|
for t in self.server_state.tasks:
|
287
|
-
|
288
|
-
t.cancel()
|
289
|
-
else: # pragma: py-lt-39
|
290
|
-
t.cancel(msg="Task cancelled, timeout graceful shutdown exceeded")
|
288
|
+
t.cancel(msg="Task cancelled, timeout graceful shutdown exceeded")
|
291
289
|
|
292
290
|
# Send the lifespan shutdown event, and wait for application shutdown.
|
293
291
|
if not self.force_exit:
|
@@ -5,10 +5,11 @@ import os
|
|
5
5
|
import signal
|
6
6
|
import sys
|
7
7
|
import threading
|
8
|
+
from collections.abc import Iterator
|
8
9
|
from pathlib import Path
|
9
10
|
from socket import socket
|
10
11
|
from types import FrameType
|
11
|
-
from typing import Callable
|
12
|
+
from typing import Callable
|
12
13
|
|
13
14
|
import click
|
14
15
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import logging
|
4
|
+
from collections.abc import Iterator
|
4
5
|
from pathlib import Path
|
5
6
|
from socket import socket
|
6
|
-
from typing import Callable
|
7
|
+
from typing import Callable
|
7
8
|
|
8
9
|
from uvicorn.config import Config
|
9
10
|
from uvicorn.supervisors.basereload import BaseReload
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: uvicorn
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.34.0
|
4
4
|
Summary: The lightning-fast ASGI server.
|
5
5
|
Project-URL: Changelog, https://github.com/encode/uvicorn/blob/master/CHANGELOG.md
|
6
6
|
Project-URL: Funding, https://github.com/sponsors/encode
|
@@ -14,7 +14,6 @@ Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: License :: OSI Approved :: BSD License
|
15
15
|
Classifier: Operating System :: OS Independent
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
18
17
|
Classifier: Programming Language :: Python :: 3.9
|
19
18
|
Classifier: Programming Language :: Python :: 3.10
|
20
19
|
Classifier: Programming Language :: Python :: 3.11
|
@@ -23,7 +22,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
23
22
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
24
23
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
25
24
|
Classifier: Topic :: Internet :: WWW/HTTP
|
26
|
-
Requires-Python: >=3.
|
25
|
+
Requires-Python: >=3.9
|
27
26
|
Requires-Dist: click>=7.0
|
28
27
|
Requires-Dist: h11>=0.8
|
29
28
|
Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
|
@@ -1,13 +1,13 @@
|
|
1
|
-
uvicorn/__init__.py,sha256=
|
1
|
+
uvicorn/__init__.py,sha256=6QKvxaTzHjM48izaeuZXBkVrqShBw6KeHswYwj4FwHg,147
|
2
2
|
uvicorn/__main__.py,sha256=DQizy6nKP0ywhPpnCHgmRDYIMfcqZKVEzNIWQZjqtVQ,62
|
3
3
|
uvicorn/_subprocess.py,sha256=HbfRnsCkXyg7xCWVAWWzXQTeWlvLKfTlIF5wevFBkR4,2766
|
4
|
-
uvicorn/_types.py,sha256=
|
5
|
-
uvicorn/config.py,sha256=
|
4
|
+
uvicorn/_types.py,sha256=5FcPvvIfeKsJDjGhTrceDv8TmwzYI8yPF7mXsXTWOUM,7775
|
5
|
+
uvicorn/config.py,sha256=bMSdgFZpD6wfQ0-ieIl3Ha3IVDFCGLtt0mpg-JVNtuY,20897
|
6
6
|
uvicorn/importer.py,sha256=nRt0QQ3qpi264-n_mR0l55C2ddM8nowTNzT1jsWaam8,1128
|
7
7
|
uvicorn/logging.py,sha256=-eCE4nOJmFbtB9qfNJuEVNF0Y13LGUHqvFzemYT0PaQ,4235
|
8
8
|
uvicorn/main.py,sha256=iv6ptgDBnko0W-VkHs0e3I4UrF7_5sEZrntQNKJGFNY,16915
|
9
9
|
uvicorn/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
10
|
-
uvicorn/server.py,sha256=
|
10
|
+
uvicorn/server.py,sha256=jdPRUFI_0UCpmBxB8PrpY7hpsgwGTdlKt0IrxFN0jm8,12893
|
11
11
|
uvicorn/workers.py,sha256=7KGgGAapxGkGeXUcBGunOjSNdI9R44KCoWTGEAqAdfs,3895
|
12
12
|
uvicorn/lifespan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
uvicorn/lifespan/off.py,sha256=nfI6qHAUo_8-BEXMBKoHQ9wUbsXrPaXLCbDSS0vKSr8,332
|
@@ -20,7 +20,7 @@ uvicorn/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
20
20
|
uvicorn/middleware/asgi2.py,sha256=YQrQNm3RehFts3mzk3k4yw8aD8Egtj0tRS3N45YkQa0,394
|
21
21
|
uvicorn/middleware/message_logger.py,sha256=IHEZUSnFNaMFUFdwtZO3AuFATnYcSor-gVtOjbCzt8M,2859
|
22
22
|
uvicorn/middleware/proxy_headers.py,sha256=f1VDAc-ipPHdNTuLNHwYCeDgYXoCL_VjD6hDTUXZT_U,5790
|
23
|
-
uvicorn/middleware/wsgi.py,sha256=
|
23
|
+
uvicorn/middleware/wsgi.py,sha256=F45FLfMZc510LiYpu7VQnoFpRof4k5pm5CTER4urs3U,7120
|
24
24
|
uvicorn/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
uvicorn/protocols/utils.py,sha256=rCjYLd4_uwPeZkbRXQ6beCfxyI_oYpvJCwz3jEGNOiE,1849
|
26
26
|
uvicorn/protocols/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -30,15 +30,15 @@ uvicorn/protocols/http/h11_impl.py,sha256=4b-KswK57FBaRPeHXlK_oy8pKM6vG1haALCIeR
|
|
30
30
|
uvicorn/protocols/http/httptools_impl.py,sha256=tuQBCiD6rf5DQeyQwHVc45rxH9ouojMpkXi9KG6NRBk,21805
|
31
31
|
uvicorn/protocols/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
uvicorn/protocols/websockets/auto.py,sha256=kNP-h07ZzjA9dKRUd7MNO0J7xhRJ5xVBfit7wCbdB0A,574
|
33
|
-
uvicorn/protocols/websockets/websockets_impl.py,sha256=
|
34
|
-
uvicorn/protocols/websockets/wsproto_impl.py,sha256=
|
33
|
+
uvicorn/protocols/websockets/websockets_impl.py,sha256=0y4kk-zR-uPdmpjq9OYuzJk7g9amlispUmM91lyqRdY,15517
|
34
|
+
uvicorn/protocols/websockets/wsproto_impl.py,sha256=ga8JzDUU2QrQsjgQdgIilfbmBHIrH4zbyGM4maovTRo,15381
|
35
35
|
uvicorn/supervisors/__init__.py,sha256=wT8eOEIqT1yWQgytZtv5taWMul7xoTIY0xm1m4oyPTw,507
|
36
|
-
uvicorn/supervisors/basereload.py,sha256=
|
36
|
+
uvicorn/supervisors/basereload.py,sha256=arOe3PqQp0L5FvCYDsVg8jUev-57syWFzHhggsM18VY,3858
|
37
37
|
uvicorn/supervisors/multiprocess.py,sha256=Opt0XvOUj1DIMXYwb4OlkJZxeh_RjweFnTmDPYItONw,7507
|
38
|
-
uvicorn/supervisors/statreload.py,sha256=
|
38
|
+
uvicorn/supervisors/statreload.py,sha256=hXznDIW3f54ltxik6hXsBSC-1qBFL30eCvtPSlIvn1o,1569
|
39
39
|
uvicorn/supervisors/watchfilesreload.py,sha256=41FGNMXPKrKvPr-5O8yRWg43l6OCBtapt39M-gpdk0E,3010
|
40
|
-
uvicorn-0.
|
41
|
-
uvicorn-0.
|
42
|
-
uvicorn-0.
|
43
|
-
uvicorn-0.
|
44
|
-
uvicorn-0.
|
40
|
+
uvicorn-0.34.0.dist-info/METADATA,sha256=bS8aEm2BGuEU-2n8mLQYHWl5dD0TLAU3IxswLCB4QcU,6534
|
41
|
+
uvicorn-0.34.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
42
|
+
uvicorn-0.34.0.dist-info/entry_points.txt,sha256=FW1w-hkc9QgwaGoovMvm0ZY73w_NcycWdGAUfDsNGxw,46
|
43
|
+
uvicorn-0.34.0.dist-info/licenses/LICENSE.md,sha256=7-Gs8-YvuZwoiw7HPlp3O3Jo70Mg_nV-qZQhTktjw3E,1526
|
44
|
+
uvicorn-0.34.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|