From 751bf57244a9f07d19ca075e00574dbd342beea5 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Fri, 2 Aug 2024 10:52:26 -0400 Subject: [PATCH] Run all pre-commit hooks for the first time --- gcn_classic_to_kafka/cli.py | 5 ++--- gcn_classic_to_kafka/metrics.py | 1 + gcn_classic_to_kafka/socket.py | 4 ++-- gcn_classic_to_kafka/test/test_socket.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcn_classic_to_kafka/cli.py b/gcn_classic_to_kafka/cli.py index b8efc8e..0c01c29 100644 --- a/gcn_classic_to_kafka/cli.py +++ b/gcn_classic_to_kafka/cli.py @@ -9,17 +9,16 @@ import asyncio import logging -import urllib import signal import sys +import urllib import click import gcn_kafka import prometheus_client +from . import heartbeat, metrics from .socket import client_connected -from . import heartbeat -from . import metrics log = logging.getLogger(__name__) diff --git a/gcn_classic_to_kafka/metrics.py b/gcn_classic_to_kafka/metrics.py index 759becb..692a8d6 100644 --- a/gcn_classic_to_kafka/metrics.py +++ b/gcn_classic_to_kafka/metrics.py @@ -6,6 +6,7 @@ # SPDX-License-Identifier: Apache-2.0 # """Prometheus metrics.""" + import prometheus_client connected = prometheus_client.Gauge( diff --git a/gcn_classic_to_kafka/socket.py b/gcn_classic_to_kafka/socket.py index 0731355..3fe3fd5 100644 --- a/gcn_classic_to_kafka/socket.py +++ b/gcn_classic_to_kafka/socket.py @@ -6,6 +6,7 @@ # SPDX-License-Identifier: Apache-2.0 # """Protocol handler for GCN socket connection.""" + import asyncio import logging import struct @@ -14,8 +15,8 @@ import gcn import lxml.etree -from .common import notice_type_int_to_str, topic_for_notice_type_str from . import metrics +from .common import notice_type_int_to_str, topic_for_notice_type_str log = logging.getLogger(__name__) @@ -29,7 +30,6 @@ def client_connected(producer: confluent_kafka.Producer, timeout: float = 90): - async def client_connected_cb( reader: asyncio.StreamReader, writer: asyncio.StreamWriter ): diff --git a/gcn_classic_to_kafka/test/test_socket.py b/gcn_classic_to_kafka/test/test_socket.py index 7bd7109..db0d257 100644 --- a/gcn_classic_to_kafka/test/test_socket.py +++ b/gcn_classic_to_kafka/test/test_socket.py @@ -6,8 +6,8 @@ # SPDX-License-Identifier: Apache-2.0 # import asyncio -from unittest import mock import struct +from unittest import mock import gcn import pytest