setech 1.8.2__tar.gz → 1.8.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.
- {setech-1.8.2 → setech-1.8.4}/PKG-INFO +2 -2
- {setech-1.8.2 → setech-1.8.4}/pyproject.toml +4 -4
- {setech-1.8.2 → setech-1.8.4}/src/setech/logging/logging.py +4 -2
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/parse.py +7 -3
- {setech-1.8.2 → setech-1.8.4}/LICENCE +0 -0
- {setech-1.8.2 → setech-1.8.4}/README.md +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/api_client/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/api_client/_base.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/api_client/async_client.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/api_client/sync_client.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/api_client/utils.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/constants/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/constants/date.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/constants.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/middleware/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/middleware/request_logging.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/models.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/rest_framework/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/rest_framework/fields.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/rest_framework/pagination.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/utils.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/django/validators.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/domain_mx_validator/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/domain_mx_validator/base.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/domain_mx_validator/memory.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/domain_mx_validator/redis.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/logging/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/logging/formatters.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/logging/handlers.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/py.typed +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/numeric.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/ssn/__init__.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/ssn/base.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/ssn/latvian.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/ssn/lithuanian.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/ssn/utils.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/text.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/time.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/validators.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/various.py +0 -0
- {setech-1.8.2 → setech-1.8.4}/src/setech/utils/warnings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: setech
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
4
4
|
Summary: Setech utilities
|
|
5
5
|
Keywords: api-client,logging,setech,utility,utils
|
|
6
6
|
Author: Eriks Karls
|
|
@@ -48,7 +48,7 @@ Requires-Dist: redis ; extra == 'dns-redis'
|
|
|
48
48
|
Requires-Dist: setech[dns] ; extra == 'dns-redis'
|
|
49
49
|
Requires-Dist: djangorestframework ; extra == 'drf'
|
|
50
50
|
Requires-Dist: setech[django] ; extra == 'drf'
|
|
51
|
-
Requires-Python: >=3.
|
|
51
|
+
Requires-Python: >=3.11
|
|
52
52
|
Project-URL: Homepage, https://pypi.org/project/setech/
|
|
53
53
|
Provides-Extra: django
|
|
54
54
|
Provides-Extra: dns
|
|
@@ -4,12 +4,12 @@ requires = [ "uv-build>=0.11.18,<0.12", "wheel" ]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "setech"
|
|
7
|
-
version = "1.8.
|
|
7
|
+
version = "1.8.4"
|
|
8
8
|
description = "Setech utilities"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
keywords = [ "api-client", "logging", "setech", "utility", "utils" ]
|
|
11
11
|
license = { file = "LICENCE" }
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
13
|
classifiers = [
|
|
14
14
|
"Development Status :: 5 - Production/Stable",
|
|
15
15
|
"Intended Audience :: Developers",
|
|
@@ -83,7 +83,7 @@ stubs = [
|
|
|
83
83
|
[tool.uv]
|
|
84
84
|
default-groups = "all"
|
|
85
85
|
[tool.uv.dependency-groups]
|
|
86
|
-
dev = { requires-python = ">=3.
|
|
86
|
+
dev = { requires-python = ">=3.11" }
|
|
87
87
|
[tool.uv.extra-build-dependencies]
|
|
88
88
|
setech = [ "uv.build" ]
|
|
89
89
|
[tool.uv.build-backend]
|
|
@@ -193,7 +193,7 @@ exclude = [
|
|
|
193
193
|
'^\.?venv/',
|
|
194
194
|
]
|
|
195
195
|
ignore_missing_imports = false
|
|
196
|
-
python_version = "3.
|
|
196
|
+
python_version = "3.11"
|
|
197
197
|
disallow_untyped_defs = true
|
|
198
198
|
implicit_optional = true
|
|
199
199
|
warn_redundant_casts = true
|
|
@@ -2,11 +2,13 @@ import logging
|
|
|
2
2
|
from logging import Logger
|
|
3
3
|
from typing import Any
|
|
4
4
|
|
|
5
|
+
from setech.utils import get_nonce
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
class NonceLogHelper:
|
|
7
|
-
def __init__(self, logger: Logger, nonce: str):
|
|
9
|
+
def __init__(self, logger: Logger, nonce: str | None = None) -> None:
|
|
8
10
|
self.logger = logger
|
|
9
|
-
self.nonce = nonce
|
|
11
|
+
self.nonce = nonce or get_nonce()
|
|
10
12
|
|
|
11
13
|
def _log(self, level: int, msg: str, *args: Any, **kwargs: Any) -> None:
|
|
12
14
|
msg = f"[{self.nonce}] {msg}"
|
|
@@ -61,8 +61,12 @@ class SetechJSONEncoder(json.JSONEncoder):
|
|
|
61
61
|
if isinstance(o, httpx2.Response):
|
|
62
62
|
try:
|
|
63
63
|
content = o.json()
|
|
64
|
-
except json.JSONDecodeError:
|
|
64
|
+
except (json.JSONDecodeError, UnicodeDecodeError):
|
|
65
65
|
content = o.text
|
|
66
|
+
try:
|
|
67
|
+
request_content = o.request.content.decode("utf-8")
|
|
68
|
+
except UnicodeDecodeError:
|
|
69
|
+
request_content = str(o.request.content)
|
|
66
70
|
return dict(
|
|
67
71
|
url=o.url,
|
|
68
72
|
status_code=o.status_code,
|
|
@@ -70,7 +74,7 @@ class SetechJSONEncoder(json.JSONEncoder):
|
|
|
70
74
|
request=dict(
|
|
71
75
|
method=o.request.method,
|
|
72
76
|
url=o.request.url,
|
|
73
|
-
content=shorten_value(
|
|
77
|
+
content=shorten_value(request_content),
|
|
74
78
|
),
|
|
75
79
|
content=shorten_value(content),
|
|
76
80
|
)
|
|
@@ -78,7 +82,7 @@ class SetechJSONEncoder(json.JSONEncoder):
|
|
|
78
82
|
try:
|
|
79
83
|
content = o.content.decode("utf8")
|
|
80
84
|
except UnicodeDecodeError:
|
|
81
|
-
content = o.content
|
|
85
|
+
content = str(o.content)
|
|
82
86
|
with contextlib.suppress(json.JSONDecodeError):
|
|
83
87
|
content = json.loads(content)
|
|
84
88
|
return dict(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|