Skip to content

Commit 46c9292

Browse files
committed
fix linting
1 parent e6449a5 commit 46c9292

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

.pre-commit-config-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.2.2
4+
rev: v0.14.2
55
hooks:
66
# Run the linter.
77
- id: ruff

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default_install_hook_types: [pre-push]
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
44
# Ruff version.
5-
rev: v0.2.2
5+
rev: v0.14.2
66
hooks:
77
# Run the linter.
88
- id: ruff

docker-compose.ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ networks:
1212

1313
services:
1414
keycloak-db:
15-
image: postgres:latest
15+
image: postgres:17.6
1616
container_name: keycloak-db
1717
environment:
1818
POSTGRES_USER: keycloak
@@ -58,7 +58,7 @@ services:
5858
- ./env-prep/realm-export.json:/opt/keycloak/data/import/realm-import.json
5959

6060
virtual-lab-db:
61-
image: postgres:latest
61+
image: postgres:17.6
6262
container_name: vlm-db
6363
environment:
6464
POSTGRES_USER: vlm

virtual_labs/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def custom_openapi() -> dict[str, Any]:
8989
description="API description",
9090
routes=app.routes,
9191
)
92-
openapi_schema["components"]["schemas"][
93-
"HTTPValidationError"
94-
] = VlmValidationError.model_json_schema()
92+
openapi_schema["components"]["schemas"]["HTTPValidationError"] = (
93+
VlmValidationError.model_json_schema()
94+
)
9595

9696
app.openapi_schema = openapi_schema
9797
return app.openapi_schema

virtual_labs/domain/project.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class ProjectBody(BaseModel):
2828
name: Annotated[
2929
str, StringConstraints(strip_whitespace=True, min_length=1, max_length=250)
3030
]
31-
description: Optional[
32-
Annotated[str, StringConstraints(strip_whitespace=True)]
33-
] = None
31+
description: Optional[Annotated[str, StringConstraints(strip_whitespace=True)]] = (
32+
None
33+
)
3434

3535

3636
class ProjectUpdateBody(BaseModel):
@@ -41,9 +41,9 @@ class ProjectUpdateBody(BaseModel):
4141
str, StringConstraints(strip_whitespace=True, min_length=1, max_length=250)
4242
]
4343
] = None
44-
description: Optional[
45-
Annotated[str, StringConstraints(strip_whitespace=True)]
46-
] = None
44+
description: Optional[Annotated[str, StringConstraints(strip_whitespace=True)]] = (
45+
None
46+
)
4747

4848

4949
class Project(BaseModel):

virtual_labs/repositories/subscription_repo.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,15 @@ async def list_subscriptions(
133133
user_id: Optional[UUID] = None,
134134
status: Optional[SubscriptionStatus] = None,
135135
subscription_type: Literal["free"] = "free",
136-
) -> list[FreeSubscription]:
137-
...
136+
) -> list[FreeSubscription]: ...
138137

139138
@overload
140139
async def list_subscriptions(
141140
self,
142141
user_id: Optional[UUID] = None,
143142
status: Optional[SubscriptionStatus] = None,
144143
subscription_type: Literal["paid"] = "paid",
145-
) -> list[PaidSubscription]:
146-
...
144+
) -> list[PaidSubscription]: ...
147145

148146
async def list_subscriptions(
149147
self,

virtual_labs/tests/integration/test_lab_project_management.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ async def created_project(
164164
headers=headers,
165165
)
166166

167-
assert (
168-
project_response.status_code == HTTPStatus.OK
169-
), f"Failed to create project: {project_response.text}"
167+
assert project_response.status_code == HTTPStatus.OK, (
168+
f"Failed to create project: {project_response.text}"
169+
)
170170

171171
project_id = project_response.json()["data"]["project"]["id"]
172172
async with session_context_factory() as session:
@@ -388,6 +388,8 @@ async def test_attach_users_initial_success(
388388
response_data = attach_response.json()["data"]
389389

390390
# Assert response structure
391+
# test-1 is already a project admin (added during project creation as VL admin)
392+
# so only test-2 gets added as member
391393
assert len(response_data["added_users"]) == 1
392394
assert len(response_data["updated_users"]) == 0
393395
assert len(response_data["failed_operations"]) == 0
@@ -396,7 +398,7 @@ async def test_attach_users_initial_success(
396398
added_user_ids_roles = {
397399
u["id"]: u["role"] for u in response_data["added_users"]
398400
}
399-
assert added_user_ids_roles[user_ids["test-1"]] == "admin"
401+
# Only test-2 should be in added_users as member
400402
assert added_user_ids_roles[user_ids["test-2"]] == "member"
401403

402404
proj_admins = await gqr.a_retrieve_group_user_ids(proj_admin_group_id)

virtual_labs/usecases/bookmarks/get_bookmarks_by_category.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ async def get_bookmarks_by_category(
2020
repo = BookmarkQueryRepository(db)
2121
db_bookmarks = await repo.get_project_bookmarks(project_id, category)
2222

23-
grouped_bookmarks: defaultdict[
24-
BookmarkCategory, list[BookmarkOut]
25-
] = defaultdict(list)
23+
grouped_bookmarks: defaultdict[BookmarkCategory, list[BookmarkOut]] = (
24+
defaultdict(list)
25+
)
2626

2727
for db_bookmark in db_bookmarks:
2828
grouped_bookmarks[BookmarkCategory(db_bookmark.category)].append(

0 commit comments

Comments
 (0)