From 1c907c59f06a1def3aa7b4695d49db45cfa89b23 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 17:32:14 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.6.7 → v0.11.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.7...v0.11.7) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.15.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.15.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59110ee..2be38d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ # * Run "pre-commit install". repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-toml - id: check-yaml @@ -16,14 +16,14 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.7 + rev: v0.11.7 hooks: - id: ruff args: [--fix, --show-fixes] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: From 8e373237da3b4d19eaf7275075d2ebd86d1deead Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 17:32:42 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cbor2/_encoder.py | 2 +- tests/test_encoder.py | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cbor2/_encoder.py b/cbor2/_encoder.py index b92e098..02d968f 100644 --- a/cbor2/_encoder.py +++ b/cbor2/_encoder.py @@ -507,7 +507,7 @@ def encode_datetime(self, value: datetime) -> None: value = value.replace(tzinfo=self._timezone) else: raise CBOREncodeValueError( - f"naive datetime {value!r} encountered and no default timezone " "has been set" + f"naive datetime {value!r} encountered and no default timezone has been set" ) if self.datetime_as_timestamp: diff --git a/tests/test_encoder.py b/tests/test_encoder.py index f2ef248..e8b8437 100644 --- a/tests/test_encoder.py +++ b/tests/test_encoder.py @@ -622,16 +622,7 @@ def test_encode_stringrefs_array(impl): def test_encode_stringrefs_dict(impl): value = {"aaaa": "mmmm", "bbbb": "bbbb", "cccc": "aaaa", "mmmm": "aaaa"} expected = unhexlify( - "d90100" - "a4" - "6461616161" - "646d6d6d6d" - "6462626262" - "d81902" - "6463636363" - "d81900" - "d81901" - "d81900" + "d90100a46461616161646d6d6d6d6462626262d819026463636363d81900d81901d81900" ) assert impl.dumps(value, string_referencing=True, canonical=True) == expected