uvicorn 0.27.1__py3-none-any.whl → 0.28.1__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.
@@ -23,10 +23,7 @@ class StatReload(BaseReload):
23
23
  self.mtimes: dict[Path, float] = {}
24
24
 
25
25
  if config.reload_excludes or config.reload_includes:
26
- logger.warning(
27
- "--reload-include and --reload-exclude have no effect unless "
28
- "watchfiles is installed."
29
- )
26
+ logger.warning("--reload-include and --reload-exclude have no effect unless " "watchfiles is installed.")
30
27
 
31
28
  def should_restart(self) -> list[Path] | None:
32
29
  self.pause()
@@ -13,20 +13,12 @@ from uvicorn.supervisors.basereload import BaseReload
13
13
  class FileFilter:
14
14
  def __init__(self, config: Config):
15
15
  default_includes = ["*.py"]
16
- self.includes = [
17
- default
18
- for default in default_includes
19
- if default not in config.reload_excludes
20
- ]
16
+ self.includes = [default for default in default_includes if default not in config.reload_excludes]
21
17
  self.includes.extend(config.reload_includes)
22
18
  self.includes = list(set(self.includes))
23
19
 
24
20
  default_excludes = [".*", ".py[cod]", ".sw.*", "~*"]
25
- self.excludes = [
26
- default
27
- for default in default_excludes
28
- if default not in config.reload_includes
29
- ]
21
+ self.excludes = [default for default in default_excludes if default not in config.reload_includes]
30
22
  self.exclude_dirs = []
31
23
  for e in config.reload_excludes:
32
24
  p = Path(e)
@@ -22,20 +22,12 @@ logger = logging.getLogger("uvicorn.error")
22
22
  class CustomWatcher(DefaultWatcher):
23
23
  def __init__(self, root_path: Path, config: Config):
24
24
  default_includes = ["*.py"]
25
- self.includes = [
26
- default
27
- for default in default_includes
28
- if default not in config.reload_excludes
29
- ]
25
+ self.includes = [default for default in default_includes if default not in config.reload_excludes]
30
26
  self.includes.extend(config.reload_includes)
31
27
  self.includes = list(set(self.includes))
32
28
 
33
29
  default_excludes = [".*", ".py[cod]", ".sw.*", "~*"]
34
- self.excludes = [
35
- default
36
- for default in default_excludes
37
- if default not in config.reload_includes
38
- ]
30
+ self.excludes = [default for default in default_excludes if default not in config.reload_includes]
39
31
  self.excludes.extend(config.reload_excludes)
40
32
  self.excludes = list(set(self.excludes))
41
33
 
@@ -46,7 +38,7 @@ class CustomWatcher(DefaultWatcher):
46
38
  self.resolved_root = root_path
47
39
  super().__init__(str(root_path))
48
40
 
49
- def should_watch_file(self, entry: "DirEntry") -> bool:
41
+ def should_watch_file(self, entry: DirEntry) -> bool:
50
42
  cached_result = self.watched_files.get(entry.path)
51
43
  if cached_result is not None:
52
44
  return cached_result
@@ -71,7 +63,7 @@ class CustomWatcher(DefaultWatcher):
71
63
  self.watched_files[entry.path] = False
72
64
  return False
73
65
 
74
- def should_watch_dir(self, entry: "DirEntry") -> bool:
66
+ def should_watch_dir(self, entry: DirEntry) -> bool:
75
67
  cached_result = self.watched_dirs.get(entry.path)
76
68
  if cached_result is not None:
77
69
  return cached_result
@@ -94,8 +86,7 @@ class CustomWatcher(DefaultWatcher):
94
86
 
95
87
  if is_watched:
96
88
  logger.debug(
97
- "WatchGodReload detected a new excluded dir '%s' in '%s'; "
98
- "Adding to exclude list.",
89
+ "WatchGodReload detected a new excluded dir '%s' in '%s'; " "Adding to exclude list.",
99
90
  entry_path.relative_to(self.resolved_root),
100
91
  str(self.resolved_root),
101
92
  )
@@ -115,8 +106,7 @@ class CustomWatcher(DefaultWatcher):
115
106
  for include_pattern in self.includes:
116
107
  if entry_path.match(include_pattern):
117
108
  logger.info(
118
- "WatchGodReload detected a new reload dir '%s' in '%s'; "
119
- "Adding to watch list.",
109
+ "WatchGodReload detected a new reload dir '%s' in '%s'; " "Adding to watch list.",
120
110
  str(entry_path.relative_to(self.resolved_root)),
121
111
  str(self.resolved_root),
122
112
  )
@@ -136,8 +126,7 @@ class WatchGodReload(BaseReload):
136
126
  sockets: list[socket],
137
127
  ) -> None:
138
128
  warnings.warn(
139
- '"watchgod" is deprecated, you should switch '
140
- "to watchfiles (`pip install watchfiles`).",
129
+ '"watchgod" is deprecated, you should switch ' "to watchfiles (`pip install watchfiles`).",
141
130
  DeprecationWarning,
142
131
  )
143
132
  super().__init__(config, target, sockets)
uvicorn/workers.py CHANGED
@@ -1,8 +1,10 @@
1
+ from __future__ import annotations
2
+
1
3
  import asyncio
2
4
  import logging
3
5
  import signal
4
6
  import sys
5
- from typing import Any, Dict
7
+ from typing import Any
6
8
 
7
9
  from gunicorn.arbiter import Arbiter
8
10
  from gunicorn.workers.base import Worker
@@ -17,10 +19,10 @@ class UvicornWorker(Worker):
17
19
  rather than a WSGI callable.
18
20
  """
19
21
 
20
- CONFIG_KWARGS: Dict[str, Any] = {"loop": "auto", "http": "auto"}
22
+ CONFIG_KWARGS: dict[str, Any] = {"loop": "auto", "http": "auto"}
21
23
 
22
24
  def __init__(self, *args: Any, **kwargs: Any) -> None:
23
- super(UvicornWorker, self).__init__(*args, **kwargs)
25
+ super().__init__(*args, **kwargs)
24
26
 
25
27
  logger = logging.getLogger("uvicorn.error")
26
28
  logger.handlers = self.log.error_log.handlers
@@ -63,7 +65,7 @@ class UvicornWorker(Worker):
63
65
 
64
66
  def init_process(self) -> None:
65
67
  self.config.setup_event_loop()
66
- super(UvicornWorker, self).init_process()
68
+ super().init_process()
67
69
 
68
70
  def init_signals(self) -> None:
69
71
  # Reset signals so Gunicorn doesn't swallow subprocess return codes
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: uvicorn
3
- Version: 0.27.1
3
+ Version: 0.28.1
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
@@ -0,0 +1,45 @@
1
+ uvicorn/__init__.py,sha256=RiTFvcjhSZNPdd6DYmmK2OVbcgPOoMw0htT3gJJ_hCo,147
2
+ uvicorn/__main__.py,sha256=DQizy6nKP0ywhPpnCHgmRDYIMfcqZKVEzNIWQZjqtVQ,62
3
+ uvicorn/_subprocess.py,sha256=wIxSuARuoouCXdLAVQCc2-MNv9utuTCpD9BsmLeqsvE,2505
4
+ uvicorn/_types.py,sha256=uJ4IRbis4frxIuO2mfCQu2OCToLRSFKp8foKIGwMjII,7793
5
+ uvicorn/config.py,sha256=I0YgdIbnwcQB5OGcSvkeDHRI-ChdmjGy5ab1cNKk6ak,20524
6
+ uvicorn/importer.py,sha256=nRt0QQ3qpi264-n_mR0l55C2ddM8nowTNzT1jsWaam8,1128
7
+ uvicorn/logging.py,sha256=sg4D9lHaW_kKQj_kmP-bolbChjKfhBuihktlWp8RjSI,4236
8
+ uvicorn/main.py,sha256=uixfAm9Mfymxr2ZCA_YNy9avkD9Ljyv5onaSgF_bMZc,16565
9
+ uvicorn/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
+ uvicorn/server.py,sha256=Nj5VDidT14BTt_X-dyZ2TQw2H03FeyojG_LymT5P-I0,12053
11
+ uvicorn/workers.py,sha256=WhPoxhxvwebxP69DCfNYo_1mIOC7nIUTeC0wrrjiL3g,3667
12
+ uvicorn/lifespan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ uvicorn/lifespan/off.py,sha256=nfI6qHAUo_8-BEXMBKoHQ9wUbsXrPaXLCbDSS0vKSr8,332
14
+ uvicorn/lifespan/on.py,sha256=1KYuFNNyQONIjtEHhKZAJp-OOokIyjj74wpGCGBv4lk,5184
15
+ uvicorn/loops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ uvicorn/loops/asyncio.py,sha256=VcornZKJoV8yBYgLON3Gd8YKpUxlLlardxy_LJq_PhE,276
17
+ uvicorn/loops/auto.py,sha256=BWVq18ce9SoFTo3z5zNW2IU2850u2tRrc6WyK7idsdI,400
18
+ uvicorn/loops/uvloop.py,sha256=K4QybYVxtK9C2emDhDPUCkBXR4XMT5Ofv9BPFPoX0ok,148
19
+ uvicorn/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ uvicorn/middleware/asgi2.py,sha256=YQrQNm3RehFts3mzk3k4yw8aD8Egtj0tRS3N45YkQa0,394
21
+ uvicorn/middleware/message_logger.py,sha256=IHEZUSnFNaMFUFdwtZO3AuFATnYcSor-gVtOjbCzt8M,2859
22
+ uvicorn/middleware/proxy_headers.py,sha256=-ZHb6hcAe9L--7lQ2waBhZII_W80I4cMd2JqOyYuzdk,3039
23
+ uvicorn/middleware/wsgi.py,sha256=TBeG4W_gEmWddbGfWyxdzJ0IDaWWkJZyF8eIp-1fv0U,7111
24
+ uvicorn/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ uvicorn/protocols/utils.py,sha256=Gt3UTpWnMNduq-hif4UocEkWjdkw7Us0OxMrejHIElA,1853
26
+ uvicorn/protocols/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ uvicorn/protocols/http/auto.py,sha256=YfXGyzWTaaE2p_jkTPWrJCXsxEaQnC3NK0-G7Wgmnls,403
28
+ uvicorn/protocols/http/flow_control.py,sha256=yFt2GpEfugpuPiwCL7bAh8hd9Eub8V8THUJQ8ttDiiU,1771
29
+ uvicorn/protocols/http/h11_impl.py,sha256=fJ9KeGIme-OdLxt7_wrm5VwlDIFtWMw00edgjgN2P0E,20376
30
+ uvicorn/protocols/http/httptools_impl.py,sha256=Ei77FJPorqq8d3C-YGUe9eTLDnX6afaBsoEfj7xtE5Y,21462
31
+ uvicorn/protocols/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ uvicorn/protocols/websockets/auto.py,sha256=kNP-h07ZzjA9dKRUd7MNO0J7xhRJ5xVBfit7wCbdB0A,574
33
+ uvicorn/protocols/websockets/websockets_impl.py,sha256=fIbUdUJZZhx6KdBBj8nG56pkZtNeMWj_QxRgg17bmtQ,15234
34
+ uvicorn/protocols/websockets/wsproto_impl.py,sha256=i7bO9CctoUEwMilg760NgdToHgW0466vk9deR-LLo6E,15130
35
+ uvicorn/supervisors/__init__.py,sha256=UVJYW3RVHMDSgUytToyAgGyd9NUQVqbNpVrQrvm4Tpc,700
36
+ uvicorn/supervisors/basereload.py,sha256=u83LepHT28QFH84wwsxJypwBKO1apG4c4WziPMfOqmE,3850
37
+ uvicorn/supervisors/multiprocess.py,sha256=vBGBBq4vQcSdghev-kGjtBPGMwCyTNs1IE6NeGxQ76s,2156
38
+ uvicorn/supervisors/statreload.py,sha256=gc-HUB44f811PvxD_ZIEQYenM7mWmhQQjYg7KKQ1c5o,1542
39
+ uvicorn/supervisors/watchfilesreload.py,sha256=RMhWgInlOr0MJB0RvmW50RZY1ls9Kp9VT3eaLjdRTpw,2935
40
+ uvicorn/supervisors/watchgodreload.py,sha256=kd-gOvp14ArTNIc206Nt5CEjZZ4NP2UmMVYE7571yRQ,5486
41
+ uvicorn-0.28.1.dist-info/METADATA,sha256=nX8yIckobAeCqktdVScuLMNY4uIixhMzzi1MHKnrPnE,6330
42
+ uvicorn-0.28.1.dist-info/WHEEL,sha256=bq9SyP5NxIRA9EpQgMCd-9RmPHWvbH-4lTDGwxgIR64,87
43
+ uvicorn-0.28.1.dist-info/entry_points.txt,sha256=FW1w-hkc9QgwaGoovMvm0ZY73w_NcycWdGAUfDsNGxw,46
44
+ uvicorn-0.28.1.dist-info/licenses/LICENSE.md,sha256=7-Gs8-YvuZwoiw7HPlp3O3Jo70Mg_nV-qZQhTktjw3E,1526
45
+ uvicorn-0.28.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.21.1
2
+ Generator: hatchling 1.22.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,45 +0,0 @@
1
- uvicorn/__init__.py,sha256=yUFNyOURRd8gh7-5bAUAgvYVHlvGosTzD7QtO7fJXuk,147
2
- uvicorn/__main__.py,sha256=DQizy6nKP0ywhPpnCHgmRDYIMfcqZKVEzNIWQZjqtVQ,62
3
- uvicorn/_subprocess.py,sha256=qLk4nrhmOV6XgsFyxLSsY0IE1fh76-WmCv_hFyXpVYw,2430
4
- uvicorn/_types.py,sha256=l-8V0u0ymt1bQ3P1C_YiExeYLeFgUXi0B7JJzPcbLqg,7965
5
- uvicorn/config.py,sha256=zDPRCu0OE6mbfgVaK7ZyDb5Q_3iUPk3Zr4evO_qcT3E,21150
6
- uvicorn/importer.py,sha256=rUjBcH3xCBIvuEE7Buq4uWxjAzHPjEfP1dESQyAmPpU,1174
7
- uvicorn/logging.py,sha256=imfUy8LUISa_xnVjKmj2OUEs3qr9FlLR_o4W6Ukja00,4272
8
- uvicorn/main.py,sha256=6y5jCRoP2V4b7jWNEwChExp8bWM0_vROk_u-6Zns68Y,16547
9
- uvicorn/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
- uvicorn/server.py,sha256=Zu-hn8-QbNCOGf2xxfpZ6-Ovx3Eva5-Fn-u2srmq0eg,12247
11
- uvicorn/workers.py,sha256=XKDxsZ4qrCc3adtWh6wtl3qQlExWPS0EGOsdBOvm1xg,3675
12
- uvicorn/lifespan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- uvicorn/lifespan/off.py,sha256=vzXBbSkw_DmW7y9Kgba7fRWdJFBeJPtnzTnxUuJA8nM,302
14
- uvicorn/lifespan/on.py,sha256=XzBnwAjJFpO7GRA-sR2gGnnrCHBQH9niA4X-d8EIlyo,5182
15
- uvicorn/loops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- uvicorn/loops/asyncio.py,sha256=VcornZKJoV8yBYgLON3Gd8YKpUxlLlardxy_LJq_PhE,276
17
- uvicorn/loops/auto.py,sha256=BWVq18ce9SoFTo3z5zNW2IU2850u2tRrc6WyK7idsdI,400
18
- uvicorn/loops/uvloop.py,sha256=K4QybYVxtK9C2emDhDPUCkBXR4XMT5Ofv9BPFPoX0ok,148
19
- uvicorn/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- uvicorn/middleware/asgi2.py,sha256=U5zg_1wqQMuPGWWs-uJqlUiqhDmluuVf3hYe3J9dC_k,408
21
- uvicorn/middleware/message_logger.py,sha256=IHEZUSnFNaMFUFdwtZO3AuFATnYcSor-gVtOjbCzt8M,2859
22
- uvicorn/middleware/proxy_headers.py,sha256=hYZAAXSk5_iMohtMzdO9lQ4kVBZnU950FuLnjvIBZfc,3261
23
- uvicorn/middleware/wsgi.py,sha256=WZfcPLFRhasc3S6nGL2dSb7Iq_THnrJ1Bdux7zzdjI8,7218
24
- uvicorn/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- uvicorn/protocols/utils.py,sha256=_LBUBuSiw9HesKilP1vv0-cuQRxZCmm7wHmTUUnp6e8,1875
26
- uvicorn/protocols/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- uvicorn/protocols/http/auto.py,sha256=YfXGyzWTaaE2p_jkTPWrJCXsxEaQnC3NK0-G7Wgmnls,403
28
- uvicorn/protocols/http/flow_control.py,sha256=4ERvUKBa8Ocsmw-kpRmVkwbEnmuxPmKnOE-NV4mkE2M,1777
29
- uvicorn/protocols/http/h11_impl.py,sha256=-h3B1PtnT5go_7fIYMa5JJ7FUBS66dwW5FL4cjDrEto,20468
30
- uvicorn/protocols/http/httptools_impl.py,sha256=tOOFC2JJ6dMrBZdVl8W7nocWzqoK5Rqzl5wVkAnl9-A,21759
31
- uvicorn/protocols/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- uvicorn/protocols/websockets/auto.py,sha256=H7irPeGN2MdHE29hdPKwca9YTA7HaOuWdIxvRuOgRtM,548
33
- uvicorn/protocols/websockets/websockets_impl.py,sha256=kWlqERmip64SW0OQTQNAb1JfI9q4WwtlF_wmd1zy4bE,15630
34
- uvicorn/protocols/websockets/wsproto_impl.py,sha256=cvPXdve4lKFoSkbulFzAaSG8btYFOykIwNNqYecHhNk,15521
35
- uvicorn/supervisors/__init__.py,sha256=YSH0n2BiqyN5m3QaT_QAkS0DkFE2xXHpKDc4ORbh82o,670
36
- uvicorn/supervisors/basereload.py,sha256=iAXvd_uqku5py9B7uBV-rzqWBJAKV6o4_gyGns9xC2I,3924
37
- uvicorn/supervisors/multiprocess.py,sha256=EAF31mLkmFm-XHp1JwYZg9ghaCjkWkgD_Vbn_1Mffx0,2246
38
- uvicorn/supervisors/statreload.py,sha256=XmfYr1iC8XoMUrxxjQnrqQGmBShF0L1Q4n-OPxGVOh8,1588
39
- uvicorn/supervisors/watchfilesreload.py,sha256=E62mIa-w_SxtuDj9KX4h8ziufRMsYU4PkdCO0asK2zQ,3027
40
- uvicorn/supervisors/watchgodreload.py,sha256=5gSwqV8boxgrGE1j6uFm1utJaF7CuO0Aw5Q--mInIgY,5638
41
- uvicorn-0.27.1.dist-info/METADATA,sha256=XPnBSYwjoHVMAJHEFOEISoQsuHmfgwEQaWpFOdczFGg,6330
42
- uvicorn-0.27.1.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
43
- uvicorn-0.27.1.dist-info/entry_points.txt,sha256=FW1w-hkc9QgwaGoovMvm0ZY73w_NcycWdGAUfDsNGxw,46
44
- uvicorn-0.27.1.dist-info/licenses/LICENSE.md,sha256=7-Gs8-YvuZwoiw7HPlp3O3Jo70Mg_nV-qZQhTktjw3E,1526
45
- uvicorn-0.27.1.dist-info/RECORD,,