Skip to content

Commit e9b2f9f

Browse files
patrick91tiangolo
andauthored
🔥 Remove isort configuration, since we use Ruff now (fastapi#1144)
Co-authored-by: Sebastián Ramírez <[email protected]>
1 parent 1538530 commit e9b2f9f

File tree

8 files changed

+23
-26
lines changed

8 files changed

+23
-26
lines changed

‎backend/app/tests/api/routes/test_login.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ def test_use_access_token(
4242
def test_recovery_password(
4343
client: TestClient, normal_user_token_headers: dict[str, str]
4444
) -> None:
45-
with patch("app.core.config.settings.SMTP_HOST", "smtp.example.com"), patch(
46-
"app.core.config.settings.SMTP_USER", "[email protected]"
45+
with (
46+
patch("app.core.config.settings.SMTP_HOST", "smtp.example.com"),
47+
patch("app.core.config.settings.SMTP_USER", "[email protected]"),
4748
):
4849
4950
r = client.post(

‎backend/app/tests/api/routes/test_users.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ def test_get_users_normal_user_me(
3434
def test_create_user_new_email(
3535
client: TestClient, superuser_token_headers: dict[str, str], db: Session
3636
) -> None:
37-
with patch("app.utils.send_email", return_value=None), patch(
38-
"app.core.config.settings.SMTP_HOST", "smtp.example.com"
39-
), patch("app.core.config.settings.SMTP_USER", "[email protected]"):
37+
with (
38+
patch("app.utils.send_email", return_value=None),
39+
patch("app.core.config.settings.SMTP_HOST", "smtp.example.com"),
40+
patch("app.core.config.settings.SMTP_USER", "[email protected]"),
41+
):
4042
username = random_email()
4143
password = random_lower_string()
4244
data = {"email": username, "password": password}

‎backend/app/tests/scripts/test_backend_pre_start.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ def test_init_successful_connection() -> None:
1212
exec_mock = MagicMock(return_value=True)
1313
session_mock.configure_mock(**{"exec.return_value": exec_mock})
1414

15-
with patch("sqlmodel.Session", return_value=session_mock), patch.object(
16-
logger, "info"
17-
), patch.object(logger, "error"), patch.object(logger, "warn"):
15+
with (
16+
patch("sqlmodel.Session", return_value=session_mock),
17+
patch.object(logger, "info"),
18+
patch.object(logger, "error"),
19+
patch.object(logger, "warn"),
20+
):
1821
try:
1922
init(engine_mock)
2023
connection_successful = True

‎backend/app/tests/scripts/test_test_pre_start.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ def test_init_successful_connection() -> None:
1212
exec_mock = MagicMock(return_value=True)
1313
session_mock.configure_mock(**{"exec.return_value": exec_mock})
1414

15-
with patch("sqlmodel.Session", return_value=session_mock), patch.object(
16-
logger, "info"
17-
), patch.object(logger, "error"), patch.object(logger, "warn"):
15+
with (
16+
patch("sqlmodel.Session", return_value=session_mock),
17+
patch.object(logger, "info"),
18+
patch.object(logger, "error"),
19+
patch.object(logger, "warn"),
20+
):
1821
try:
1922
init(engine_mock)
2023
connection_successful = True

‎backend/pyproject.toml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ types-python-jose = "^3.3.4.20240106"
3636
types-passlib = "^1.7.7.20240106"
3737
coverage = "^7.4.3"
3838

39-
[tool.isort]
40-
multi_line_output = 3
41-
include_trailing_comma = true
42-
force_grid_wrap = 0
43-
line_length = 88
4439
[build-system]
4540
requires = ["poetry>=0.12"]
4641
build-backend = "poetry.masonry.api"

‎backend/scripts/format-imports.sh‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎backend/scripts/format.sh‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh -e
22
set -x
33

4-
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place app --exclude=__init__.py
5-
black app
6-
isort --recursive --apply app
4+
ruff check app scripts --fix
5+
ruff format app scripts

‎backend/scripts/lint.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -e
44
set -x
55

66
mypy app
7-
ruff app
7+
ruff check app
88
ruff format app --check

0 commit comments

Comments
 (0)