From f11c50bd5e7b505bf9b905b9f17caf1421b6c639 Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Wed, 25 Sep 2024 12:24:56 -0400 Subject: [PATCH] Sort imports as nextline packages as first party --- pyproject.toml | 2 +- src/nextline_rdb/init.py | 3 ++- src/nextline_rdb/plugin.py | 1 + src/nextline_rdb/write/__init__.py | 1 - src/nextline_rdb/write/write_prompt_table.py | 4 ++-- src/nextline_rdb/write/write_run_table.py | 4 ++-- src/nextline_rdb/write/write_script_table.py | 4 ++-- src/nextline_rdb/write/write_stdout_table.py | 4 ++-- src/nextline_rdb/write/write_trace_call_table.py | 6 +++--- src/nextline_rdb/write/write_trace_table.py | 4 ++-- tests/test_init.py | 2 +- tests/test_plugin.py | 6 +++--- tests/utils/test_until.py | 2 +- tests/write/test_write.py | 2 +- 14 files changed, 23 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0cb846b..e452fa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ ignore = [ max-complexity = 20 [tool.ruff.lint.isort] -known-first-party = ["nextline_test_utils"] +known-first-party = ["nextline", "nextlinegraphql", "nextline_test_utils"] [tool.coverage.run] branch = true diff --git a/src/nextline_rdb/init.py b/src/nextline_rdb/init.py index 82a9ac6..967e0b4 100644 --- a/src/nextline_rdb/init.py +++ b/src/nextline_rdb/init.py @@ -1,10 +1,11 @@ from logging import getLogger from typing import Optional -from nextline import Nextline from sqlalchemy import func, select from sqlalchemy.orm import selectinload +from nextline import Nextline + from .db import DB from .models import CurrentScript, Run diff --git a/src/nextline_rdb/plugin.py b/src/nextline_rdb/plugin.py index fbe577b..54575a6 100644 --- a/src/nextline_rdb/plugin.py +++ b/src/nextline_rdb/plugin.py @@ -4,6 +4,7 @@ from apluggy import asynccontextmanager from dynaconf import Dynaconf, Validator + from nextlinegraphql.hook import spec from . import write diff --git a/src/nextline_rdb/write/__init__.py b/src/nextline_rdb/write/__init__.py index acbadf3..ea9c7ce 100644 --- a/src/nextline_rdb/write/__init__.py +++ b/src/nextline_rdb/write/__init__.py @@ -1,7 +1,6 @@ __all__ = ['register'] from nextline import Nextline - from nextline_rdb.db import DB from .write_prompt_table import WritePromptTable diff --git a/src/nextline_rdb/write/write_prompt_table.py b/src/nextline_rdb/write/write_prompt_table.py index ea479f0..b5e2708 100644 --- a/src/nextline_rdb/write/write_prompt_table.py +++ b/src/nextline_rdb/write/write_prompt_table.py @@ -1,8 +1,8 @@ -from nextline.events import OnEndPrompt, OnStartPrompt -from nextline.plugin.spec import hookimpl from sqlalchemy import select from sqlalchemy.orm import selectinload +from nextline.events import OnEndPrompt, OnStartPrompt +from nextline.plugin.spec import hookimpl from nextline_rdb.db import DB from nextline_rdb.models import Prompt, Run, Trace, TraceCall from nextline_rdb.utils import until_scalar_one diff --git a/src/nextline_rdb/write/write_run_table.py b/src/nextline_rdb/write/write_run_table.py index c765321..fcacef6 100644 --- a/src/nextline_rdb/write/write_run_table.py +++ b/src/nextline_rdb/write/write_run_table.py @@ -1,12 +1,12 @@ from datetime import timezone from logging import getLogger -from nextline.events import OnEndRun, OnStartRun -from nextline.plugin.spec import hookimpl from sqlalchemy import select from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload +from nextline.events import OnEndRun, OnStartRun +from nextline.plugin.spec import hookimpl from nextline_rdb.db import DB from nextline_rdb.models import CurrentScript, Run, Script from nextline_rdb.utils import until_scalar_one diff --git a/src/nextline_rdb/write/write_script_table.py b/src/nextline_rdb/write/write_script_table.py index 61dbbae..15cb63c 100644 --- a/src/nextline_rdb/write/write_script_table.py +++ b/src/nextline_rdb/write/write_script_table.py @@ -1,9 +1,9 @@ -from nextline.plugin.spec import Context, hookimpl -from nextline.spawned import RunArg from sqlalchemy import select from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload +from nextline.plugin.spec import Context, hookimpl +from nextline.spawned import RunArg from nextline_rdb.db import DB from nextline_rdb.models import CurrentScript, Script diff --git a/src/nextline_rdb/write/write_stdout_table.py b/src/nextline_rdb/write/write_stdout_table.py index 34ca124..5f347a2 100644 --- a/src/nextline_rdb/write/write_stdout_table.py +++ b/src/nextline_rdb/write/write_stdout_table.py @@ -1,7 +1,7 @@ -from nextline.events import OnWriteStdout -from nextline.plugin.spec import hookimpl from sqlalchemy import select +from nextline.events import OnWriteStdout +from nextline.plugin.spec import hookimpl from nextline_rdb.db import DB from nextline_rdb.models import Run, Stdout, Trace from nextline_rdb.utils import until_scalar_one diff --git a/src/nextline_rdb/write/write_trace_call_table.py b/src/nextline_rdb/write/write_trace_call_table.py index 3a3fbe6..feb0b5c 100644 --- a/src/nextline_rdb/write/write_trace_call_table.py +++ b/src/nextline_rdb/write/write_trace_call_table.py @@ -1,9 +1,9 @@ -from nextline.events import OnEndTraceCall, OnStartTraceCall -from nextline.plugin.spec import hookimpl -from nextline.types import TraceNo from sqlalchemy import select from sqlalchemy.orm import selectinload +from nextline.events import OnEndTraceCall, OnStartTraceCall +from nextline.plugin.spec import hookimpl +from nextline.types import TraceNo from nextline_rdb.db import DB from nextline_rdb.models import Run, Trace, TraceCall from nextline_rdb.utils import until_scalar_one diff --git a/src/nextline_rdb/write/write_trace_table.py b/src/nextline_rdb/write/write_trace_table.py index 407ac6e..8c0d2bf 100644 --- a/src/nextline_rdb/write/write_trace_table.py +++ b/src/nextline_rdb/write/write_trace_table.py @@ -1,10 +1,10 @@ from datetime import timezone +from sqlalchemy import select + from nextline.events import OnEndRun, OnEndTrace, OnStartTrace from nextline.plugin.spec import hookimpl from nextline.types import TraceNo -from sqlalchemy import select - from nextline_rdb.db import DB from nextline_rdb.models import Run, Trace from nextline_rdb.utils import until_scalar_one diff --git a/tests/test_init.py b/tests/test_init.py index 4f6663a..d1f11d4 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -1,6 +1,6 @@ from hypothesis import given -from nextline import Nextline +from nextline import Nextline from nextline_rdb.db import DB from nextline_rdb.init import initialize_nextline from nextline_rdb.models import Run diff --git a/tests/test_plugin.py b/tests/test_plugin.py index ccc1e9c..cf3397f 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -5,13 +5,13 @@ import pytest import tomli import tomli_w -from nextlinegraphql import create_app -from nextlinegraphql.plugins.ctrl.graphql import MUTATE_RUN_AND_CONTINUE -from nextlinegraphql.plugins.graphql.test import TestClient, gql_request from pytest import mark from nextline_rdb.db import DB from nextline_rdb.models.strategies import st_model_run_list +from nextlinegraphql import create_app +from nextlinegraphql.plugins.ctrl.graphql import MUTATE_RUN_AND_CONTINUE +from nextlinegraphql.plugins.graphql.test import TestClient, gql_request from .schema.graphql import QUERY_RDB_CONNECTIONS diff --git a/tests/utils/test_until.py b/tests/utils/test_until.py index 128d293..d58f744 100644 --- a/tests/utils/test_until.py +++ b/tests/utils/test_until.py @@ -5,8 +5,8 @@ import pytest from hypothesis import given from hypothesis import strategies as st -from nextline.utils import aiterable +from nextline.utils import aiterable from nextline_rdb.utils import UntilNotNoneTimeout, until_not_none diff --git a/tests/write/test_write.py b/tests/write/test_write.py index db3fd89..d992e4a 100644 --- a/tests/write/test_write.py +++ b/tests/write/test_write.py @@ -5,6 +5,7 @@ from apluggy import PluginManager from hypothesis import Phase, given, settings + from nextline import Nextline from nextline.events import ( OnEndPrompt, @@ -28,7 +29,6 @@ TraceCallNo, TraceNo, ) - from nextline_rdb.db import DB from nextline_rdb.models import ( CurrentScript,