diff --git a/pyproject.toml b/pyproject.toml index 6c27457..1aa2914 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,6 @@ test = [ "black", # code auto-formatting "black[jupyter]", "coverage", # testing - "isort", # code auto-formatting "mypy", # linting "pytest", # testing "ruff" # linting @@ -60,15 +59,6 @@ documentation = "https://dj-notebook.readthedocs.io/" [tool.setuptools] package-dir = {"" = "src"} -# Isort -# ----- - -[tool.isort] -line_length = 99 -profile = "black" -default_section = "THIRDPARTY" -lines_after_imports = 2 - # Mypy # ---- @@ -90,3 +80,36 @@ module = "tests.*" allow_untyped_defs = true disable_error_code = "attr-defined" +# Ruff +# ---- + +[tool.ruff] +select = [ + "E", # pycodestyle + "F", # pyflakes + "I", # isort +] +ignore = [ + "E501", # line too long - black takes care of this for us +] + +[tool.ruff.per-file-ignores] +# Allow unused imports in __init__ files as these are convenience imports +"**/__init__.py" = [ "F401" ] + +[tool.ruff.isort] +lines-after-imports = 2 +section-order = [ + "future", + "standard-library", + "third-party", + "first-party", + "project", + "local-folder", +] + +[tool.ruff.isort.sections] +"project" = [ + "src", + "tests", +] \ No newline at end of file diff --git a/tests/test_dj_notebook.py b/tests/test_dj_notebook.py index da09e6f..27fe179 100644 --- a/tests/test_dj_notebook.py +++ b/tests/test_dj_notebook.py @@ -1,7 +1,6 @@ from unittest.mock import patch import pytest - from dj_notebook import Plus, activate from dj_notebook.shell_plus import DiagramClass