Skip to content

Commit

Permalink
🎨 Resolve pylint warnings (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 authored Nov 20, 2024
1 parent af91a23 commit 72b35e1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/routes/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def accept_invitation(


@router.get("", summary="Fetch Connection Records", response_model=List[Connection])
async def get_connections(
async def get_connections( # pylint: disable=R0913,R0917
limit: Optional[int] = limit_query_parameter,
offset: Optional[int] = offset_query_parameter,
order_by: Optional[str] = order_by_query_parameter,
Expand Down
8 changes: 4 additions & 4 deletions app/services/trust_registry/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def register_schema(schema_id: str) -> None:
raise TrustRegistryException(
f"Error registering schema `{schema_id}`. Error: `{e.detail}`.",
e.status_code,
)
) from e

bound_logger.debug("Successfully registered schema on trust registry.")

Expand All @@ -62,7 +62,7 @@ async def fetch_schemas() -> List[Schema]:
)
raise TrustRegistryException(
f"Unable to fetch schemas: `{e.detail}`.", e.status_code
)
) from e

result = [Schema.model_validate(schema) for schema in schemas_res.json()]
logger.debug("Successfully fetched schemas from trust registry.")
Expand Down Expand Up @@ -99,7 +99,7 @@ async def get_schema_by_id(schema_id: str) -> Optional[Schema]:
raise TrustRegistryException(
f"Unable to fetch schema: `{e.detail}`.",
e.status_code,
)
) from e

result = Schema.model_validate(schema_response.json())
logger.debug("Successfully fetched schema from trust registry.")
Expand Down Expand Up @@ -129,6 +129,6 @@ async def remove_schema_by_id(schema_id: str) -> None:
raise TrustRegistryException(
f"Error removing schema from trust registry: `{e.detail}`.",
e.status_code,
)
) from e

bound_logger.debug("Successfully removed schema from trust registry.")
2 changes: 2 additions & 0 deletions app/tests/e2e/verifier/test_many_revocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ async def revoke_many(
) -> List[CredentialExchange]:

auto_publish = True
if hasattr(request, "param") and request.param == "auto_publish_false":
auto_publish = False

for cred in issue_many_creds:
await faber_client.post(
Expand Down
2 changes: 1 addition & 1 deletion app/tests/util/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def check_webhook_state(
timeout=max_duration,
)
else:
raise Exception(
raise Exception( # pylint: disable=W0719
"No longer implemented: cannot wait for event without filter_map"
)
except SseListenerTimeout:
Expand Down
2 changes: 1 addition & 1 deletion app/util/acapy_verifier_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
logger = get_logger(__name__)


async def assert_valid_prover(
async def assert_valid_prover( # pylint: disable=R0912
aries_controller: AcaPyClient, presentation: AcceptProofRequest
) -> None:
"""Check transaction requirements against trust registry for prover"""
Expand Down
4 changes: 2 additions & 2 deletions shared/util/rich_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def __init__(
verify=ssl_context,
raise_status_error=True,
retries: int = 3,
retry_on: List[int] = [502, 503],
retry_on: Optional[List[int]] = None,
retry_wait_seconds: float = 0.5,
**kwargs,
) -> None:
super().__init__(verify=verify, *args, **kwargs)
self.name = name + " - HTTP" if name else "HTTP" # prepended to exceptions
self.raise_status_error = raise_status_error
self.retries = retries
self.retry_on = retry_on
self.retry_on = retry_on if retry_on is not None else [502, 503]
self.retry_wait_seconds = retry_wait_seconds

async def _handle_response(self, response: Response) -> Response:
Expand Down

0 comments on commit 72b35e1

Please sign in to comment.