Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Oct 8, 2024
1 parent bac6a16 commit 4a87aba
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
7 changes: 4 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Setup for test suite."""
"""
Setup for test suite.
"""

import uuid
from collections.abc import Generator
Expand All @@ -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.
"""
Expand Down
4 changes: 3 additions & 1 deletion docs/source/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
"""Documentation."""
"""
Documentation.
"""
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
"""Configuration for Sphinx."""
"""
Configuration for Sphinx.
"""

import importlib.metadata

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions src/vws_auth_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Authorization helpers."""
"""
Authorization helpers.
"""

import base64
import email.utils
Expand All @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
"""Tests for authorization tools."""
"""
Tests for authorization tools.
"""
8 changes: 5 additions & 3 deletions tests/test_vws_auth_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Tests for authorization tools."""
"""
Tests for authorization tools.
"""

import datetime
from zoneinfo import ZoneInfo
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 4a87aba

Please sign in to comment.