python3-commons 0.7.4__py3-none-any.whl → 0.7.5__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.
@@ -1,12 +1,13 @@
1
1
  import logging
2
2
  from contextlib import asynccontextmanager
3
3
  from datetime import datetime, UTC
4
+ from enum import Enum
4
5
  from http import HTTPStatus
5
6
  from json import dumps
6
7
  from typing import AsyncGenerator, Literal, Mapping, Sequence
7
8
  from uuid import uuid4
8
9
 
9
- from aiohttp import ClientResponse, ClientSession, client_exceptions
10
+ from aiohttp import ClientResponse, ClientSession, client_exceptions, ClientTimeout
10
11
  from pydantic import HttpUrl
11
12
 
12
13
  from python3_commons import audit
@@ -49,6 +50,7 @@ async def request(
49
50
  headers: Mapping | None = None,
50
51
  json: Mapping | Sequence | str | None = None,
51
52
  data: bytes | None = None,
53
+ timeout: ClientTimeout | Enum | None = None,
52
54
  audit_name: str | None = None
53
55
  ) -> AsyncGenerator[ClientResponse]:
54
56
  now = datetime.now(tz=UTC)
@@ -80,7 +82,7 @@ async def request(
80
82
 
81
83
  try:
82
84
  if method == 'get':
83
- async with client_method(url, params=query, headers=headers) as response:
85
+ async with client_method(url, params=query, headers=headers, timeout=timeout) as response:
84
86
  if audit_name:
85
87
  await _store_response_for_audit(response, audit_name, uri_path, method, request_id)
86
88
 
@@ -107,7 +109,7 @@ async def request(
107
109
  else:
108
110
  headers = {'Content-Type': 'application/json'}
109
111
 
110
- async with client_method(url, params=query, data=data, headers=headers) as response:
112
+ async with client_method(url, params=query, data=data, headers=headers, timeout=timeout) as response:
111
113
  if audit_name:
112
114
  await _store_response_for_audit(response, audit_name, uri_path, method, request_id)
113
115
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: python3-commons
3
- Version: 0.7.4
3
+ Version: 0.7.5
4
4
  Summary: Re-usable Python3 code
5
5
  Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
6
6
  License: gpl-3
@@ -12,7 +12,7 @@ Requires-Python: >=3.13
12
12
  Description-Content-Type: text/x-rst
13
13
  License-File: LICENSE
14
14
  License-File: AUTHORS.rst
15
- Requires-Dist: aiohttp[speedups]~=3.11.13
15
+ Requires-Dist: aiohttp[speedups]~=3.11.14
16
16
  Requires-Dist: asyncpg~=0.30.0
17
17
  Requires-Dist: fastapi-users-db-sqlalchemy~=7.0.0
18
18
  Requires-Dist: fastapi-users[sqlalchemy]~=14.0.1
@@ -22,7 +22,7 @@ Requires-Dist: msgpack~=1.1.0
22
22
  Requires-Dist: msgspec~=0.19.0
23
23
  Requires-Dist: pydantic[email]~=2.10.6
24
24
  Requires-Dist: pydantic-settings~=2.8.1
25
- Requires-Dist: SQLAlchemy[asyncio]~=2.0.38
25
+ Requires-Dist: SQLAlchemy[asyncio]~=2.0.39
26
26
  Requires-Dist: zeep~=4.3.1
27
27
  Provides-Extra: testing
28
28
  Requires-Dist: pytest; extra == "testing"
@@ -1,5 +1,5 @@
1
1
  python3_commons/__init__.py,sha256=0KgaYU46H_IMKn-BuasoRN3C4Hi45KlkHHoPbU9cwiA,189
2
- python3_commons/api_client.py,sha256=6F99vSGCV8pqcKJE9dECijlgggm40FB9TzkFZRgwDq4,4419
2
+ python3_commons/api_client.py,sha256=zj6zTF-DhUMu4bjj9VWLi63mVODG_SB47Q5qlmG-Sxg,4539
3
3
  python3_commons/audit.py,sha256=DMQ-nrWSs0qilD7wkz_8PV4jXcee75O8FgAm2YIuOiY,6256
4
4
  python3_commons/conf.py,sha256=GAcjlFlloLriZXa9JmNGMtTPzvtHUActYDiE4C1DacU,749
5
5
  python3_commons/fs.py,sha256=wfLjybXndwLqNlOxTpm_HRJnuTcC4wbrHEOaEeCo9Wc,337
@@ -19,9 +19,9 @@ python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
19
19
  python3_commons/serializers/json.py,sha256=P288wWz9ic38QWEMrpp_uwKPYkQiOgvE1cI4WZn6ZCg,808
20
20
  python3_commons/serializers/msgpack.py,sha256=tzIGGyDL3UpZnnouCtnxuYDx6InKM_C3PP1N4PN8wd4,1269
21
21
  python3_commons/serializers/msgspec.py,sha256=FuZVqOLJb0-lEKrs7dtjhwEbHIpfMUk5yu1hD64zRdc,2038
22
- python3_commons-0.7.4.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
23
- python3_commons-0.7.4.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
24
- python3_commons-0.7.4.dist-info/METADATA,sha256=Vc9pCf8LuvYC2PurIjha_1x39yC8pyX_vKwH8mG9PgU,1127
25
- python3_commons-0.7.4.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
26
- python3_commons-0.7.4.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
27
- python3_commons-0.7.4.dist-info/RECORD,,
22
+ python3_commons-0.7.5.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
23
+ python3_commons-0.7.5.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
24
+ python3_commons-0.7.5.dist-info/METADATA,sha256=hHvrO14nJy917lS-gySmCIGJ5kc-6X4Bf7Zq8EHbgTo,1127
25
+ python3_commons-0.7.5.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
26
+ python3_commons-0.7.5.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
27
+ python3_commons-0.7.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5