sotkalib 0.0.5.post3__tar.gz → 0.0.5.post4__tar.gz

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.
Files changed (25) hide show
  1. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/PKG-INFO +1 -1
  2. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/pyproject.toml +2 -2
  3. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/http/__init__.py +0 -3
  4. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/http/client_session.py +6 -22
  5. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/redis/client.py +2 -1
  6. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/README.md +0 -0
  7. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/__init__.py +0 -0
  8. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/config/__init__.py +0 -0
  9. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/config/field.py +0 -0
  10. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/config/struct.py +0 -0
  11. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/enum/__init__.py +0 -0
  12. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/enum/mixins.py +0 -0
  13. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/exceptions/__init__.py +0 -0
  14. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/exceptions/api/__init__.py +0 -0
  15. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/exceptions/api/exc.py +0 -0
  16. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/exceptions/handlers/__init__.py +0 -0
  17. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/exceptions/handlers/args_incl_error.py +0 -0
  18. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/exceptions/handlers/core.py +0 -0
  19. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/log/__init__.py +0 -0
  20. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/log/factory.py +0 -0
  21. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/py.typed +0 -0
  22. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/redis/__init__.py +0 -0
  23. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/redis/lock.py +0 -0
  24. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/sqla/__init__.py +0 -0
  25. {sotkalib-0.0.5.post3 → sotkalib-0.0.5.post4}/src/sotkalib/sqla/db.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sotkalib
3
- Version: 0.0.5.post3
3
+ Version: 0.0.5.post4
4
4
  Summary:
5
5
  Author: alexey
6
6
  Author-email: alexey <me@pyrorhythm.dev>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sotkalib"
3
- version = "0.0.5.post3"
3
+ version = "0.0.5.post4"
4
4
  description = ""
5
5
  authors = [
6
6
  { email = "me@pyrorhythm.dev", name = "alexey" }
@@ -78,7 +78,7 @@ select = [
78
78
  "PL",
79
79
  "PERF"
80
80
  ]
81
- ignore = ["PERF401", "G004"]
81
+ ignore = ["PERF401", "G004", "UP037"]
82
82
 
83
83
  [tool.ruff.lint.isort]
84
84
  known-first-party = [
@@ -1,9 +1,7 @@
1
1
  from .client_session import (
2
2
  ClientSettings,
3
- # Exceptions
4
3
  CriticalStatusError,
5
4
  ExceptionSettings,
6
- Handler,
7
5
  HTTPSession,
8
6
  Middleware,
9
7
  Next,
@@ -19,7 +17,6 @@ __all__ = (
19
17
  "ExceptionSettings",
20
18
  "StatusSettings",
21
19
  "ClientSettings",
22
- "Handler",
23
20
  "Middleware",
24
21
  "Next",
25
22
  # Exceptions
@@ -119,9 +119,11 @@ async def default_stat_arg_func(ctx: RequestContext) -> tuple[Sequence[Any], Non
119
119
 
120
120
 
121
121
  def default_exc_arg_func(ctx: RequestContext) -> tuple[Sequence[Any], None]:
122
- exc = ctx.last_error
123
- msg = f"exception {type(exc)}: ({exc=}) attempt={ctx.attempt}; url={ctx.url} method={ctx.method}"
124
- return (msg,), None
122
+ return (
123
+ (
124
+ f"exception {type(ctx.last_error)}: ({ctx.last_error=}) attempt={ctx.attempt}; url={ctx.url} method={ctx.method}"
125
+ ),
126
+ ), None
125
127
 
126
128
 
127
129
  class StatusSettings(BaseModel):
@@ -215,7 +217,7 @@ class HTTPSession[R = aiohttp.ClientResponse | None]:
215
217
  self._middlewares = _middlewares or []
216
218
  self._logger = get_logger("http.client_session")
217
219
 
218
- def use[NewR](self, middleware: Middleware[R, NewR]) -> HTTPSession[NewR]:
220
+ def use[NewR](self, middleware: Middleware[R, NewR]) -> "HTTPSession[NewR]":
219
221
  return HTTPSession[NewR](
220
222
  config=self.config,
221
223
  _middlewares=[*self._middlewares, middleware],
@@ -424,21 +426,3 @@ class HTTPSession[R = aiohttp.ClientResponse | None]:
424
426
 
425
427
  def merge_tuples[T](t1: tuple[T, ...], t2: tuple[T, ...]) -> tuple[T, ...]:
426
428
  return t1 + t2
427
-
428
-
429
- # ============================================================================
430
- # Legacy compatibility aliases
431
- # ============================================================================
432
-
433
- # Old Handler protocol - kept for backwards compatibility but deprecated
434
- from typing import Protocol
435
-
436
-
437
- class Handler[**P, T](Protocol):
438
- """
439
- DEPRECATED: Use Middleware type instead.
440
-
441
- Old handler protocol for backwards compatibility.
442
- """
443
-
444
- async def __call__(self, *args: P.args, **kwargs: P.kwargs) -> T: ...
@@ -1,5 +1,6 @@
1
1
  import asyncio
2
2
  from contextlib import AbstractAsyncContextManager
3
+ from typing import Self
3
4
 
4
5
  from pydantic import BaseModel, Field
5
6
  from redis.asyncio import ConnectionPool, Redis
@@ -29,7 +30,7 @@ class RedisPool(AbstractAsyncContextManager):
29
30
  self._usage_counter = 0
30
31
  self._usage_lock = asyncio.Lock()
31
32
 
32
- async def __aenter__(self: RedisPool) -> Redis:
33
+ async def __aenter__(self: Self) -> Redis:
33
34
  try:
34
35
  return Redis(connection_pool=self._pool)
35
36
  except Exception:
File without changes