From fda1fc6ba46301f8c495518c06543858ea8499e9 Mon Sep 17 00:00:00 2001 From: Argyrios Samourkasidis Date: Sun, 22 Oct 2023 19:47:03 +0200 Subject: [PATCH] Fix lint issues - Sort imports --- prometheus_aioexporter/script.py | 15 +++++++-------- tests/script_test.py | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/prometheus_aioexporter/script.py b/prometheus_aioexporter/script.py index f843bf6..49519bd 100644 --- a/prometheus_aioexporter/script.py +++ b/prometheus_aioexporter/script.py @@ -1,14 +1,12 @@ """Run a web server providing a Prometheus metrics endpoint.""" import argparse +from collections.abc import Iterable import logging import ssl -import sys -from collections.abc import Iterable from ssl import SSLContext -from typing import ( - IO, -) +import sys +from typing import IO from aiohttp.web import Application from prometheus_client import ( @@ -40,7 +38,8 @@ class PrometheusExporterScript(Script): # type: ignore registry: MetricsRegistry def __init__( - self, stdout: IO[bytes] | None = None, stderr: IO[bytes] | None = None + self, stdout: IO[bytes] | None = None, + stderr: IO[bytes] | None = None ) -> None: super().__init__(stdout=stdout, stderr=stderr) self.registry = MetricsRegistry() @@ -60,7 +59,7 @@ def logger(self) -> logging.Logger: return logging.getLogger(name=self.name) def configure_argument_parser( - self, parser: argparse.ArgumentParser + self, parser: argparse.ArgumentParser ) -> None: """Add configuration to the ArgumentParser. @@ -97,7 +96,7 @@ def configure(self, args: argparse.Namespace) -> None: """ def create_metrics( - self, metric_configs: Iterable[MetricConfig] + self, metric_configs: Iterable[MetricConfig] ) -> dict[str, Metric]: """Create and register metrics from a list of MetricConfigs.""" return self.registry.create_metrics(metric_configs) diff --git a/tests/script_test.py b/tests/script_test.py index ae03e48..32bbe2f 100644 --- a/tests/script_test.py +++ b/tests/script_test.py @@ -1,5 +1,5 @@ -import logging from io import StringIO +import logging from ssl import SSLContext from unittest import mock