diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 65dfb02e..7a006974 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: - c2cciutils/schema-applications.json - applications.md - repo: https://github.com/sbrunner/hooks - rev: 1.1.2 + rev: 1.2.1 hooks: - id: copyright - id: poetry-lock @@ -63,7 +63,7 @@ repos: - pipenv==2024.4.1 # pypi - id: helm-lock - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell exclude: |- @@ -80,7 +80,7 @@ repos: hooks: - id: git-check - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.1 hooks: - id: check-github-actions - id: check-github-workflows @@ -93,7 +93,7 @@ repos: - --builtin-schema - github-workflows-require-timeout - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 39.91.4 + rev: 39.156.0 hooks: - id: renovate-config-validator - repo: https://github.com/sirwart/ripsecrets @@ -102,13 +102,13 @@ repos: - id: ripsecrets - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.4 hooks: - id: ruff-format args: - --line-length=110 - repo: https://github.com/PyCQA/prospector - rev: v1.13.3 + rev: 1.14.0 hooks: - id: prospector args: @@ -117,8 +117,8 @@ repos: - --output-format=pylint additional_dependencies: - prospector-profile-duplicated==1.10.4 # pypi - - prospector-profile-utils==1.15.1 # pypi - - ruff==0.8.6 # pypi + - prospector-profile-utils==1.17.0 # pypi + - ruff==0.9.4 # pypi - repo: https://github.com/mheap/json-schema-spell-checker rev: main hooks: diff --git a/c2cciutils/lib/oidc.py b/c2cciutils/lib/oidc.py index 84a2f951..90c79e60 100755 --- a/c2cciutils/lib/oidc.py +++ b/c2cciutils/lib/oidc.py @@ -45,12 +45,12 @@ def _render_claims(token: str) -> str: If a claim is not present in the claim set, then it is rendered as `MISSING`. -* `sub`: `{claims.get('sub', 'MISSING')}` -* `repository`: `{claims.get('repository', 'MISSING')}` -* `repository_owner`: `{claims.get('repository_owner', 'MISSING')}` -* `repository_owner_id`: `{claims.get('repository_owner_id', 'MISSING')}` -* `job_workflow_ref`: `{claims.get('job_workflow_ref', 'MISSING')}` -* `ref`: `{claims.get('ref')}` +* `sub`: `{claims.get("sub", "MISSING")}` +* `repository`: `{claims.get("repository", "MISSING")}` +* `repository_owner`: `{claims.get("repository_owner", "MISSING")}` +* `repository_owner_id`: `{claims.get("repository_owner_id", "MISSING")}` +* `job_workflow_ref`: `{claims.get("job_workflow_ref", "MISSING")}` +* `ref`: `{claims.get("ref")}` See https://docs.pypi.org/trusted-publishers/troubleshooting/ for more help. """ @@ -112,7 +112,7 @@ def _get_token(hostname: str) -> str: # occurred during minting. if not mint_token_resp.ok: reasons = "\n".join( - f'* `{error["code"]}`: {error["description"]}' + f"* `{error['code']}`: {error['description']}" for error in mint_token_payload["errors"] # noqa: W604 ) diff --git a/c2cciutils/scripts/k8s/wait.py b/c2cciutils/scripts/k8s/wait.py index b46bbe36..4ccbb8a4 100644 --- a/c2cciutils/scripts/k8s/wait.py +++ b/c2cciutils/scripts/k8s/wait.py @@ -11,13 +11,13 @@ def _check_deployment_status(deployments: Any) -> bool: for deployment in deployments["items"]: if not deployment["status"]: - print(f'Waiting status for {deployment["metadata"]["name"]}') + print(f"Waiting status for {deployment['metadata']['name']}") return False for condition in deployment["status"].get("conditions", []): if not condition["status"]: print( - f'::group::Deployment {deployment["metadata"]["name"]} not ready: {condition["message"]}' + f"::group::Deployment {deployment['metadata']['name']} not ready: {condition['message']}" ) print(json.dumps(condition, indent=4)) print("::endgroup::") @@ -25,7 +25,7 @@ def _check_deployment_status(deployments: Any) -> bool: if deployment["status"].get("unavailableReplicas", 0) != 0: print( - f'::group::Deployment {deployment["metadata"]["name"]} not ready there is {deployment["status"].get("unavailableReplicas", 0)} ' + f"::group::Deployment {deployment['metadata']['name']} not ready there is {deployment['status'].get('unavailableReplicas', 0)} " "unavailable replicas" ) print(json.dumps(deployment["status"], indent=4)) @@ -54,7 +54,7 @@ def _check_container_status(pod: Any, status: Any, is_init: bool = False) -> boo status_message = status_message.strip() if status_message == "Completed": return True - print(f'::group::Container not ready in {pod["metadata"]["name"]}: {status_message}') # noqa: E713 + print(f"::group::Container not ready in {pod['metadata']['name']}: {status_message}") # noqa: E713 if status_message_long != status_message: print(status_message_long) print(json.dumps(status, indent=4)) @@ -68,7 +68,7 @@ def _check_pod_status(pods: Any) -> bool: for condition in pod["status"].get("conditions", []): if not condition["status"]: print( - f'::group::Pod not ready in {pod["metadata"]["name"]}: {condition.get("message", condition["type"])}' # noqa: E713 + f"::group::Pod not ready in {pod['metadata']['name']}: {condition.get('message', condition['type'])}" # noqa: E713 ) print(json.dumps(condition, indent=4)) print("::endgroup::") @@ -82,7 +82,7 @@ def _check_pod_status(pods: Any) -> bool: return False if pod["status"].get("phase") not in ("Running", "Succeeded"): - print(f'::group::The Pod {pod["metadata"]["name"]} is not ready: {pod["status"].get("phase")}') + print(f"::group::The Pod {pod['metadata']['name']} is not ready: {pod['status'].get('phase')}") return False return True