From 4a87aba1fdde6808db4d9ebf61c66586177aad61 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:35:37 +0000 Subject: [PATCH] [pre-commit.ci lite] apply automatic fixes --- conftest.py | 7 ++++--- docs/source/__init__.py | 4 +++- docs/source/conf.py | 4 +++- pyproject.toml | 2 +- src/vws_auth_tools/__init__.py | 8 ++++++-- tests/__init__.py | 4 +++- tests/test_vws_auth_tools.py | 8 +++++--- 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/conftest.py b/conftest.py index 8ae02548..b73b4e5c 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,6 @@ -"""Setup for test suite.""" +""" +Setup for test suite. +""" import uuid from collections.abc import Generator @@ -20,8 +22,7 @@ def fixture_mock_vws( monkeypatch: pytest.MonkeyPatch, ) -> Generator[None]: - """ - Yield a mock VWS. + """Yield a mock VWS. The keys used here match the keys in the documentation. """ diff --git a/docs/source/__init__.py b/docs/source/__init__.py index 535ceb2e..b63eed5f 100644 --- a/docs/source/__init__.py +++ b/docs/source/__init__.py @@ -1 +1,3 @@ -"""Documentation.""" +""" +Documentation. +""" diff --git a/docs/source/conf.py b/docs/source/conf.py index 231d3704..b0c3de09 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 -"""Configuration for Sphinx.""" +""" +Configuration for Sphinx. +""" import importlib.metadata diff --git a/pyproject.toml b/pyproject.toml index d7eed351..e389d9fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ optional-dependencies.dev = [ "deptry==0.20.0", "doc8==1.1.2", "doccmd==2024.10.8.12", + "docformatter==1.7.5", "freezegun==1.5.1", "furo==2024.8.6", "interrogate==1.7.0", @@ -67,7 +68,6 @@ optional-dependencies.dev = [ "types-requests==2.32.0.20240914", "vulture==2.13", "vws-python-mock==2024.8.30", - "docformatter==1.7.5", ] optional-dependencies.release = [ "check-wheel-contents==0.6.0" ] urls.Source = "https://github.com/VWS-Python/vws-auth-tools" diff --git a/src/vws_auth_tools/__init__.py b/src/vws_auth_tools/__init__.py index 633329a2..ec8f91f4 100644 --- a/src/vws_auth_tools/__init__.py +++ b/src/vws_auth_tools/__init__.py @@ -1,4 +1,6 @@ -"""Authorization helpers.""" +""" +Authorization helpers. +""" import base64 import email.utils @@ -10,7 +12,9 @@ @beartype def _compute_hmac_base64(key: bytes, data: bytes) -> bytes: - """Return the Base64 encoded HMAC-SHA1 hash of `data` using the `key`.""" + """ + Return the Base64 encoded HMAC-SHA1 hash of `data` using the `key`. + """ hashed = hmac.new(key=key, msg=None, digestmod=hashlib.sha1) hashed.update(msg=data) return base64.b64encode(s=hashed.digest()) diff --git a/tests/__init__.py b/tests/__init__.py index 3640385e..650d7b1a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,3 @@ -"""Tests for authorization tools.""" +""" +Tests for authorization tools. +""" diff --git a/tests/test_vws_auth_tools.py b/tests/test_vws_auth_tools.py index 7e273022..695db294 100644 --- a/tests/test_vws_auth_tools.py +++ b/tests/test_vws_auth_tools.py @@ -1,4 +1,6 @@ -"""Tests for authorization tools.""" +""" +Tests for authorization tools. +""" import datetime from zoneinfo import ZoneInfo @@ -42,8 +44,8 @@ def test_rfc_1123_date() -> None: def test_authorization_header(content: bytes | str) -> None: """The Authorization header is constructed as documented. - This example has been run on known-working code and so any refactor should - continue to pass this test. + This example has been run on known-working code and so any refactor + should continue to pass this test. """ access_key = "my_access_key" # Ignore "Possible hardcoded password" as it is appropriate here.