Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
ruff: Enable import sorting, replacing isort.
Anders Kaseorg9a8a2bd34547
diff --git a/pyproject.toml b/pyproject.tomlindex 4a83f2ceb38..f8f27066dd1 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -105,6 +105,7 @@ select = ["C", # comprehensions"E", # style errors"F", # flakes+ "I", # import sorting"M", # meta"N", # naming"U", # upgrade@@ -127,4 +128,8 @@ ignore = ["N818", # Exception name should be named with an Error suffix]line-length = 100+src = [".", "tools", "tools/setup/emoji"]target-version = "py38"++[tool.ruff.isort]+known-third-party = ["zulip"]diff --git a/tools/lint b/tools/lintindex 519e03cc311..ff8e2ea7d44 100755--- a/tools/lint+++ b/tools/lint@@ -169,13 +169,6 @@ def run() -> None:["tools/commit-message-lint"],description="Checks commit messages for common formatting errors (config: .gitlint)",)- linter_config.external_linter(- "isort",- ["isort"],- ["py", "pyi"],- description="Sorts Python import statements",- check_arg=["--check-only", "--diff"],- )linter_config.external_linter("prettier",["node_modules/.bin/prettier", "--cache", "--check", "--log-level=warn"],diff --git a/zerver/forms.py b/zerver/forms.pyindex 868164d3236..f7ae6bfa3dc 100644--- a/zerver/forms.py+++ b/zerver/forms.py@@ -15,9 +15,8 @@ from django.core.validators import validate_emailfrom django.http import HttpRequestfrom django.urls import reversefrom django.utils.http import urlsafe_base64_encode-from django.utils.translation import get_language+from django.utils.translation import get_language, gettext_lazyfrom django.utils.translation import gettext as _-from django.utils.translation import gettext_lazyfrom markupsafe import Markupfrom two_factor.forms import AuthenticationTokenForm as TwoFactorAuthenticationTokenFormfrom two_factor.utils import totp_digitsdiff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.pyindex b474e4f1f37..c2aba938787 100644--- a/zerver/worker/queue_processors.py+++ b/zerver/worker/queue_processors.py@@ -58,9 +58,12 @@ from zerver.lib.bot_lib import EmbeddedBotHandler, EmbeddedBotQuitException, getfrom zerver.lib.context_managers import lockfilefrom zerver.lib.db import reset_queriesfrom zerver.lib.digest import bulk_handle_digest_email-from zerver.lib.email_mirror import decode_stream_email_address, is_missed_message_address+from zerver.lib.email_mirror import (+ decode_stream_email_address,+ is_missed_message_address,+ rate_limit_mirror_by_realm,+)from zerver.lib.email_mirror import process_message as mirror_email-from zerver.lib.email_mirror import rate_limit_mirror_by_realmfrom zerver.lib.email_notifications import handle_missedmessage_emailsfrom zerver.lib.error_notify import do_report_errorfrom zerver.lib.exceptions import RateLimited