From 09ddea939ccc4a17f869b54d11cced2852576e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 15 Nov 2023 11:22:00 +0100 Subject: [PATCH] order imports with isort --- pyproject.toml | 3 +++ src/capport/api/app_cls.py | 2 -- src/capport/api/proxy_fix.py | 1 - src/capport/api/setup.py | 1 - src/capport/api/views.py | 1 - src/capport/comm/hub.py | 1 - src/capport/comm/message.pyi | 3 ++- src/capport/config.py | 1 - src/capport/database.py | 1 - src/capport/utils/nft_socket.py | 1 - src/capport/utils/zoneinfo.py | 1 - 11 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b53bc37..6add2c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,3 +17,6 @@ exclude = [ line-length = 120 target-version = ['py311'] exclude = '_pb2.py' + +[tool.isort] +profile = "black" diff --git a/src/capport/api/app_cls.py b/src/capport/api/app_cls.py index cedc52b..2676628 100644 --- a/src/capport/api/app_cls.py +++ b/src/capport/api/app_cls.py @@ -5,9 +5,7 @@ import os.path import typing import jinja2 - import quart.templating - import quart_trio import capport.comm.hub diff --git a/src/capport/api/proxy_fix.py b/src/capport/api/proxy_fix.py index 4f14a05..e6121a3 100644 --- a/src/capport/api/proxy_fix.py +++ b/src/capport/api/proxy_fix.py @@ -4,7 +4,6 @@ import ipaddress import typing import quart - import werkzeug from werkzeug.http import parse_list_header diff --git a/src/capport/api/setup.py b/src/capport/api/setup.py index 76ab1bd..8100ad7 100644 --- a/src/capport/api/setup.py +++ b/src/capport/api/setup.py @@ -14,7 +14,6 @@ from capport.utils.sd_notify import open_sdnotify from .app import app - _logger = logging.getLogger(__name__) diff --git a/src/capport/api/views.py b/src/capport/api/views.py index 706e0bd..c2811ca 100644 --- a/src/capport/api/views.py +++ b/src/capport/api/views.py @@ -4,7 +4,6 @@ import ipaddress import logging import quart - import trio import capport.comm.hub diff --git a/src/capport/comm/hub.py b/src/capport/comm/hub.py index f1eaf74..b472b98 100644 --- a/src/capport/comm/hub.py +++ b/src/capport/comm/hub.py @@ -15,7 +15,6 @@ import trio import capport.comm.message import capport.database - if typing.TYPE_CHECKING: from ..config import Config diff --git a/src/capport/comm/message.pyi b/src/capport/comm/message.pyi index ada2975..5e4ff18 100644 --- a/src/capport/comm/message.pyi +++ b/src/capport/comm/message.pyi @@ -1,6 +1,7 @@ -import google.protobuf.message import typing +import google.protobuf.message + # manually maintained typehints for protobuf created (and monkey-patched) types class Message(google.protobuf.message.Message): diff --git a/src/capport/config.py b/src/capport/config.py index dc6be3c..664b0a7 100644 --- a/src/capport/config.py +++ b/src/capport/config.py @@ -6,7 +6,6 @@ import os.path import yaml - _cached_config: Config | None = None _logger = logging.getLogger(__name__) diff --git a/src/capport/database.py b/src/capport/database.py index b2300eb..9a26458 100644 --- a/src/capport/database.py +++ b/src/capport/database.py @@ -8,7 +8,6 @@ import struct import typing import google.protobuf.message - import trio import capport.comm.message diff --git a/src/capport/utils/nft_socket.py b/src/capport/utils/nft_socket.py index 3d1ea31..70884db 100644 --- a/src/capport/utils/nft_socket.py +++ b/src/capport/utils/nft_socket.py @@ -9,7 +9,6 @@ from pyroute2.netlink.nfnetlink import NFNL_SUBSYS_NFTABLES # type: ignore from pyroute2.netlink.nfnetlink import nfgen_msg # type: ignore from pyroute2.netlink.nfnetlink import nftsocket as _nftsocket # type: ignore - NFPROTO_INET: int = 1 # nfgen_family "ipv4+ipv6"; strace decodes this as "AF_UNSPEC" diff --git a/src/capport/utils/zoneinfo.py b/src/capport/utils/zoneinfo.py index 5d1ea92..9c7fb0c 100644 --- a/src/capport/utils/zoneinfo.py +++ b/src/capport/utils/zoneinfo.py @@ -2,7 +2,6 @@ from __future__ import annotations import zoneinfo - _zoneinfo: zoneinfo.ZoneInfo | None = None