diff --git a/.vscode/settings.json b/.vscode/settings.json index b97a24a..0c84e74 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,6 @@ "python.testing.pytestArgs": ["tests"], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, - "isort.check": true, "markdownlint.config": { "MD033": false, "MD036": false, diff --git a/pyproject.toml b/pyproject.toml index 0590269..714f562 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,15 +55,6 @@ source = "regex_commit" path = "src/nextline_schedule/__about__.py" tag_sign = false -[tool.hatch.envs.default] -dependencies = ["pytest", "pytest-cov"] -[tool.hatch.envs.default.scripts] -cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/nextline_schedule --cov=tests {args}" -no-cov = "cov --no-cov {args}" - -[[tool.hatch.envs.test.matrix]] -python = ["310", "311", "312"] - [tool.pytest.ini_options] asyncio_mode = "auto" timeout = 60 @@ -75,9 +66,32 @@ filterwarnings = ["ignore::hypothesis.errors.NonInteractiveExampleWarning"] log_cli = false log_cli_level = "INFO" -[tool.black] -skip-string-normalization = true -target_version = ['py310', 'py311', 'py312'] +[tool.ruff] +line-length = 88 + +[tool.ruff.format] +quote-style = "preserve" + +[tool.ruff.lint] +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort +] +ignore = [ + "E203", # Whitespace before '{symbol}' + "E265", # Block comment should start with # + "E266", # Too many leading # before block comment + "E501", # Line too long ({width} > {limit}) + "E741", # Ambiguous variable name '{name}' +] + +[tool.ruff.lint.mccabe] +max-complexity = 20 + +[tool.ruff.lint.isort] +known-first-party = ["nextline", "nextlinegraphql"] [tool.coverage.run] branch = true @@ -93,9 +107,6 @@ exclude_lines = [ "^ *\\.\\.\\.$", ] -[tool.isort] -profile = "black" - [tool.mypy] plugins = "strawberry.ext.mypy_plugin" disallow_untyped_defs = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6b4300a..0000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -ignore = E203, E265, E266, E501, E741, W503 -max-line-length = 150 -max-complexity = 20 diff --git a/src/nextline_schedule/auto/auto_mode.py b/src/nextline_schedule/auto/auto_mode.py index 178212f..d5eb078 100644 --- a/src/nextline_schedule/auto/auto_mode.py +++ b/src/nextline_schedule/auto/auto_mode.py @@ -4,7 +4,6 @@ from nextline import Nextline from nextline.utils import pubsub - from nextline_schedule.types import Statement from .callback import Callback, build_state_machine diff --git a/src/nextline_schedule/auto/state_machine/machine.py b/src/nextline_schedule/auto/state_machine/machine.py index 3daed87..f9a0d20 100644 --- a/src/nextline_schedule/auto/state_machine/machine.py +++ b/src/nextline_schedule/auto/state_machine/machine.py @@ -3,9 +3,10 @@ from logging import getLogger from typing import Any, Protocol -from nextline.utils import pubsub from transitions.extensions.asyncio import HierarchicalAsyncMachine +from nextline.utils import pubsub + from .config import CONFIG diff --git a/src/nextline_schedule/plugin.py b/src/nextline_schedule/plugin.py index 5baeb7f..59655fc 100644 --- a/src/nextline_schedule/plugin.py +++ b/src/nextline_schedule/plugin.py @@ -5,6 +5,7 @@ from apluggy import asynccontextmanager from dynaconf import Dynaconf, Validator + from nextlinegraphql.hook import spec from .__about__ import __version__ diff --git a/src/nextline_schedule/schema/scheduler/mutation.py b/src/nextline_schedule/schema/scheduler/mutation.py index e96fe75..a33978a 100644 --- a/src/nextline_schedule/schema/scheduler/mutation.py +++ b/src/nextline_schedule/schema/scheduler/mutation.py @@ -1,9 +1,9 @@ from typing import Optional import strawberry -from nextline import Nextline from strawberry.types import Info +from nextline import Nextline from nextline_schedule.scheduler import Scheduler diff --git a/tests/auto/test_auto.py b/tests/auto/test_auto.py index 92501f3..0df7730 100644 --- a/tests/auto/test_auto.py +++ b/tests/auto/test_auto.py @@ -3,7 +3,6 @@ from nextline import Nextline from nextline.events import OnStartRun from nextline.plugin.spec import hookimpl - from nextline_schedule.auto import AutoMode STATEMENT_SCHEDULER = ''' diff --git a/tests/auto/test_auto_on_raised.py b/tests/auto/test_auto_on_raised.py index 5ea9bc0..928ac59 100644 --- a/tests/auto/test_auto_on_raised.py +++ b/tests/auto/test_auto_on_raised.py @@ -4,7 +4,6 @@ from typing import NoReturn from nextline import Nextline - from nextline_schedule.auto import AutoMode STATEMENT_QUEUE = ''' diff --git a/tests/auto/test_auto_turn_off.py b/tests/auto/test_auto_turn_off.py index 0e95642..c6167b9 100644 --- a/tests/auto/test_auto_turn_off.py +++ b/tests/auto/test_auto_turn_off.py @@ -3,7 +3,6 @@ from collections.abc import Callable from nextline import Nextline - from nextline_schedule.auto import AutoMode STATEMENT_QUEUE = ''' diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 7c8706b..017a3a2 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -2,9 +2,6 @@ from collections.abc import AsyncIterator import pytest -from nextlinegraphql import create_app -from nextlinegraphql.plugins.ctrl.graphql import SUBSCRIBE_STATE -from nextlinegraphql.plugins.graphql.test import TestClient, gql_request, gql_subscribe from pytest_httpx import HTTPXMock from nextline_schedule.graphql import ( @@ -14,6 +11,9 @@ QUERY_SCHEDULER, SUBSCRIBE_AUTO_MODE_STATE, ) +from nextlinegraphql import create_app +from nextlinegraphql.plugins.ctrl.graphql import SUBSCRIBE_STATE +from nextlinegraphql.plugins.graphql.test import TestClient, gql_request, gql_subscribe @pytest.fixture