Skip to content

Commit 18e976c

Browse files
authored
Merge pull request #27 from github/quick-fixes
Quick fixes
2 parents f859937 + 1b9b24a commit 18e976c

File tree

11 files changed

+83
-61
lines changed

11 files changed

+83
-61
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @github/vuln-mgmt-eng
1+
* @github/annotated-logger-reviewers

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.5.7
4+
rev: v0.8.2
55
hooks:
66
# Run the linter.
77
- id: ruff
88
# Run the formatter.
99
- id: ruff-format
1010
- repo: https://github.com/RobertCraigie/pyright-python
11-
rev: v1.1.382
11+
rev: v1.1.390
1212
hooks:
1313
- id: pyright
1414
# I don't love having to specify these here, but pre-commit only seems to work

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[contribution]: https://github.com/github/annotated-logger/blob/main/CONTRIBUTING.md
44

5-
[![Coverage badge](https://github.com/github/logger-decorator/raw/python-coverage-comment-action-data/badge.svg)](https://github.com/github/logger-decorator/tree/python-coverage-comment-action-data) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
5+
[![Coverage badge](https://github.com/github/annotated-logger/raw/python-coverage-comment-action-data/badge.svg)](https://github.com/github/annotated-logger/tree/python-coverage-comment-action-data) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
66

77
The `annotated-logger` package provides a decorator that can inject a annotatable logger object into a method or class. This logger object is a drop in replacement for `logging.logger` with additional functionality.
88

annotated_logger/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import logging.config
77
import time
88
import uuid
9+
from collections.abc import Iterator
910
from copy import copy, deepcopy
1011
from typing import (
1112
TYPE_CHECKING,
1213
Any,
1314
Callable,
1415
Concatenate,
15-
Iterator,
1616
Literal,
1717
ParamSpec,
1818
Protocol,

annotated_logger/mocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ def assert_logged(
234234
assert_logged.check(self)
235235

236236

237-
@pytest.fixture()
237+
@pytest.fixture
238238
def annotated_logger_object() -> logging.Logger:
239239
"""Logger to wrap with the `annotated_logger_mock` fixture."""
240240
return logging.getLogger("annotated_logger")
241241

242242

243-
@pytest.fixture()
243+
@pytest.fixture
244244
def annotated_logger_mock(annotated_logger_object: logging.Logger) -> AnnotatedLogMock:
245245
"""Fixture for a mock of the annotated logger."""
246246
handler = annotated_logger_object.handlers[0]

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ filterwarnings = [
102102
[tool.ruff]
103103
lint.select = ["ALL"]
104104
lint.ignore = [
105-
"ANN101",
106105
"D100", "D104",
107106
# Disabled as they conflict with the formatter:
108107
"W191", "E111", "E114", "E117", "D206", "D300", "Q000", "Q001", "Q002", "Q003", "COM812", "COM819", "ISC001", "ISC002",

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#
2-
# This file is autogenerated by hatch-pip-compile with Python 3.10
2+
# This file is autogenerated by hatch-pip-compile with Python 3.12
33
#
44
# - makefun
55
# - pychoir
66
# - python-json-logger
77
# - requests
88
#
99

10-
certifi==2024.7.4
10+
certifi==2024.8.30
1111
# via requests
12-
charset-normalizer==3.3.2
12+
charset-normalizer==3.4.0
1313
# via requests
14-
idna==3.7
14+
idna==3.10
1515
# via requests
16-
makefun==1.15.2
16+
makefun==1.15.6
1717
# via hatch.envs.default
1818
pychoir==0.0.27
1919
# via hatch.envs.default
2020
python-json-logger==2.0.7
2121
# via hatch.envs.default
2222
requests==2.32.3
2323
# via hatch.envs.default
24-
urllib3==2.2.2
24+
urllib3==2.2.3
2525
# via requests

requirements/requirements-dev.txt

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,105 +20,128 @@
2020
# - requests
2121
#
2222

23-
certifi==2024.7.4
23+
certifi==2024.8.30
2424
# via requests
2525
cfgv==3.4.0
2626
# via pre-commit
27-
charset-normalizer==3.3.2
27+
charset-normalizer==3.4.0
2828
# via requests
2929
click==8.1.7
3030
# via mutmut
31-
coverage==7.5.4
31+
coverage==7.6.9
3232
# via
3333
# hatch.envs.dev
3434
# pytest-cov
35-
distlib==0.3.8
35+
distlib==0.3.9
3636
# via virtualenv
37-
exceptiongroup==1.2.1
37+
exceptiongroup==1.2.2
3838
# via pytest
39-
filelock==3.15.4
39+
filelock==3.16.1
4040
# via virtualenv
4141
freezegun==1.5.1
4242
# via pytest-freezer
43-
glob2==0.7
44-
# via mutmut
45-
identify==2.5.36
43+
identify==2.6.3
4644
# via pre-commit
47-
idna==3.7
45+
idna==3.10
4846
# via requests
4947
iniconfig==2.0.0
5048
# via pytest
51-
junit-xml==1.9
49+
junit-xml==1.8
5250
# via mutmut
53-
makefun==1.15.2
51+
linkify-it-py==2.0.3
52+
# via markdown-it-py
53+
makefun==1.15.6
5454
# via hatch.envs.dev
55-
mutmut==2.5.0
55+
markdown-it-py==3.0.0
56+
# via
57+
# mdit-py-plugins
58+
# rich
59+
# textual
60+
mdit-py-plugins==0.4.2
61+
# via markdown-it-py
62+
mdurl==0.1.2
63+
# via markdown-it-py
64+
mutmut==3.2.2
5665
# via hatch.envs.dev
5766
nodeenv==1.9.1
5867
# via
5968
# pre-commit
6069
# pyright
61-
packaging==24.1
70+
packaging==24.2
6271
# via pytest
6372
parso==0.8.4
6473
# via mutmut
65-
platformdirs==4.2.2
66-
# via virtualenv
74+
platformdirs==4.3.6
75+
# via
76+
# textual
77+
# virtualenv
6778
pluggy==1.5.0
6879
# via pytest
69-
pony==0.7.17
70-
# via mutmut
71-
pre-commit==3.7.1
80+
pre-commit==4.0.1
7281
# via hatch.envs.dev
7382
pychoir==0.0.27
7483
# via hatch.envs.dev
75-
pyright==1.1.376
84+
pygments==2.18.0
85+
# via rich
86+
pyright==1.1.390
7687
# via hatch.envs.dev
77-
pytest==8.2.2
88+
pytest==8.3.4
7889
# via
7990
# hatch.envs.dev
8091
# pytest-cov
8192
# pytest-freezer
8293
# pytest-github-actions-annotate-failures
8394
# pytest-mock
8495
# pytest-randomly
85-
pytest-cov==5.0.0
96+
pytest-cov==6.0.0
8697
# via hatch.envs.dev
8798
pytest-freezer==0.4.8
8899
# via hatch.envs.dev
89100
pytest-github-actions-annotate-failures==0.2.0
90101
# via hatch.envs.dev
91102
pytest-mock==3.14.0
92103
# via hatch.envs.dev
93-
pytest-randomly==3.15.0
104+
pytest-randomly==3.16.0
94105
# via hatch.envs.dev
95106
python-dateutil==2.9.0.post0
96107
# via freezegun
97108
python-json-logger==2.0.7
98109
# via hatch.envs.dev
99-
pyyaml==6.0.1
110+
pyyaml==6.0.2
100111
# via pre-commit
101112
requests==2.32.3
102113
# via
103114
# hatch.envs.dev
104115
# requests-mock
105116
requests-mock==1.12.1
106117
# via hatch.envs.dev
107-
ruff==0.5.7
118+
rich==13.9.4
119+
# via textual
120+
ruff==0.8.2
108121
# via hatch.envs.dev
109-
six==1.16.0
122+
setproctitle==1.3.4
123+
# via mutmut
124+
six==1.17.0
110125
# via
111126
# junit-xml
112127
# python-dateutil
128+
textual==0.89.1
129+
# via mutmut
113130
toml==0.10.2
114131
# via mutmut
115-
tomli==2.0.1
132+
tomli==2.2.1
116133
# via
117134
# coverage
118135
# pytest
119136
typing-extensions==4.12.2
120-
# via hatch.envs.dev
121-
urllib3==2.2.2
137+
# via
138+
# hatch.envs.dev
139+
# pyright
140+
# rich
141+
# textual
142+
uc-micro-py==1.0.3
143+
# via linkify-it-py
144+
urllib3==2.2.3
122145
# via requests
123-
virtualenv==20.26.3
146+
virtualenv==20.28.0
124147
# via pre-commit

test/conftest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
pytest_plugins = ["annotated_logger.mocks"]
1717

1818

19-
@pytest.fixture()
19+
@pytest.fixture
2020
def fail_mock(mocker):
2121
return mocker.patch("annotated_logger.mocks.pytest.fail")
2222

@@ -27,26 +27,26 @@ def fail_mock(mocker):
2727
# logging config, as it gets clobbered by the most recently imported module
2828
# This is a more complete solution than using `pytest-forked` which only
2929
# fixed the issue if the test file didn't import more than one that conflicted
30-
@pytest.fixture()
30+
@pytest.fixture
3131
def _reload_api():
3232
importlib.reload(example.api)
3333

3434

35-
@pytest.fixture()
35+
@pytest.fixture
3636
def _reload_calculator():
3737
importlib.reload(example.calculator)
3838

3939

40-
@pytest.fixture()
40+
@pytest.fixture
4141
def _reload_default():
4242
importlib.reload(example.default)
4343

4444

45-
@pytest.fixture()
45+
@pytest.fixture
4646
def _reload_actions():
4747
importlib.reload(example.actions)
4848

4949

50-
@pytest.fixture()
50+
@pytest.fixture
5151
def _reload_logging_config():
5252
importlib.reload(example.logging_config)

test/test_logging_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from annotated_logger.mocks import AnnotatedLogMock
77

88

9-
@pytest.fixture()
9+
@pytest.fixture
1010
def annotated_logger_object():
1111
return logging.getLogger("annotated_logger.logging_config")
1212

test/test_plugins.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def filter(self, _record: logging.LogRecord) -> bool:
3737
raise SpyPlugin.BoomError
3838

3939

40-
@pytest.fixture()
40+
@pytest.fixture
4141
def annotated_logger(plugins):
4242
return AnnotatedLogger(
4343
plugins=plugins,
@@ -49,41 +49,41 @@ def annotated_logger(plugins):
4949
)
5050

5151

52-
@pytest.fixture()
52+
@pytest.fixture
5353
def plugins():
5454
return []
5555

5656

57-
@pytest.fixture()
57+
@pytest.fixture
5858
def annotate_logs(annotated_logger):
5959
return annotated_logger.annotate_logs
6060

6161

62-
@pytest.fixture()
62+
@pytest.fixture
6363
def broken_plugin():
6464
return SpyPlugin(working=False)
6565

6666

67-
@pytest.fixture()
67+
@pytest.fixture
6868
def working_plugin():
6969
return SpyPlugin(working=True)
7070

7171

72-
@pytest.fixture()
72+
@pytest.fixture
7373
def skip_plugin():
7474
return SpyPlugin(filter_message=True)
7575

7676

7777
# Request the annotated_logger fixture so that the config
7878
# has been setup before we get the logger
79-
@pytest.fixture()
79+
@pytest.fixture
8080
def annotated_logger_object(annotated_logger): # noqa: ARG001
8181
return logging.getLogger("annotated_logger")
8282

8383

8484
class TestPlugins:
8585
class TestSkip:
86-
@pytest.fixture()
86+
@pytest.fixture
8787
def plugins(self, skip_plugin):
8888
return [skip_plugin]
8989

@@ -99,7 +99,7 @@ def should_work():
9999
assert annotated_logger_mock.records == []
100100

101101
class TestWorking:
102-
@pytest.fixture()
102+
@pytest.fixture
103103
def plugins(self, working_plugin):
104104
return [working_plugin]
105105

@@ -128,7 +128,7 @@ def throws_exception():
128128
assert working_plugin.exception_triggered is True
129129

130130
class TestBroken:
131-
@pytest.fixture()
131+
@pytest.fixture
132132
def plugins(self, broken_plugin, working_plugin):
133133
return [broken_plugin, working_plugin, broken_plugin]
134134

0 commit comments

Comments
 (0)