From 921a8bacc6ee3fadac337e2931129aae09846187 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 13 Dec 2024 14:44:49 +0100 Subject: [PATCH] fix: turn on deprecation warning and upgrade jsonlogger (#88) --- daiquiri/formatter.py | 4 ++-- pyproject.toml | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/daiquiri/formatter.py b/daiquiri/formatter.py index 0a8970a..2d616a8 100644 --- a/daiquiri/formatter.py +++ b/daiquiri/formatter.py @@ -14,7 +14,7 @@ import logging import typing -from pythonjsonlogger import jsonlogger +from pythonjsonlogger import json as jsonlogger from daiquiri import types @@ -157,7 +157,7 @@ def format(self, record: logging.LogRecord) -> str: return s -class DatadogFormatter(jsonlogger.JsonFormatter): # type: ignore[misc] +class DatadogFormatter(jsonlogger.JsonFormatter): def __init__(self) -> None: super(DatadogFormatter, self).__init__(timestamp=True) diff --git a/pyproject.toml b/pyproject.toml index 9071380..71dfe17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] dependencies = [ - "python-json-logger" + "python-json-logger >= 3" ] [project.urls] @@ -55,4 +55,10 @@ strict = true module = [ "systemd", ] -ignore_missing_imports = true \ No newline at end of file +ignore_missing_imports = true + +[tool.pytest.ini_options] +filterwarnings = [ + "error::DeprecationWarning", +] +testpaths = ["daiquiri/tests"]