From 0da27224ad800297c4d120e740e1ba263da0327a Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Wed, 20 Nov 2024 11:02:33 +0100 Subject: [PATCH] Changes from `ruff`. (#267) --- .pre-commit-config.yaml | 4 ++-- mocket/socket.py | 3 --- mocket/utils.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eae15d12..74e4cdae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: forbid-crlf - id: remove-crlf - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -15,7 +15,7 @@ repos: exclude: helm/ args: [ --unsafe ] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.7.4" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/mocket/socket.py b/mocket/socket.py index e79c86c8..03c6f7e5 100644 --- a/mocket/socket.py +++ b/mocket/socket.py @@ -7,8 +7,6 @@ import os import select import socket -import ssl -from datetime import datetime, timedelta from json.decoder import JSONDecodeError from types import TracebackType from typing import Any, Type @@ -25,7 +23,6 @@ Address, ReadableBuffer, WriteableBuffer, - _PeerCertRetDictType, _RetAddress, ) from mocket.utils import hexdump, hexload diff --git a/mocket/utils.py b/mocket/utils.py index 52777687..b9e2c259 100644 --- a/mocket/utils.py +++ b/mocket/utils.py @@ -10,7 +10,7 @@ from mocket.io import MocketSocketIO as MocketSocketCore # NOTE this is here for backwards-compat to keep old import-paths working -from mocket.mode import MocketMode as MocketMode +from mocket.mode import MocketMode SSL_PROTOCOL = ssl.PROTOCOL_TLSv1_2 @@ -42,3 +42,13 @@ def get_mocketize(wrapper_: Callable) -> Callable: wrapper_, kwsyntax=True, ) + + +__all__ = ( + "MocketSocketCore", + "MocketMode", + "SSL_PROTOCOL", + "hexdump", + "hexload", + "get_mocketize", +)