From a8476f2ea9090059e276942fb6b42f5f0f02dab9 Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Sun, 17 Mar 2024 16:04:41 -0400 Subject: [PATCH] fix import sorting --- hyperglass/api/error_handlers.py | 3 +-- hyperglass/cli/util.py | 2 +- hyperglass/defaults/directives/arista_eos.py | 4 ++-- hyperglass/defaults/directives/bird.py | 2 +- hyperglass/defaults/directives/cisco_ios.py | 2 +- hyperglass/defaults/directives/cisco_nxos.py | 2 +- hyperglass/defaults/directives/cisco_xr.py | 2 +- hyperglass/defaults/directives/frr.py | 2 +- hyperglass/defaults/directives/huawei.py | 2 +- hyperglass/defaults/directives/juniper.py | 2 +- hyperglass/defaults/directives/mikrotik.py | 2 +- hyperglass/defaults/directives/nokia_sros.py | 2 +- hyperglass/defaults/directives/openbgpd.py | 2 +- hyperglass/defaults/directives/tnsr.py | 2 +- hyperglass/defaults/directives/vyos.py | 2 +- hyperglass/exceptions/_common.py | 1 + hyperglass/exceptions/public.py | 3 ++- hyperglass/execution/drivers/tests/test_construct.py | 11 ++++++++--- hyperglass/frontend/__init__.py | 1 - hyperglass/main.py | 6 +++++- hyperglass/models/api/query.py | 3 +-- hyperglass/models/api/response.py | 10 +--------- hyperglass/models/api/rfc8522.py | 4 ++-- hyperglass/models/api/types.py | 2 ++ hyperglass/models/config/devices.py | 2 +- hyperglass/models/config/docs.py | 1 + hyperglass/models/config/http_client.py | 7 +------ hyperglass/models/config/logging.py | 8 +------- hyperglass/models/config/params.py | 2 +- hyperglass/models/config/proxy.py | 2 +- hyperglass/models/config/structured.py | 1 - hyperglass/models/config/web.py | 2 +- hyperglass/models/directive.py | 9 +-------- hyperglass/models/main.py | 2 +- hyperglass/models/parsing/arista_eos.py | 1 + hyperglass/models/parsing/frr.py | 2 +- hyperglass/models/parsing/juniper.py | 2 +- hyperglass/models/system.py | 3 +-- hyperglass/models/webhook.py | 2 +- hyperglass/plugins/tests/_fixtures.py | 1 + hyperglass/plugins/tests/test_bgp_community.py | 11 ++++++++--- hyperglass/plugins/tests/test_bgp_route_arista.py | 2 +- hyperglass/plugins/tests/test_bgp_route_juniper.py | 2 +- hyperglass/state/tests/test_hooks.py | 8 +++++--- 44 files changed, 68 insertions(+), 76 deletions(-) diff --git a/hyperglass/api/error_handlers.py b/hyperglass/api/error_handlers.py index bf27fa9..f888004 100644 --- a/hyperglass/api/error_handlers.py +++ b/hyperglass/api/error_handlers.py @@ -1,12 +1,11 @@ """API Error Handlers.""" -from hyperglass.log import log - # Third Party from fastapi import Request from starlette.responses import JSONResponse # Project +from hyperglass.log import log from hyperglass.state import use_state diff --git a/hyperglass/cli/util.py b/hyperglass/cli/util.py index f35fec6..4dbb6cf 100644 --- a/hyperglass/cli/util.py +++ b/hyperglass/cli/util.py @@ -15,8 +15,8 @@ def build_ui(timeout: int) -> None: """Create a new UI build.""" # Project from hyperglass.state import use_state - from hyperglass.configuration import init_user_config from hyperglass.frontend import build_frontend + from hyperglass.configuration import init_user_config # Populate configuration to Redis prior to accessing it. init_user_config() diff --git a/hyperglass/defaults/directives/arista_eos.py b/hyperglass/defaults/directives/arista_eos.py index a9bda97..bf0acd5 100644 --- a/hyperglass/defaults/directives/arista_eos.py +++ b/hyperglass/defaults/directives/arista_eos.py @@ -2,11 +2,11 @@ # Project from hyperglass.models.directive import ( - BuiltinDirective, + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, + BuiltinDirective, ) __all__ = ( diff --git a/hyperglass/defaults/directives/bird.py b/hyperglass/defaults/directives/bird.py index 9fd2954..7531cbd 100644 --- a/hyperglass/defaults/directives/bird.py +++ b/hyperglass/defaults/directives/bird.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/cisco_ios.py b/hyperglass/defaults/directives/cisco_ios.py index bfe9e13..e70821b 100644 --- a/hyperglass/defaults/directives/cisco_ios.py +++ b/hyperglass/defaults/directives/cisco_ios.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/cisco_nxos.py b/hyperglass/defaults/directives/cisco_nxos.py index 06f1697..8c421c1 100644 --- a/hyperglass/defaults/directives/cisco_nxos.py +++ b/hyperglass/defaults/directives/cisco_nxos.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/cisco_xr.py b/hyperglass/defaults/directives/cisco_xr.py index 27177ee..7f613b7 100644 --- a/hyperglass/defaults/directives/cisco_xr.py +++ b/hyperglass/defaults/directives/cisco_xr.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/frr.py b/hyperglass/defaults/directives/frr.py index 89d1444..5922458 100644 --- a/hyperglass/defaults/directives/frr.py +++ b/hyperglass/defaults/directives/frr.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/huawei.py b/hyperglass/defaults/directives/huawei.py index afab5f8..1ab97a8 100644 --- a/hyperglass/defaults/directives/huawei.py +++ b/hyperglass/defaults/directives/huawei.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/juniper.py b/hyperglass/defaults/directives/juniper.py index 71d44e7..e568343 100644 --- a/hyperglass/defaults/directives/juniper.py +++ b/hyperglass/defaults/directives/juniper.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/mikrotik.py b/hyperglass/defaults/directives/mikrotik.py index a26a720..c65d2ae 100644 --- a/hyperglass/defaults/directives/mikrotik.py +++ b/hyperglass/defaults/directives/mikrotik.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/nokia_sros.py b/hyperglass/defaults/directives/nokia_sros.py index 4338732..e013bae 100644 --- a/hyperglass/defaults/directives/nokia_sros.py +++ b/hyperglass/defaults/directives/nokia_sros.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/openbgpd.py b/hyperglass/defaults/directives/openbgpd.py index e81ae2b..be44806 100644 --- a/hyperglass/defaults/directives/openbgpd.py +++ b/hyperglass/defaults/directives/openbgpd.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/tnsr.py b/hyperglass/defaults/directives/tnsr.py index 45b3eb0..ba81158 100644 --- a/hyperglass/defaults/directives/tnsr.py +++ b/hyperglass/defaults/directives/tnsr.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/defaults/directives/vyos.py b/hyperglass/defaults/directives/vyos.py index d01262a..75a4668 100644 --- a/hyperglass/defaults/directives/vyos.py +++ b/hyperglass/defaults/directives/vyos.py @@ -2,10 +2,10 @@ # Project from hyperglass.models.directive import ( + Text, RuleWithIPv4, RuleWithIPv6, RuleWithPattern, - Text, BuiltinDirective, ) diff --git a/hyperglass/exceptions/_common.py b/hyperglass/exceptions/_common.py index e10b6e7..9d82324 100644 --- a/hyperglass/exceptions/_common.py +++ b/hyperglass/exceptions/_common.py @@ -120,6 +120,7 @@ class PublicHyperglassError(HyperglassError): def __init__(self, **kwargs: str) -> None: """Format error message with keyword arguments.""" + # Project from hyperglass.state import use_state if "error" in kwargs: diff --git a/hyperglass/exceptions/public.py b/hyperglass/exceptions/public.py index 9cc692b..8a71ef9 100644 --- a/hyperglass/exceptions/public.py +++ b/hyperglass/exceptions/public.py @@ -3,7 +3,6 @@ # Standard Library from typing import TYPE_CHECKING, Any, Dict, Optional - # Local from ._common import PublicHyperglassError @@ -82,6 +81,7 @@ class QueryLocationNotFound(NotFound): def __init__(self, location: Any, **kwargs: Dict[str, Any]) -> None: """Initialize a NotFound error for a query location.""" + # Project from hyperglass.state import use_state (text := use_state("params").web.text) @@ -94,6 +94,7 @@ class QueryTypeNotFound(NotFound): def __init__(self, query_type: Any, **kwargs: Dict[str, Any]) -> None: """Initialize a NotFound error for a query type.""" + # Project from hyperglass.state import use_state (text := use_state("params").web.text) diff --git a/hyperglass/execution/drivers/tests/test_construct.py b/hyperglass/execution/drivers/tests/test_construct.py index 18d138b..7e5adee 100644 --- a/hyperglass/execution/drivers/tests/test_construct.py +++ b/hyperglass/execution/drivers/tests/test_construct.py @@ -1,17 +1,22 @@ -# Project +# Standard Library import typing as t + +# Third Party import pytest + +# Project +from hyperglass.state import use_state from hyperglass.models.api import Query from hyperglass.configuration import init_ui_params -from hyperglass.models.config.params import Params from hyperglass.models.directive import Directives +from hyperglass.models.config.params import Params from hyperglass.models.config.devices import Devices -from hyperglass.state import use_state # Local from .._construct import Construct if t.TYPE_CHECKING: + # Project from hyperglass.state import HyperglassState diff --git a/hyperglass/frontend/__init__.py b/hyperglass/frontend/__init__.py index 5854c84..eb1ac86 100644 --- a/hyperglass/frontend/__init__.py +++ b/hyperglass/frontend/__init__.py @@ -14,7 +14,6 @@ from hyperglass.log import log from hyperglass.util import copyfiles, check_path, dotenv_to_dict from hyperglass.state import use_state - if t.TYPE_CHECKING: # Project from hyperglass.models.ui import UIParameters diff --git a/hyperglass/main.py b/hyperglass/main.py index 22ad1eb..7985d47 100644 --- a/hyperglass/main.py +++ b/hyperglass/main.py @@ -34,7 +34,6 @@ from .util import cpu_count from .state import use_state from .settings import Settings - log_level = "INFO" if Settings.debug is False else "DEBUG" setup_lib_logging(log_level) @@ -43,6 +42,7 @@ init_logger(log_level) async def build_ui() -> bool: """Perform a UI build prior to starting the application.""" + # Local from .frontend import build_frontend state = use_state() @@ -59,6 +59,7 @@ async def build_ui() -> bool: def register_all_plugins() -> None: """Validate and register configured plugins.""" + # Local from .plugins import register_plugin, init_builtin_plugins state = use_state() @@ -85,6 +86,7 @@ def register_all_plugins() -> None: def unregister_all_plugins() -> None: """Unregister all plugins.""" + # Local from .plugins import InputPluginManager, OutputPluginManager for manager in (InputPluginManager, OutputPluginManager): @@ -156,6 +158,7 @@ class HyperglassWSGI(BaseApplication): def start(*, log_level: str, workers: int, **kwargs) -> None: """Start hyperglass via gunicorn.""" + # Local from .log import CustomGunicornLogger HyperglassWSGI( @@ -181,6 +184,7 @@ def start(*, log_level: str, workers: int, **kwargs) -> None: def run(_workers: int = None): """Run hyperglass.""" + # Local from .configuration import init_user_config try: diff --git a/hyperglass/models/api/query.py b/hyperglass/models/api/query.py index 56b7b84..17c69c2 100644 --- a/hyperglass/models/api/query.py +++ b/hyperglass/models/api/query.py @@ -7,7 +7,7 @@ import secrets from datetime import datetime # Third Party -from pydantic import BaseModel, constr, field_validator, ConfigDict +from pydantic import BaseModel, ConfigDict, constr, field_validator # Project from hyperglass.log import log @@ -20,7 +20,6 @@ from hyperglass.exceptions.private import InputValidationError # Local from ..config.devices import Device - QueryLocation = constr(strip_whitespace=True, strict=True, min_length=1) QueryTarget = constr(strip_whitespace=True, min_length=1) QueryType = constr(strip_whitespace=True, strict=True, min_length=1) diff --git a/hyperglass/models/api/response.py b/hyperglass/models/api/response.py index ad79645..188f0b0 100644 --- a/hyperglass/models/api/response.py +++ b/hyperglass/models/api/response.py @@ -4,15 +4,7 @@ import typing as t # Third Party -from pydantic import ( - BaseModel, - StrictInt, - StrictStr, - StrictBool, - field_validator, - Field, - ConfigDict, -) +from pydantic import Field, BaseModel, StrictInt, StrictStr, ConfigDict, StrictBool, field_validator # Project from hyperglass.state import use_state diff --git a/hyperglass/models/api/rfc8522.py b/hyperglass/models/api/rfc8522.py index 4844388..f7310b5 100644 --- a/hyperglass/models/api/rfc8522.py +++ b/hyperglass/models/api/rfc8522.py @@ -3,12 +3,12 @@ # Standard Library # flake8: noqa import math -import secrets import typing as t +import secrets from datetime import datetime # Third Party -from pydantic import BaseModel, field_validator, ConfigDict, Field +from pydantic import Field, BaseModel, ConfigDict, field_validator """Patterns: GET /.well-known/looking-glass/v1/ping/2001:DB8::35?protocol=2,1 diff --git a/hyperglass/models/api/types.py b/hyperglass/models/api/types.py index 6a297e7..397ca8f 100644 --- a/hyperglass/models/api/types.py +++ b/hyperglass/models/api/types.py @@ -1,7 +1,9 @@ """Custom validation types.""" +# Standard Library import typing as t +# Third Party from pydantic import AfterValidator # Project diff --git a/hyperglass/models/config/devices.py b/hyperglass/models/config/devices.py index fe76f8f..6d4df1b 100644 --- a/hyperglass/models/config/devices.py +++ b/hyperglass/models/config/devices.py @@ -7,7 +7,7 @@ from pathlib import Path from ipaddress import IPv4Address, IPv6Address # Third Party -from pydantic import FilePath, field_validator, ValidationInfo +from pydantic import FilePath, ValidationInfo, field_validator from netmiko.ssh_dispatcher import CLASS_MAPPER # type: ignore # Project diff --git a/hyperglass/models/config/docs.py b/hyperglass/models/config/docs.py index b619ee1..a988bd0 100644 --- a/hyperglass/models/config/docs.py +++ b/hyperglass/models/config/docs.py @@ -1,5 +1,6 @@ """Configuration for API docs feature.""" +# Standard Library import typing as t # Third Party diff --git a/hyperglass/models/config/http_client.py b/hyperglass/models/config/http_client.py index 2bda93c..a2f2ff1 100644 --- a/hyperglass/models/config/http_client.py +++ b/hyperglass/models/config/http_client.py @@ -5,12 +5,7 @@ import typing as t # Third Party import httpx -from pydantic import ( - FilePath, - SecretStr, - PrivateAttr, - IPvAnyAddress, -) +from pydantic import FilePath, SecretStr, PrivateAttr, IPvAnyAddress # Project from hyperglass.models import HyperglassModel diff --git a/hyperglass/models/config/logging.py b/hyperglass/models/config/logging.py index 728c8d2..3604dd0 100644 --- a/hyperglass/models/config/logging.py +++ b/hyperglass/models/config/logging.py @@ -5,13 +5,7 @@ import typing as t from pathlib import Path # Third Party -from pydantic import ( - ByteSize, - SecretStr, - AnyHttpUrl, - DirectoryPath, - field_validator, -) +from pydantic import ByteSize, SecretStr, AnyHttpUrl, DirectoryPath, field_validator # Project from hyperglass.constants import __version__ diff --git a/hyperglass/models/config/params.py b/hyperglass/models/config/params.py index a7c3f7c..4375ce7 100644 --- a/hyperglass/models/config/params.py +++ b/hyperglass/models/config/params.py @@ -5,7 +5,7 @@ import typing as t from pathlib import Path # Third Party -from pydantic import Field, field_validator, ValidationInfo, ConfigDict +from pydantic import Field, ConfigDict, ValidationInfo, field_validator # Project from hyperglass.settings import Settings diff --git a/hyperglass/models/config/proxy.py b/hyperglass/models/config/proxy.py index 33bf461..2e9b29b 100644 --- a/hyperglass/models/config/proxy.py +++ b/hyperglass/models/config/proxy.py @@ -5,7 +5,7 @@ import typing as t from ipaddress import IPv4Address, IPv6Address # Third Party -from pydantic import field_validator, ValidationInfo +from pydantic import ValidationInfo, field_validator # Project from hyperglass.util import resolve_hostname diff --git a/hyperglass/models/config/structured.py b/hyperglass/models/config/structured.py index e69aba8..4373e81 100644 --- a/hyperglass/models/config/structured.py +++ b/hyperglass/models/config/structured.py @@ -3,7 +3,6 @@ # Standard Library import typing as t - # Local from ..main import HyperglassModel diff --git a/hyperglass/models/config/web.py b/hyperglass/models/config/web.py index 573d4f1..fb0bda2 100644 --- a/hyperglass/models/config/web.py +++ b/hyperglass/models/config/web.py @@ -5,7 +5,7 @@ import typing as t from pathlib import Path # Third Party -from pydantic import HttpUrl, FilePath, constr, field_validator, model_validator, ValidationInfo +from pydantic import HttpUrl, FilePath, ValidationInfo, constr, field_validator, model_validator from pydantic_extra_types.color import Color # Project diff --git a/hyperglass/models/directive.py b/hyperglass/models/directive.py index 4219f77..45e5341 100644 --- a/hyperglass/models/directive.py +++ b/hyperglass/models/directive.py @@ -6,13 +6,7 @@ import typing as t from ipaddress import IPv4Network, IPv6Network, ip_network # Third Party -from pydantic import ( - field_validator, - Field, - FilePath, - IPvAnyNetwork, - PrivateAttr, -) +from pydantic import Field, FilePath, PrivateAttr, IPvAnyNetwork, field_validator # Project from hyperglass.log import log @@ -24,7 +18,6 @@ from hyperglass.exceptions.private import InputValidationError from .main import MultiModel, HyperglassModel, HyperglassUniqueModel from .fields import Action - StringOrArray = t.Union[str, t.List[str]] Condition = t.Union[IPvAnyNetwork, str] RuleValidation = t.Union[t.Literal["ipv4", "ipv6", "pattern"], None] diff --git a/hyperglass/models/main.py b/hyperglass/models/main.py index dc68efd..43fe098 100644 --- a/hyperglass/models/main.py +++ b/hyperglass/models/main.py @@ -9,7 +9,7 @@ import typing as t from pathlib import Path # Third Party -from pydantic import HttpUrl, BaseModel, PrivateAttr, RootModel, ConfigDict +from pydantic import HttpUrl, BaseModel, RootModel, ConfigDict, PrivateAttr # Project from hyperglass.log import log diff --git a/hyperglass/models/parsing/arista_eos.py b/hyperglass/models/parsing/arista_eos.py index 6e70c6d..3a63da3 100644 --- a/hyperglass/models/parsing/arista_eos.py +++ b/hyperglass/models/parsing/arista_eos.py @@ -4,6 +4,7 @@ import typing as t from datetime import datetime +# Third Party from pydantic import ConfigDict # Project diff --git a/hyperglass/models/parsing/frr.py b/hyperglass/models/parsing/frr.py index 9e407ad..87c3d51 100644 --- a/hyperglass/models/parsing/frr.py +++ b/hyperglass/models/parsing/frr.py @@ -5,7 +5,7 @@ import typing as t from datetime import datetime # Third Party -from pydantic import model_validator, ConfigDict +from pydantic import ConfigDict, model_validator # Project from hyperglass.log import log diff --git a/hyperglass/models/parsing/juniper.py b/hyperglass/models/parsing/juniper.py index d6f2b27..c012b95 100644 --- a/hyperglass/models/parsing/juniper.py +++ b/hyperglass/models/parsing/juniper.py @@ -4,7 +4,7 @@ import typing as t # Third Party -from pydantic import field_validator, model_validator, ConfigDict +from pydantic import ConfigDict, field_validator, model_validator # Project from hyperglass.log import log diff --git a/hyperglass/models/system.py b/hyperglass/models/system.py index 5d01a9a..300e0eb 100644 --- a/hyperglass/models/system.py +++ b/hyperglass/models/system.py @@ -12,10 +12,9 @@ from pydantic import ( SecretStr, DirectoryPath, IPvAnyAddress, - field_validator, ValidationInfo, + field_validator, ) - from pydantic_settings import BaseSettings, SettingsConfigDict # Project diff --git a/hyperglass/models/webhook.py b/hyperglass/models/webhook.py index 7237dcc..68c111e 100644 --- a/hyperglass/models/webhook.py +++ b/hyperglass/models/webhook.py @@ -5,7 +5,7 @@ import typing as t from datetime import datetime # Third Party -from pydantic import model_validator, ConfigDict +from pydantic import ConfigDict, model_validator # Project from hyperglass.log import log diff --git a/hyperglass/plugins/tests/_fixtures.py b/hyperglass/plugins/tests/_fixtures.py index 0051836..f054a3c 100644 --- a/hyperglass/plugins/tests/_fixtures.py +++ b/hyperglass/plugins/tests/_fixtures.py @@ -1,3 +1,4 @@ +# Project from hyperglass.models.config.devices import Device diff --git a/hyperglass/plugins/tests/test_bgp_community.py b/hyperglass/plugins/tests/test_bgp_community.py index 6595709..d5f8834 100644 --- a/hyperglass/plugins/tests/test_bgp_community.py +++ b/hyperglass/plugins/tests/test_bgp_community.py @@ -1,14 +1,19 @@ """Test BGP Community validation.""" +# Standard Library import typing as t + +# Third Party import pytest +# Project +from hyperglass.state import use_state +from hyperglass.models.config.params import Params + # Local from .._builtin.bgp_community import ValidateBGPCommunity -from hyperglass.state import use_state -from hyperglass.models.config.params import Params - if t.TYPE_CHECKING: + # Project from hyperglass.state import HyperglassState diff --git a/hyperglass/plugins/tests/test_bgp_route_arista.py b/hyperglass/plugins/tests/test_bgp_route_arista.py index a681e8b..dbb02bc 100644 --- a/hyperglass/plugins/tests/test_bgp_route_arista.py +++ b/hyperglass/plugins/tests/test_bgp_route_arista.py @@ -12,8 +12,8 @@ from hyperglass.models.config.devices import Device from hyperglass.models.data.bgp_route import BGPRouteTable # Local -from .._builtin.bgp_route_arista import BGPRoutePluginArista from ._fixtures import MockDevice +from .._builtin.bgp_route_arista import BGPRoutePluginArista DEPENDS_KWARGS = { "depends": [ diff --git a/hyperglass/plugins/tests/test_bgp_route_juniper.py b/hyperglass/plugins/tests/test_bgp_route_juniper.py index 4445279..b4296ac 100644 --- a/hyperglass/plugins/tests/test_bgp_route_juniper.py +++ b/hyperglass/plugins/tests/test_bgp_route_juniper.py @@ -13,8 +13,8 @@ from hyperglass.models.api.query import Query from hyperglass.models.data.bgp_route import BGPRouteTable # Local -from .._builtin.bgp_route_juniper import BGPRoutePluginJuniper from ._fixtures import MockDevice +from .._builtin.bgp_route_juniper import BGPRoutePluginJuniper DEPENDS_KWARGS = { "depends": [ diff --git a/hyperglass/state/tests/test_hooks.py b/hyperglass/state/tests/test_hooks.py index ce5f5ee..aaa9d5c 100644 --- a/hyperglass/state/tests/test_hooks.py +++ b/hyperglass/state/tests/test_hooks.py @@ -1,18 +1,20 @@ """Test state hooks.""" +# Standard Library import typing as t -import pytest +# Third Party +import pytest if t.TYPE_CHECKING: from hyperglass.state import HyperglassState # Project from hyperglass.models.ui import UIParameters -from hyperglass.models.config.devices import Devices from hyperglass.configuration import init_ui_params -from hyperglass.models.config.params import Params from hyperglass.models.directive import Directives +from hyperglass.models.config.params import Params +from hyperglass.models.config.devices import Devices # Local from ..hooks import use_state