tp-common 0.0.3__tar.gz → 0.0.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: tp-common
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary:
5
5
  Author: Developer
6
6
  Author-email: front-gold@mail.ru
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tp-common"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  description = ""
5
5
  authors = [
6
6
  {name = "Developer",email = "front-gold@mail.ru"}
@@ -66,6 +66,10 @@ follow_imports = "silent"
66
66
  module = "tp_common.logging"
67
67
  disable_error_code = ["import-untyped"]
68
68
 
69
+ [[tool.mypy.overrides]]
70
+ module = "tp_helper.*"
71
+ disable_error_code = ["import-untyped"]
72
+
69
73
  [tool.pyright]
70
74
  extraPaths = ["src"]
71
75
 
@@ -16,9 +16,9 @@ from aiohttp import (
16
16
  )
17
17
 
18
18
  from tp_common.base_client.exceptions import (
19
- BaseClientException,
20
19
  ClientConnectionException,
21
20
  ClientDNSException,
21
+ ClientException,
22
22
  ClientProxyException,
23
23
  ClientResponseErrorException,
24
24
  ClientTimeoutException,
@@ -471,7 +471,7 @@ class BaseClient:
471
471
  "response": response_body_text or "",
472
472
  },
473
473
  )
474
- raise BaseClientException(
474
+ raise ClientException(
475
475
  f"Неожиданная HTTP-ошибка: {str(e)}",
476
476
  url=url,
477
477
  ) from e
@@ -17,7 +17,6 @@ class ClientException(Exception):
17
17
  self.response_body = response_body
18
18
 
19
19
 
20
-
21
20
  class ClientResponseErrorException(ClientException):
22
21
  """Исключение при неуспешном HTTP статусе (>=400)."""
23
22
 
@@ -30,6 +29,7 @@ class ClientResponseErrorException(ClientException):
30
29
  ) -> None:
31
30
  super().__init__(message, url, status_code, response_body)
32
31
 
32
+
33
33
  class ClientConnectionException(ClientException):
34
34
  """Исключение при ошибке соединения (не удалось установить соединение)."""
35
35
 
@@ -40,6 +40,7 @@ class ClientConnectionException(ClientException):
40
40
  ) -> None:
41
41
  super().__init__(message, url)
42
42
 
43
+
43
44
  class ClientTimeoutException(ClientConnectionException):
44
45
  """Исключение при таймауте соединения."""
45
46
 
@@ -64,9 +65,6 @@ class ClientProxyException(ClientConnectionException):
64
65
  self.proxy = proxy
65
66
 
66
67
 
67
-
68
-
69
-
70
68
  class ClientDNSException(ClientConnectionException):
71
69
  """Исключение при ошибке DNS (не удалось разрешить доменное имя)."""
72
70
 
@@ -90,7 +88,7 @@ class ClientServerErrorException(ClientException):
90
88
  pass
91
89
 
92
90
 
93
- class BaseNetworkErrorException(ClientException):
91
+ class ClientNetworkErrorException(ClientException):
94
92
  """Базовое исключение для сетевых ошибок (таймауты, соединение, DNS)."""
95
93
 
96
94
  pass
@@ -1,3 +1,7 @@
1
+ from pydantic import BaseModel, ConfigDict
2
+ from pydantic.alias_generators import to_camel
3
+
4
+
1
5
  class BaseResponse(BaseModel):
2
6
  model_config = ConfigDict(
3
7
  alias_generator=to_camel,
File without changes