annotated-logger 1.2.4__tar.gz → 1.3.2__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,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: annotated-logger
3
- Version: 1.2.4
3
+ Version: 1.3.2
4
4
  Summary: A decorator that logs the start and end of a function as well as providing an optional logger with annotations
5
5
  Project-URL: Homepage, https://github.com/github/annotated-logger
6
6
  Author-email: Vuln Mgmt Eng <security+vulnmgmteng@github.com>
7
7
  License-Expression: MIT
8
8
  License-File: LICENSE.txt
9
9
  Keywords: annotation,decorator,logging
10
- Requires-Python: >=3.6
10
+ Requires-Python: >=3.10
11
11
  Requires-Dist: makefun
12
12
  Requires-Dist: pychoir
13
13
  Requires-Dist: python-json-logger>=3.1.0
@@ -31,7 +31,7 @@ Description-Content-Type: text/markdown
31
31
  Annotated Logger is actively used by GitHub's Vulnerability Management team to help to easily add context to our logs in splunk. It is more or less feature complete for our current use cases, but we will add additional features/fixes as we discover a need for them. But, we'd love feature requests, bug report and or PRs for either (see our [contribution guidelines][contribution] for more information if you wish to contribute).
32
32
 
33
33
  ## Requirements
34
- Annotated Logger is a Python package. It should work on any version of Python 3, but it is currently tested on 3.9 and higher.
34
+ Annotated Logger is a Python package. It should work on any version of Python 3, but it is currently tested on 3.10 and higher.
35
35
 
36
36
  ## Usage
37
37
 
@@ -15,7 +15,7 @@
15
15
  Annotated Logger is actively used by GitHub's Vulnerability Management team to help to easily add context to our logs in splunk. It is more or less feature complete for our current use cases, but we will add additional features/fixes as we discover a need for them. But, we'd love feature requests, bug report and or PRs for either (see our [contribution guidelines][contribution] for more information if you wish to contribute).
16
16
 
17
17
  ## Requirements
18
- Annotated Logger is a Python package. It should work on any version of Python 3, but it is currently tested on 3.9 and higher.
18
+ Annotated Logger is a Python package. It should work on any version of Python 3, but it is currently tested on 3.10 and higher.
19
19
 
20
20
  ## Usage
21
21
 
@@ -33,7 +33,7 @@ if TYPE_CHECKING: # pragma: no cover
33
33
  # https://test.pypi.org/project/annotated-logger/
34
34
  # The dev versions in testpypi can then be pulled in to whatever project needed
35
35
  # the new feature.
36
- VERSION = "1.2.4" # pragma: no mutate
36
+ VERSION = "1.3.2" # pragma: no mutate
37
37
 
38
38
  T = TypeVar("T")
39
39
  P = ParamSpec("P")
@@ -653,7 +653,7 @@ class AnnotatedLogger:
653
653
  # Between the overloads and the two inner method definitions,
654
654
  # there's not much I can do to reduce the complexity more.
655
655
  # So, ignoring the complexity metric
656
- def annotate_logs( # noqa: C901
656
+ def annotate_logs( # noqa: C901 PLR0915
657
657
  self,
658
658
  logger_name: str | None = None,
659
659
  *,
@@ -787,6 +787,11 @@ class AnnotatedLogger:
787
787
  if post_call and not post_call_attempted:
788
788
  _attempt_post_call(post_call, logger, *new_args, **new_kwargs) # pyright: ignore[reportCallIssue]
789
789
  raise
790
+ finally:
791
+ # Remove the logger now that we are done with it,
792
+ # otherwise they build up and eat memory
793
+ if not pre_execution_annotations:
794
+ logging.root.manager.loggerDict.pop(logger.logger.name, None)
790
795
  return result
791
796
 
792
797
  return wrap_function
@@ -8,7 +8,7 @@ dynamic = ["version"]
8
8
  description = "A decorator that logs the start and end of a function as well as providing an optional logger with annotations"
9
9
  readme = "README.md"
10
10
  license = "MIT"
11
- requires-python = ">=3.6"
11
+ requires-python = ">=3.10"
12
12
  authors = [
13
13
  { name = "Vuln Mgmt Eng", email = "security+vulnmgmteng@github.com" },
14
14
  ]
@@ -56,7 +56,6 @@ installer = "uv"
56
56
  pip-compile-resolver = "uv"
57
57
  dependencies = [
58
58
  "coverage",
59
- "mutmut",
60
59
  "pre-commit",
61
60
  "pyright",
62
61
  "pytest",
@@ -79,11 +78,6 @@ lint = "ruff check"
79
78
  exclude_also = ["@overload"]
80
79
  fail_under = 100
81
80
 
82
- [tool.mutmut]
83
- paths_to_mutate = "annotated_logger/"
84
- runner = "script/mutmut_runner"
85
- use_coverage = true
86
-
87
81
  [tool.pyright]
88
82
  include = ["annotated_logger", "example", "test"]
89
83
  reportMissingTypeArgument = true