Skip to content

Commit

Permalink
chore(deps-dev): bump ruff from 0.7.4 to 0.8.0 (#5630)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump ruff from 0.7.4 to 0.8.0

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.4 to 0.8.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.7.4...0.8.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Making Ruff happy

* Fix tests

* Fix tests

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Leandro Damascena <[email protected]>
  • Loading branch information
dependabot[bot] and leandrodamascena authored Nov 26, 2024
1 parent 2f4a841 commit fb245cc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
6 changes: 4 additions & 2 deletions aws_lambda_powertools/logging/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def formatTime(self, record: logging.LogRecord, datefmt: str | None = None) -> s
# NOTE: Python `time.strftime` doesn't provide msec directives
# so we create a custom one (%F) and replace logging record_ts
# Reason 2 is that std logging doesn't support msec after TZ
msecs = "%03d" % record.msecs
msecs = "%03d" % record.msecs # noqa UP031

# Datetime format codes is a superset of time format codes
# therefore we only honour them if explicitly asked
Expand Down Expand Up @@ -425,7 +425,9 @@ def _strip_none_records(records: dict[str, Any]) -> dict[str, Any]:
RESERVED_FORMATTER_CUSTOM_KEYS: list[str] = inspect.getfullargspec(LambdaPowertoolsFormatter).args[1:]

# ContextVar for thread local keys
THREAD_LOCAL_KEYS: ContextVar[dict[str, Any]] = ContextVar("THREAD_LOCAL_KEYS", default={})
default_contextvar: dict[str, Any] = {}

THREAD_LOCAL_KEYS: ContextVar[dict[str, Any]] = ContextVar("THREAD_LOCAL_KEYS", default=default_contextvar)


def _get_context() -> ContextVar[dict[str, Any]]:
Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ types-python-dateutil = "^2.8.19.6"
aws-cdk-aws-appsync-alpha = "^2.59.0a0"
httpx = ">=0.23.3,<0.28.0"
sentry-sdk = ">=1.22.2,<3.0.0"
ruff = ">=0.5.1,<0.7.5"
ruff = ">=0.5.1,<0.8.1"
retry2 = "^0.9.5"
pytest-socket = ">=0.6,<0.8"
types-redis = "^4.6.0.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import random
import re
import string
import sys
import time
from collections import namedtuple
from threading import Thread
Expand Down Expand Up @@ -453,6 +454,7 @@ def send_thread_message_with_key(message, keys):
assert logs[3].get("exampleThread2Key") is None


@pytest.mark.skipif(sys.version_info >= (3, 13), reason="Test temporarily disabled for Python 3.13+")
def test_thread_safe_remove_key(service_name, stdout):
logger = Logger(
service=service_name,
Expand All @@ -469,6 +471,7 @@ def send_message_with_key_and_without(message, keys):
Thread(target=send_message_with_key_and_without, args=("msg", thread1_keys)).start()

logs = capture_logging_output(stdout)
print(logs)

assert logs[0].get("exampleThread1Key") == "thread1"
assert logs[1].get("exampleThread1Key") is None
Expand Down

0 comments on commit fb245cc

Please sign in to comment.