Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ignore = ["E501"]
python-version = "3.14"

[tool.ty.rules]
unresolved-import = "ignore"
import-not-found = "ignore"

[tool.bandit]
# Honoured by the python-service archetype via `-c pyproject.toml` (gitops #725).
Expand Down
12 changes: 6 additions & 6 deletions src/models/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ValidationErrorResponse(StandardErrorResponse):
description="Human-readable error message",
)
# Preserve the non-null Pydantic field in specialized error schemas.
error_code: str = Field( # ty: ignore[invalid-mutable-override]
error_code: str = Field( # ty: ignore[incompatible-mutable-override]
default="VALIDATION_ERROR",
pattern=SAFE_STRING_PATTERN,
description="Machine-readable error code",
Expand Down Expand Up @@ -140,7 +140,7 @@ class Error400Response(StandardErrorResponse):
description="Human-readable error message",
)
# Preserve the non-null Pydantic field in specialized error schemas.
error_code: str = Field( # ty: ignore[invalid-mutable-override]
error_code: str = Field( # ty: ignore[incompatible-mutable-override]
default="BAD_REQUEST",
pattern=SAFE_STRING_PATTERN,
description="Machine-readable error code",
Expand All @@ -156,7 +156,7 @@ class Error401Response(StandardErrorResponse):
description="Human-readable error message",
)
# Preserve the non-null Pydantic field in specialized error schemas.
error_code: str = Field( # ty: ignore[invalid-mutable-override]
error_code: str = Field( # ty: ignore[incompatible-mutable-override]
default="UNAUTHORIZED",
pattern=SAFE_STRING_PATTERN,
description="Machine-readable error code",
Expand All @@ -172,7 +172,7 @@ class Error403Response(StandardErrorResponse):
description="Human-readable error message",
)
# Preserve the non-null Pydantic field in specialized error schemas.
error_code: str = Field( # ty: ignore[invalid-mutable-override]
error_code: str = Field( # ty: ignore[incompatible-mutable-override]
default="FORBIDDEN",
pattern=SAFE_STRING_PATTERN,
description="Machine-readable error code",
Expand All @@ -188,7 +188,7 @@ class Error404Response(StandardErrorResponse):
description="Human-readable error message",
)
# Preserve the non-null Pydantic field in specialized error schemas.
error_code: str = Field( # ty: ignore[invalid-mutable-override]
error_code: str = Field( # ty: ignore[incompatible-mutable-override]
default="NOT_FOUND",
pattern=SAFE_STRING_PATTERN,
description="Machine-readable error code",
Expand All @@ -208,7 +208,7 @@ class Error500Response(StandardErrorResponse):
description="Human-readable error message",
)
# Preserve the non-null Pydantic field in specialized error schemas.
error_code: str = Field( # ty: ignore[invalid-mutable-override]
error_code: str = Field( # ty: ignore[incompatible-mutable-override]
default="INTERNAL_ERROR",
pattern=SAFE_STRING_PATTERN,
description="Machine-readable error code",
Expand Down
4 changes: 3 additions & 1 deletion src/routers/security/dependency_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ async def list_workspace_dependencies(
selected = normalize_repo(repo) if repo is not None else None
except ValueError as exc:
raise HTTPException(status_code=422, detail=str(exc)) from exc
ecosystems = {"pypi", "crates.io"} if ecosystem == "auto" else {ecosystem}
ecosystems: set[Literal["pypi", "crates.io"]] = (
{"pypi", "crates.io"} if ecosystem == "auto" else {ecosystem}
)

# Tenant gate FIRST: nothing runs for a name that is not the caller's.
workspace = await validate_and_get_container_for_tenant(container_name, tenant_id)
Expand Down
6 changes: 5 additions & 1 deletion src/services/system_dependency_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,10 @@ def _install_packages_with_retry(
self, packages: list[str], timeout: int = 300, max_retries: int = 2
) -> bool:
"""Install packages with retry logic."""
if not self.package_manager:
logger.error("No supported package manager detected")
return False

for attempt in range(max_retries + 1):
try:
if self.package_manager == PackageManager.APT:
Expand Down Expand Up @@ -862,7 +866,7 @@ def _install_packages_with_retry(
capture_output=True,
)
else:
pm_name = self.package_manager.value if self.package_manager else "unknown"
pm_name = self.package_manager.value
logger.error(f"Unsupported package manager: {pm_name}")
return False

Expand Down
Loading