From 338664d43f533d6bd35499eb363b0bf13998d6b6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:42:00 +0000 Subject: [PATCH] [pre-commit.ci] Apply automatic pre-commit fixes --- .../_internal/server/app.py | 4 ++- .../_internal/server/views/registry.py | 27 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/conda-store-server/conda_store_server/_internal/server/app.py b/conda-store-server/conda_store_server/_internal/server/app.py index 748c9e346..18cb246f9 100644 --- a/conda-store-server/conda_store_server/_internal/server/app.py +++ b/conda-store-server/conda_store_server/_internal/server/app.py @@ -83,7 +83,9 @@ class CondaStoreServer(Application): ) enable_registry = Bool( - False, help="(deprecated) enable the docker registry for conda-store", config=True + False, + help="(deprecated) enable the docker registry for conda-store", + config=True, ) enable_metrics = Bool( diff --git a/conda-store-server/conda_store_server/_internal/server/views/registry.py b/conda-store-server/conda_store_server/_internal/server/views/registry.py index b95c496cf..1eebec91a 100644 --- a/conda-store-server/conda_store_server/_internal/server/views/registry.py +++ b/conda-store-server/conda_store_server/_internal/server/views/registry.py @@ -81,7 +81,10 @@ def replace_words(s, words): def get_docker_image_manifest(conda_store, image, tag, timeout=10 * 60): namespace, *image_name = image.split("/") - response_headers = {"Deprecation": "True", "Sunset": "Mon, 16 Feb 2025 23:59:59 UTC"} + response_headers = { + "Deprecation": "True", + "Sunset": "Mon, 16 Feb 2025 23:59:59 UTC", + } # /v2//manifest/ if len(image_name) == 0: @@ -106,7 +109,10 @@ def get_docker_image_manifest(conda_store, image, tag, timeout=10 * 60): elif tag.startswith("sha256:"): # looking for sha256 of docker manifest manifests_key = f"docker/manifest/{tag}" - return RedirectResponse(conda_store.storage.get_url(manifests_key), response_headers=response_headers) + return RedirectResponse( + conda_store.storage.get_url(manifests_key), + response_headers=response_headers, + ) else: build_key = tag @@ -127,13 +133,20 @@ def get_docker_image_manifest(conda_store, image, tag, timeout=10 * 60): return docker_error_message(schema.DockerRegistryError.MANIFEST_UNKNOWN) manifests_key = f"docker/manifest/{build_key}" - return RedirectResponse(conda_store.storage.get_url(manifests_key), response_headers=response_headers) + return RedirectResponse( + conda_store.storage.get_url(manifests_key), response_headers=response_headers + ) def get_docker_image_blob(conda_store, image, blobsum): blob_key = f"docker/blobs/{blobsum}" - response_headers = {"Deprecation": "True", "Sunset": "Mon, 16 Feb 2025 23:59:59 UTC"} - return RedirectResponse(conda_store.storage.get_url(blob_key), response_headers=response_headers) + response_headers = { + "Deprecation": "True", + "Sunset": "Mon, 16 Feb 2025 23:59:59 UTC", + } + return RedirectResponse( + conda_store.storage.get_url(blob_key), response_headers=response_headers + ) @router_registry.get("/v2/", deprecated=True) @@ -147,9 +160,7 @@ def v2( return _json_response({}) -@router_registry.get( - "/v2/{rest:path}", deprecated=True -) +@router_registry.get("/v2/{rest:path}", deprecated=True) def list_tags( rest: str, request: Request,