hydra-structlog 0.2.0__tar.gz → 0.2.1__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.4
2
2
  Name: hydra-structlog
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: An opinionated hydra plugin to configure logging with structlog
5
5
  Keywords: hydra,structlog,plugin,hydra-zen
6
6
  Author: Sören Zapp
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hydra-structlog"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "An opinionated hydra plugin to configure logging with structlog"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -42,6 +42,7 @@ dev = [
42
42
  "nox>=2026.2.9",
43
43
  ]
44
44
  tests = [
45
+ "dirty-equals>=0.11",
45
46
  "pytest>=9.0.2",
46
47
  "pytest-cov>=7.1.0",
47
48
  "pytest-randomly>=4.0.1",
@@ -0,0 +1 @@
1
+ __version__ = "0.2.1"
@@ -1,16 +1,16 @@
1
1
  import logging
2
2
  from typing import Any, TextIO
3
3
 
4
- try:
4
+ try: # pragma: no cover
5
5
  from tqdm.std import tqdm as std_tqdm # type: ignore[ty:unresolved-import]
6
6
 
7
7
  TqdmClass = type[std_tqdm]
8
- except ImportError:
8
+ except ImportError: # pragma: no cover
9
9
  std_tqdm: Any = None
10
10
  TqdmClass = None
11
11
 
12
12
 
13
- class TqdmStreamHandler(logging.StreamHandler):
13
+ class TqdmStreamHandler(logging.StreamHandler): # pragma: no cover
14
14
  """Handler inheriting from StreamHandler to route logging stream through tqdm."""
15
15
 
16
16
  def __init__(
@@ -26,7 +26,7 @@ def warning_logger(
26
26
  frame = sys._getframe(2)
27
27
  module = frame.f_globals.get("__name__")
28
28
  logger = logging.getLogger(module)
29
- logger.warning("%s: %s", category.__name__, f"{message} (line {lineno})")
29
+ logger.warning("%s: %s (line %d)", category.__name__, message, lineno)
30
30
 
31
31
 
32
32
  def exception_logger(
@@ -56,7 +56,7 @@ def exception_logger(
56
56
  filename = frame.f_code.co_filename.replace(os.sep, "/")
57
57
  if filename.endswith(skip_files) and tb:
58
58
  exc_traceback = tb
59
- except Exception:
59
+ except Exception: # pragma: no cover
60
60
  pass
61
61
 
62
62
  message = getattr(exc_value, "message", str(exc_value))
@@ -64,7 +64,9 @@ def exception_logger(
64
64
  logger.critical(message, exc_info=exc_info)
65
65
 
66
66
 
67
- def init_plugin(foreign_pre_chain: Sequence[structlog.typing.Processor]) -> None:
67
+ def init_plugin(
68
+ foreign_pre_chain: Sequence[structlog.typing.Processor],
69
+ ) -> None: # pragma: no cover
68
70
  """Configure structlog and warning and exception hooks."""
69
71
  global _excepthook, _showwarning, _configured_once
70
72
 
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes