From 742acc52f8fc44c4d18a41621455b21e2b9133ec Mon Sep 17 00:00:00 2001 From: pulpbot Date: Sun, 7 Apr 2024 02:38:05 +0000 Subject: [PATCH] Reformat with black [noissue] --- .ci/scripts/schema.py | 1 + pulp_container/app/registry.py | 8 +++++--- pulp_container/app/registry_api.py | 1 + pulp_container/app/tasks/sync_stages.py | 9 ++++++--- pulp_container/app/viewsets.py | 1 + .../tests/functional/api/test_content_cache.py | 1 + .../tests/functional/api/test_crud_distributions.py | 1 + pulp_container/tests/functional/api/test_crud_remotes.py | 1 + pulp_container/tests/functional/api/test_flatpak.py | 1 + pulp_container/tests/functional/api/test_pull_content.py | 1 + .../tests/functional/api/test_pulpimportexport.py | 1 + pulp_container/tests/functional/api/test_push_content.py | 1 + .../tests/functional/api/test_push_signatures.py | 1 + .../tests/functional/api/test_rbac_push_repositories.py | 1 + pulp_container/tests/functional/api/test_rbac_remotes.py | 1 + .../tests/functional/api/test_rbac_repo_content.py | 1 + .../tests/functional/api/test_rbac_repo_versions.py | 1 + .../tests/functional/api/test_rbac_sync_repositories.py | 1 + .../tests/functional/api/test_recursive_add.py | 1 + .../tests/functional/api/test_recursive_remove.py | 1 + .../tests/functional/api/test_repositories_list.py | 1 + pulp_container/tests/functional/api/test_sync.py | 1 + .../tests/functional/api/test_tagging_images.py | 1 + .../tests/functional/api/test_token_authentication.py | 1 + pulp_container/tests/functional/utils.py | 1 + 25 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.ci/scripts/schema.py b/.ci/scripts/schema.py index 9f56caa66..91191c5ed 100644 --- a/.ci/scripts/schema.py +++ b/.ci/scripts/schema.py @@ -7,6 +7,7 @@ But some pulp paths start with curly brackets e.g. {artifact_href} This script modifies drf-spectacular schema validation to accept slashes and curly brackets. """ + import json from drf_spectacular.validation import JSON_SCHEMA_SPEC_PATH diff --git a/pulp_container/app/registry.py b/pulp_container/app/registry.py index 007b789a4..c80886fc9 100644 --- a/pulp_container/app/registry.py +++ b/pulp_container/app/registry.py @@ -419,9 +419,11 @@ async def init_pending_content(self, digest, manifest_data, media_type, artifact manifest = Manifest( digest=digest, - schema_version=2 - if manifest_data["mediaType"] in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI) - else 1, + schema_version=( + 2 + if manifest_data["mediaType"] in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI) + else 1 + ), media_type=media_type, config_blob=config_blob, ) diff --git a/pulp_container/app/registry_api.py b/pulp_container/app/registry_api.py index 365aa7a0f..cb8d5694f 100644 --- a/pulp_container/app/registry_api.py +++ b/pulp_container/app/registry_api.py @@ -4,6 +4,7 @@ . _Plugin Writer's Guide: http://docs.pulpproject.org/plugins/plugin-writer/index.html """ + import base64 import binascii import json diff --git a/pulp_container/app/tasks/sync_stages.py b/pulp_container/app/tasks/sync_stages.py index 000a13b0e..536123e10 100644 --- a/pulp_container/app/tasks/sync_stages.py +++ b/pulp_container/app/tasks/sync_stages.py @@ -487,9 +487,12 @@ async def create_listed_manifest(self, manifest_data): manifest = Manifest( digest=digest, - schema_version=2 - if content_data["mediaType"] in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI) - else 1, + schema_version=( + 2 + if content_data["mediaType"] + in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI) + else 1 + ), media_type=content_data["mediaType"], annotations=content_data.get("annotations", {}), ) diff --git a/pulp_container/app/viewsets.py b/pulp_container/app/viewsets.py index 5bba73fea..e42be79f9 100644 --- a/pulp_container/app/viewsets.py +++ b/pulp_container/app/viewsets.py @@ -4,6 +4,7 @@ . _Plugin Writer's Guide: http://docs.pulpproject.org/plugins/plugin-writer/index.html """ + import logging from django.db import IntegrityError diff --git a/pulp_container/tests/functional/api/test_content_cache.py b/pulp_container/tests/functional/api/test_content_cache.py index ecd135964..d3bf14204 100644 --- a/pulp_container/tests/functional/api/test_content_cache.py +++ b/pulp_container/tests/functional/api/test_content_cache.py @@ -1,4 +1,5 @@ """Tests related to the Redis content caching.""" + import os import requests import unittest diff --git a/pulp_container/tests/functional/api/test_crud_distributions.py b/pulp_container/tests/functional/api/test_crud_distributions.py index f91264fa0..87c6df952 100644 --- a/pulp_container/tests/functional/api/test_crud_distributions.py +++ b/pulp_container/tests/functional/api/test_crud_distributions.py @@ -1,4 +1,5 @@ """Tests that CRUD distributions.""" + import json import unittest diff --git a/pulp_container/tests/functional/api/test_crud_remotes.py b/pulp_container/tests/functional/api/test_crud_remotes.py index bc072b05f..f17c5044e 100644 --- a/pulp_container/tests/functional/api/test_crud_remotes.py +++ b/pulp_container/tests/functional/api/test_crud_remotes.py @@ -1,4 +1,5 @@ """Tests that CRUD container remotes.""" + from random import choice import unittest diff --git a/pulp_container/tests/functional/api/test_flatpak.py b/pulp_container/tests/functional/api/test_flatpak.py index cb9c860cf..54cc29341 100644 --- a/pulp_container/tests/functional/api/test_flatpak.py +++ b/pulp_container/tests/functional/api/test_flatpak.py @@ -1,4 +1,5 @@ """Tests that verify Flatpak support""" + import pytest import subprocess diff --git a/pulp_container/tests/functional/api/test_pull_content.py b/pulp_container/tests/functional/api/test_pull_content.py index 0272cbb9f..c0c8d399c 100644 --- a/pulp_container/tests/functional/api/test_pull_content.py +++ b/pulp_container/tests/functional/api/test_pull_content.py @@ -1,4 +1,5 @@ """Tests that verify that images served by Pulp can be pulled.""" + import contextlib import hashlib import requests diff --git a/pulp_container/tests/functional/api/test_pulpimportexport.py b/pulp_container/tests/functional/api/test_pulpimportexport.py index 464b4d1e5..ba227ad89 100644 --- a/pulp_container/tests/functional/api/test_pulpimportexport.py +++ b/pulp_container/tests/functional/api/test_pulpimportexport.py @@ -4,6 +4,7 @@ NOTE: assumes ALLOWED_EXPORT_PATHS setting contains "/tmp" - all tests will fail if this is not the case. """ + import pytest import uuid diff --git a/pulp_container/tests/functional/api/test_push_content.py b/pulp_container/tests/functional/api/test_push_content.py index fa3bd7d0c..6be3c8681 100644 --- a/pulp_container/tests/functional/api/test_push_content.py +++ b/pulp_container/tests/functional/api/test_push_content.py @@ -1,4 +1,5 @@ """Tests that verify that images can be pushed to Pulp.""" + import json import pytest import requests diff --git a/pulp_container/tests/functional/api/test_push_signatures.py b/pulp_container/tests/functional/api/test_push_signatures.py index 5fc19dda2..5a31826f6 100644 --- a/pulp_container/tests/functional/api/test_push_signatures.py +++ b/pulp_container/tests/functional/api/test_push_signatures.py @@ -1,4 +1,5 @@ """Tests that verify that an image signature can be pushed to Pulp.""" + import base64 import json import pytest diff --git a/pulp_container/tests/functional/api/test_rbac_push_repositories.py b/pulp_container/tests/functional/api/test_rbac_push_repositories.py index c8d2f330c..73a646d28 100644 --- a/pulp_container/tests/functional/api/test_rbac_push_repositories.py +++ b/pulp_container/tests/functional/api/test_rbac_push_repositories.py @@ -1,4 +1,5 @@ """Tests that verify that RBAC for push repository works properly.""" + import pytest from pulp_smash import utils diff --git a/pulp_container/tests/functional/api/test_rbac_remotes.py b/pulp_container/tests/functional/api/test_rbac_remotes.py index 462906521..6e7dae056 100644 --- a/pulp_container/tests/functional/api/test_rbac_remotes.py +++ b/pulp_container/tests/functional/api/test_rbac_remotes.py @@ -1,4 +1,5 @@ """Tests that container remotes have RBAC.""" + from random import choice import pytest diff --git a/pulp_container/tests/functional/api/test_rbac_repo_content.py b/pulp_container/tests/functional/api/test_rbac_repo_content.py index 4ffac7681..b87de283e 100644 --- a/pulp_container/tests/functional/api/test_rbac_repo_content.py +++ b/pulp_container/tests/functional/api/test_rbac_repo_content.py @@ -1,4 +1,5 @@ """Tests that verify that RBAC for content works properly.""" + import pytest from pulp_smash.pulp3.bindings import monitor_task diff --git a/pulp_container/tests/functional/api/test_rbac_repo_versions.py b/pulp_container/tests/functional/api/test_rbac_repo_versions.py index 944669a2b..f5cc92f4e 100644 --- a/pulp_container/tests/functional/api/test_rbac_repo_versions.py +++ b/pulp_container/tests/functional/api/test_rbac_repo_versions.py @@ -1,4 +1,5 @@ """Tests that verify that RBAC for repository versions work properly.""" + import pytest from pulp_smash import utils diff --git a/pulp_container/tests/functional/api/test_rbac_sync_repositories.py b/pulp_container/tests/functional/api/test_rbac_sync_repositories.py index d014dcbe4..b8b64e407 100644 --- a/pulp_container/tests/functional/api/test_rbac_sync_repositories.py +++ b/pulp_container/tests/functional/api/test_rbac_sync_repositories.py @@ -1,4 +1,5 @@ """Tests that container sync repositories have RBAC.""" + import pytest from pulp_smash import utils diff --git a/pulp_container/tests/functional/api/test_recursive_add.py b/pulp_container/tests/functional/api/test_recursive_add.py index 91d0171da..6c38345e2 100644 --- a/pulp_container/tests/functional/api/test_recursive_add.py +++ b/pulp_container/tests/functional/api/test_recursive_add.py @@ -1,4 +1,5 @@ """Tests that recursively add container content to repositories.""" + from pulp_smash.pulp3.bindings import ( delete_orphans, monitor_task, diff --git a/pulp_container/tests/functional/api/test_recursive_remove.py b/pulp_container/tests/functional/api/test_recursive_remove.py index d12daf03d..4c7b8c69e 100644 --- a/pulp_container/tests/functional/api/test_recursive_remove.py +++ b/pulp_container/tests/functional/api/test_recursive_remove.py @@ -1,4 +1,5 @@ """Tests that recursively remove container content from repositories.""" + import unittest from urllib.parse import urlparse diff --git a/pulp_container/tests/functional/api/test_repositories_list.py b/pulp_container/tests/functional/api/test_repositories_list.py index 9bbfedf81..98622a0b7 100644 --- a/pulp_container/tests/functional/api/test_repositories_list.py +++ b/pulp_container/tests/functional/api/test_repositories_list.py @@ -1,4 +1,5 @@ """Tests for fetching the list of all repositories.""" + import unittest from urllib.parse import urljoin diff --git a/pulp_container/tests/functional/api/test_sync.py b/pulp_container/tests/functional/api/test_sync.py index 7293e7739..866a2805e 100644 --- a/pulp_container/tests/functional/api/test_sync.py +++ b/pulp_container/tests/functional/api/test_sync.py @@ -1,4 +1,5 @@ """Tests that sync container plugin repositories.""" + import pytest from pulpcore.tests.functional import PulpTaskError diff --git a/pulp_container/tests/functional/api/test_tagging_images.py b/pulp_container/tests/functional/api/test_tagging_images.py index 2cb9abccc..a8ecc541d 100644 --- a/pulp_container/tests/functional/api/test_tagging_images.py +++ b/pulp_container/tests/functional/api/test_tagging_images.py @@ -1,4 +1,5 @@ """Tests for tagging and untagging images.""" + import unittest from urllib.parse import urlparse diff --git a/pulp_container/tests/functional/api/test_token_authentication.py b/pulp_container/tests/functional/api/test_token_authentication.py index 682b88c30..2600dc09c 100644 --- a/pulp_container/tests/functional/api/test_token_authentication.py +++ b/pulp_container/tests/functional/api/test_token_authentication.py @@ -1,4 +1,5 @@ """Tests for token authentication.""" + import aiohttp import asyncio import unittest diff --git a/pulp_container/tests/functional/utils.py b/pulp_container/tests/functional/utils.py index 8c038b467..0e2c6c720 100644 --- a/pulp_container/tests/functional/utils.py +++ b/pulp_container/tests/functional/utils.py @@ -1,4 +1,5 @@ """Utilities for tests for the container plugin.""" + import pytest import requests