asgi-tools 1.2.0__cp310-cp310-macosx_11_0_arm64.whl → 1.3.2__cp310-cp310-macosx_11_0_arm64.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.
Binary file
asgi_tools/middleware.py CHANGED
@@ -392,7 +392,7 @@ class StaticFilesMiddleware(BaseMiddleware):
392
392
  super().__init__(app)
393
393
  self.url_prefix = url_prefix
394
394
  folders = folders or []
395
- self.folders: list[Path] = [Path(folder) for folder in folders]
395
+ self.folders: list[Path] = [Path(folder).resolve() for folder in folders]
396
396
 
397
397
  async def __process__(self, scope: TASGIScope, receive: TASGIReceive, send: TASGISend) -> None:
398
398
  """Serve static files for self url prefix."""
Binary file
asgi_tools/response.py CHANGED
@@ -399,8 +399,7 @@ class ResponseRedirect(Response, BaseException):
399
399
  class ResponseErrorMeta(type):
400
400
  """Generate Response Errors by HTTP names."""
401
401
 
402
- # TODO: From python 3.9 -> partial['ResponseError]
403
- def __getattr__(cls, name: str) -> Callable[..., ResponseError]:
402
+ def __getattr__(cls, name: str) -> partial[ResponseError]:
404
403
  """Generate Response Errors by HTTP names."""
405
404
  status = HTTPStatus[name]
406
405
  return partial(
@@ -448,9 +447,8 @@ class ResponseError(Response, BaseException, metaclass=ResponseErrorMeta):
448
447
  UNSUPPORTED_MEDIA_TYPE: Callable[..., ResponseError] # 415
449
448
  REQUESTED_RANGE_NOT_SATISFIABLE: Callable[..., ResponseError] # 416
450
449
  EXPECTATION_FAILED: Callable[..., ResponseError] # 417
451
- # TODO: From python 3.9
452
- # IM_A_TEAPOT: Callable[..., ResponseError] # 418
453
- # MISDIRECTED_REQUEST: Callable[..., ResponseError] # 421
450
+ IM_A_TEAPOT: Callable[..., ResponseError] # 418
451
+ MISDIRECTED_REQUEST: Callable[..., ResponseError] # 421
454
452
  UNPROCESSABLE_ENTITY: Callable[..., ResponseError] # 422
455
453
  LOCKED: Callable[..., ResponseError] # 423
456
454
  FAILED_DEPENDENCY: Callable[..., ResponseError] # 424
@@ -459,8 +457,7 @@ class ResponseError(Response, BaseException, metaclass=ResponseErrorMeta):
459
457
  PRECONDITION_REQUIRED: Callable[..., ResponseError] # 428
460
458
  TOO_MANY_REQUESTS: Callable[..., ResponseError] # 429
461
459
  REQUEST_HEADER_FIELDS_TOO_LARGE: Callable[..., ResponseError] # 431
462
- # TODO: From python 3.9
463
- # UNAVAILABLE_FOR_LEGAL_REASONS: Callable[..., ResponseError] # 451
460
+ UNAVAILABLE_FOR_LEGAL_REASONS: Callable[..., ResponseError] # 451
464
461
 
465
462
  INTERNAL_SERVER_ERROR: Callable[..., ResponseError] # 500
466
463
  NOT_IMPLEMENTED: Callable[..., ResponseError] # 501
@@ -532,6 +529,3 @@ def parse_websocket_msg(msg: TASGIMessage, charset: str | None = None) -> TASGIM
532
529
 
533
530
  async def empty():
534
531
  yield b""
535
-
536
-
537
- # ruff: noqa: ERA001
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: asgi-tools
3
- Version: 1.2.0
3
+ Version: 1.3.2
4
4
  Summary: ASGI Toolkit to build web applications
5
5
  Author-email: Kirill Klenov <horneds@gmail.com>
6
6
  License: MIT License
@@ -33,7 +33,7 @@ Requires-Dist: async-timeout; python_version < "3.11"
33
33
  Provides-Extra: tests
34
34
  Requires-Dist: aiofile; extra == "tests"
35
35
  Requires-Dist: pytest; extra == "tests"
36
- Requires-Dist: pytest-aio[curio,trio]>=1.2.0; extra == "tests"
36
+ Requires-Dist: pytest-aio[curio,trio]>=1.3.2; extra == "tests"
37
37
  Requires-Dist: pytest-benchmark; extra == "tests"
38
38
  Requires-Dist: PyYAML; extra == "tests"
39
39
  Requires-Dist: ruff; extra == "tests"
@@ -124,7 +124,7 @@ For instance these middlewares were built with the library:
124
124
  Requirements
125
125
  =============
126
126
 
127
- - python >= 3.9
127
+ - python >= 3.10
128
128
 
129
129
  .. note:: pypy3 is also supported
130
130
 
@@ -1,8 +1,8 @@
1
- asgi_tools-1.2.0.dist-info/RECORD,,
2
- asgi_tools-1.2.0.dist-info/WHEEL,sha256=11kMdE9gzbsaQG30fRcsAYxBLEVRsqJo098Y5iL60Xo,136
3
- asgi_tools-1.2.0.dist-info/top_level.txt,sha256=-6i6ebKuJ0cSaXJ3KWPmJLKUbmBE2UsuA2b7BcZMJSk,11
4
- asgi_tools-1.2.0.dist-info/METADATA,sha256=Oyxz72uoD1qM5iK1fxjGVEYtWZ61H-Ma0GO16M_kPKA,7138
5
- asgi_tools-1.2.0.dist-info/licenses/LICENSE,sha256=ytogAgYcPT6gWj8aRc-cZwhSq9Y3wOzG-4KteKCyQOw,1070
1
+ asgi_tools-1.3.2.dist-info/RECORD,,
2
+ asgi_tools-1.3.2.dist-info/WHEEL,sha256=11kMdE9gzbsaQG30fRcsAYxBLEVRsqJo098Y5iL60Xo,136
3
+ asgi_tools-1.3.2.dist-info/top_level.txt,sha256=-6i6ebKuJ0cSaXJ3KWPmJLKUbmBE2UsuA2b7BcZMJSk,11
4
+ asgi_tools-1.3.2.dist-info/METADATA,sha256=7NwnIzvg_zHcmhcrf5h1fMwPtQrlZMZg2lAdX82JBEM,7139
5
+ asgi_tools-1.3.2.dist-info/licenses/LICENSE,sha256=ytogAgYcPT6gWj8aRc-cZwhSq9Y3wOzG-4KteKCyQOw,1070
6
6
  asgi_tools/multipart.py,sha256=8RkJm9JIjyjR7z2OIhYg8fgLKq21HBWCMEOwbhx-3GA,21707
7
7
  asgi_tools/multipart.pyx,sha256=pq-DzmAaRhS0yMJIFPNI-GP7OjJUt4k3Y8vMbXJOpKk,21929
8
8
  asgi_tools/forms.c,sha256=v7t7ia5JTU68Eg1weG353v2IKfjQf_jTKUBSDmg8pgQ,826881
@@ -10,15 +10,15 @@ asgi_tools/multipart.c,sha256=EY4Z9r8PmtB-EuV7mI1evcyEGOFpKZCT-KeE5GPH2II,844007
10
10
  asgi_tools/constants.py,sha256=B7fJabLdpSE4COX0vAudyC32xV0dSpLgg0kob-FlCkE,128
11
11
  asgi_tools/request.py,sha256=s-CqT9JI-aPZz46YtKyvSDR7CfLxEhPrIuH9OG6npzk,10802
12
12
  asgi_tools/__init__.py,sha256=tBnlggb3FJPK8tDrnpC580OfbQ0QpuKFRdyfxmIeu8w,1428
13
- asgi_tools/response.py,sha256=ZBe1UCu64k8hRqrgGvhGrk-mT653mWnaDa7a01LFkD0,18685
14
- asgi_tools/multipart.cpython-310-darwin.so,sha256=t02UIh8QrB8JL6YBuLvRhH1GVKUq92NTlvaYwTs0r_0,162336
13
+ asgi_tools/response.py,sha256=-oePnVs5_lAjZWBgcVbdnhuStHMJoqnaqYS1Dqw3rFU,18494
14
+ asgi_tools/multipart.cpython-310-darwin.so,sha256=6ZfZBjQ1n6_MGt32P_mgaxfZVAYQ0SfvMPLD2PsJvGw,162336
15
15
  asgi_tools/types.py,sha256=QWmrnhqc_jEUaXUcMm5iMpxpd6vrTcCnlq4O9moKANg,926
16
16
  asgi_tools/forms.py,sha256=ers1A52YEAO1TBYWJP73K6q6jArNU7QbV0LjTlpKdeM,5059
17
17
  asgi_tools/view.py,sha256=DO0Lr8euP98kMicDwmZLcbMpJ-Hzbhl3vYFYqAXpisw,1925
18
18
  asgi_tools/utils.py,sha256=6qNwZbUsKatg75Gi1ltRsAeJhBaf1gwJkuR0LemitRw,2813
19
19
  asgi_tools/logs.py,sha256=FaXJF5UYClU-JdqLL7VANxQ8O-eYAEemt0Zc_GaEC60,148
20
20
  asgi_tools/app.py,sha256=OEkoRszSRJ9bwWQ3SKWm3Pv-R0B8uKcP9ciYsDMyCGg,10790
21
- asgi_tools/forms.cpython-310-darwin.so,sha256=WTlKpYllq1ZBb3cy9b24XI4k7IyAavM9bzRa0Z_rH_o,187416
21
+ asgi_tools/forms.cpython-310-darwin.so,sha256=fd9LlxS3I-uaLpOJ7Z1-tIkNNRBIRtbcrSuKA9AOWuc,187416
22
22
  asgi_tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  asgi_tools/errors.py,sha256=TTAtJL5w2EVm9dVNK2pqNBRWM1lGJXg7HnJTibjgkes,550
24
24
  asgi_tools/multipart.pxd,sha256=bPnRLYuBw51OX7v-SZTOgOpb4PxM1MtR5dGWVoymX3A,725
@@ -26,4 +26,4 @@ asgi_tools/forms.pyx,sha256=ol1iEXDwS--9vNIoxFFvcTRvzUF14gQC3SDWW9K5-k8,5340
26
26
  asgi_tools/router.py,sha256=1MCF5QLfYPWZH10AuXMRN0rTMTyQWciDSh3owgsFhk4,440
27
27
  asgi_tools/_compat.py,sha256=3BTsysYhxa0itJzCWnzpnE-HuYGs7vXzZRgQRei0IW4,7483
28
28
  asgi_tools/tests.py,sha256=elUGlBE8qklBzKAov1x1i0eVHfkFLzj5Oifd6_JjHv4,12944
29
- asgi_tools/middleware.py,sha256=_hTALpm3Gv_3ssCyZfInzuFC8onNz2ZFVrDCdgOcnF8,15148
29
+ asgi_tools/middleware.py,sha256=hkAdedGiWNTZJ2_AULzI9trn_qHMoN3QxHOQ7tvegF0,15158