From 60617cf8eea1684db9c54de314356fbe27ae6570 Mon Sep 17 00:00:00 2001 From: pulpbot Date: Sun, 7 Apr 2024 02:34:49 +0000 Subject: [PATCH 1/2] Update CI files [noissue] --- .github/template_gitref | 2 +- .github/workflows/scripts/script.sh | 1 + doc_requirements.txt | 5 ++++- docs/template_gitref | 2 +- lint_requirements.txt | 2 +- template_config.yml | 4 +++- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/template_gitref b/.github/template_gitref index d42a1cd95..9ec4e6fe6 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-324-gb820cc2 +2021.08.26-326-ge5addc7 diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 4a6da08b2..a90289cd9 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -31,6 +31,7 @@ if [[ "$TEST" = "docs" ]]; then if [[ "$GITHUB_WORKFLOW" == "Deb CI" ]]; then towncrier build --yes --version 4.0.0.ci fi + # Legacy Docs Build cd docs make PULP_URL="$PULP_URL" diagrams html tar -cvf docs.tar ./_build diff --git a/doc_requirements.txt b/doc_requirements.txt index 46e02a753..457f9ee63 100644 --- a/doc_requirements.txt +++ b/doc_requirements.txt @@ -5,11 +5,14 @@ # # For more info visit https://github.com/pulp/plugin_template -r requirements.txt +towncrier + +# Legacy docs plantuml sphinx~=7.1.2 sphinx-rtd-theme==1.3.0 sphinxcontrib-jquery sphinxcontrib-openapi -towncrier mistune<4.0.0 Jinja2<3.2 +# Extra requirements diff --git a/docs/template_gitref b/docs/template_gitref index d42a1cd95..9ec4e6fe6 100644 --- a/docs/template_gitref +++ b/docs/template_gitref @@ -1 +1 @@ -2021.08.26-324-gb820cc2 +2021.08.26-326-ge5addc7 diff --git a/lint_requirements.txt b/lint_requirements.txt index 860678007..ac90356f7 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template # python packages handy for developers, but not required by pulp -black==23.12.1 +black==24.3.0 check-manifest flake8 flake8-black diff --git a/template_config.yml b/template_config.yml index d5e862099..4fc82a6d6 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,7 +1,7 @@ # This config represents the latest values used when running the plugin-template. Any settings that # were not present before running plugin-template have been added with their default values. -# generated with plugin_template@2021.08.26-319-ga283c28 +# generated with plugin_template@2021.08.26-326-ge5addc7 api_root: /pulp/ black: true @@ -84,4 +84,6 @@ test_performance: test_reroute: true test_s3: true use_issue_template: true +use_legacy_docs: true +use_unified_docs: false From 84ae851866bd4c369d592895dba57b7384e154dd Mon Sep 17 00:00:00 2001 From: pulpbot Date: Sun, 7 Apr 2024 02:34:52 +0000 Subject: [PATCH 2/2] Reformat with black [noissue] --- .ci/scripts/schema.py | 1 + pulp_deb/app/models/content/content.py | 1 + pulp_deb/app/models/content/structure_content.py | 1 + pulp_deb/app/models/content/verbatim_metadata.py | 1 + pulp_deb/app/serializers/content_serializers.py | 6 +++--- pulp_deb/tests/functional/api/test_crud_content_unit.py | 1 + pulp_deb/tests/functional/api/test_crud_packages.py | 1 + pulp_deb/tests/functional/api/test_crud_remotes.py | 1 + pulp_deb/tests/functional/api/test_download_content.py | 1 + pulp_deb/tests/functional/api/test_download_policies.py | 1 + pulp_deb/tests/functional/api/test_duplicate_packages.py | 1 + pulp_deb/tests/functional/api/test_publish.py | 6 +++--- pulp_deb/tests/functional/api/test_pulp_to_pulp.py | 1 + pulp_deb/tests/functional/api/test_pulpexport_pulpimport.py | 1 + pulp_deb/tests/functional/api/test_sync.py | 1 + pulp_deb/tests/performance/test_publish.py | 1 + pulp_deb/tests/performance/test_pulp_to_pulp.py | 1 + pulp_deb/tests/performance/test_sync.py | 1 + 18 files changed, 22 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_deb/app/models/content/content.py b/pulp_deb/app/models/content/content.py index ab58790c5..04344907e 100644 --- a/pulp_deb/app/models/content/content.py +++ b/pulp_deb/app/models/content/content.py @@ -6,6 +6,7 @@ like language and Debian installer files. Not included are models for metadata files like Release files or APT repository package indices. """ + import os from django.db import models diff --git a/pulp_deb/app/models/content/structure_content.py b/pulp_deb/app/models/content/structure_content.py index 7e3c095f6..4bd167659 100644 --- a/pulp_deb/app/models/content/structure_content.py +++ b/pulp_deb/app/models/content/structure_content.py @@ -10,6 +10,7 @@ information. This ensures, that copying structure content between different Pulp repositories, does not inadvertantly copy anything that is not structure relevant. """ + import os from django.db import models diff --git a/pulp_deb/app/models/content/verbatim_metadata.py b/pulp_deb/app/models/content/verbatim_metadata.py index 4cbf2aba1..e20b19c6d 100644 --- a/pulp_deb/app/models/content/verbatim_metadata.py +++ b/pulp_deb/app/models/content/verbatim_metadata.py @@ -4,6 +4,7 @@ (down to the checksum) as it was synced from some upstream APT repostiroy. These metadata types are exclusively used for verbatim publications. """ + from django.db import models from pulpcore.plugin.models import Content diff --git a/pulp_deb/app/serializers/content_serializers.py b/pulp_deb/app/serializers/content_serializers.py index 2c4486e14..3156e4ee7 100644 --- a/pulp_deb/app/serializers/content_serializers.py +++ b/pulp_deb/app/serializers/content_serializers.py @@ -1169,9 +1169,9 @@ def deferred_validate(self, data): " and sha256 '{sha256}'." ).format(name=source["name"], sha256=source["sha256"]) ) - artifacts[ - os.path.join(os.path.dirname(data["relative_path"]), source["name"]) - ] = content.first() + artifacts[os.path.join(os.path.dirname(data["relative_path"]), source["name"])] = ( + content.first() + ) data["artifacts"] = artifacts return data diff --git a/pulp_deb/tests/functional/api/test_crud_content_unit.py b/pulp_deb/tests/functional/api/test_crud_content_unit.py index 078423ab9..4662fd111 100644 --- a/pulp_deb/tests/functional/api/test_crud_content_unit.py +++ b/pulp_deb/tests/functional/api/test_crud_content_unit.py @@ -1,4 +1,5 @@ """Tests that perform actions over content unit.""" + from uuid import uuid4 import pytest diff --git a/pulp_deb/tests/functional/api/test_crud_packages.py b/pulp_deb/tests/functional/api/test_crud_packages.py index b6d7177a6..0cec84795 100644 --- a/pulp_deb/tests/functional/api/test_crud_packages.py +++ b/pulp_deb/tests/functional/api/test_crud_packages.py @@ -1,4 +1,5 @@ """Tests that perform actions over packages.""" + from uuid import uuid4 import pytest diff --git a/pulp_deb/tests/functional/api/test_crud_remotes.py b/pulp_deb/tests/functional/api/test_crud_remotes.py index 7c488fdcf..3373ee169 100644 --- a/pulp_deb/tests/functional/api/test_crud_remotes.py +++ b/pulp_deb/tests/functional/api/test_crud_remotes.py @@ -1,4 +1,5 @@ """Tests that CRUD deb remotes.""" + from random import choice from uuid import uuid4 import pytest diff --git a/pulp_deb/tests/functional/api/test_download_content.py b/pulp_deb/tests/functional/api/test_download_content.py index efcc58e64..0c4290b5c 100644 --- a/pulp_deb/tests/functional/api/test_download_content.py +++ b/pulp_deb/tests/functional/api/test_download_content.py @@ -1,4 +1,5 @@ """Tests that verify download of content served by Pulp.""" + import os import pytest import hashlib diff --git a/pulp_deb/tests/functional/api/test_download_policies.py b/pulp_deb/tests/functional/api/test_download_policies.py index 2fbd7bdb9..3c2d0403a 100644 --- a/pulp_deb/tests/functional/api/test_download_policies.py +++ b/pulp_deb/tests/functional/api/test_download_policies.py @@ -1,4 +1,5 @@ """Tests for Pulp download policies.""" + import pytest from pulp_deb.tests.functional.constants import DEB_FIXTURE_PACKAGE_COUNT, DEB_FIXTURE_SUMMARY diff --git a/pulp_deb/tests/functional/api/test_duplicate_packages.py b/pulp_deb/tests/functional/api/test_duplicate_packages.py index d9e918c0a..f0832f2ae 100644 --- a/pulp_deb/tests/functional/api/test_duplicate_packages.py +++ b/pulp_deb/tests/functional/api/test_duplicate_packages.py @@ -8,6 +8,7 @@ To ensure this is the case we use the handle_duplicate_packages function. As such, these tests are primarily intended to test this function. """ + import pytest from uuid import uuid4 diff --git a/pulp_deb/tests/functional/api/test_publish.py b/pulp_deb/tests/functional/api/test_publish.py index 1ff174f00..9108e7082 100644 --- a/pulp_deb/tests/functional/api/test_publish.py +++ b/pulp_deb/tests/functional/api/test_publish.py @@ -497,7 +497,7 @@ def parse_package_index(pkg_idx): """ packages = {} for package in deb822.Packages.iter_paragraphs(pkg_idx, use_apt_pkg=False): - packages[ - "-".join([package["Package"], package["Version"], package["Architecture"]]) - ] = package + packages["-".join([package["Package"], package["Version"], package["Architecture"]])] = ( + package + ) return packages diff --git a/pulp_deb/tests/functional/api/test_pulp_to_pulp.py b/pulp_deb/tests/functional/api/test_pulp_to_pulp.py index 71839152e..cce6880be 100644 --- a/pulp_deb/tests/functional/api/test_pulp_to_pulp.py +++ b/pulp_deb/tests/functional/api/test_pulp_to_pulp.py @@ -1,4 +1,5 @@ """Tests that verify download of content served by Pulp.""" + import pytest from pulp_deb.tests.functional.constants import ( diff --git a/pulp_deb/tests/functional/api/test_pulpexport_pulpimport.py b/pulp_deb/tests/functional/api/test_pulpexport_pulpimport.py index 56d231ce9..4f519e874 100644 --- a/pulp_deb/tests/functional/api/test_pulpexport_pulpimport.py +++ b/pulp_deb/tests/functional/api/test_pulpexport_pulpimport.py @@ -4,6 +4,7 @@ NOTE: assumes ALLOWED_EXPORT_PATHS and ALLOWED_IMPORT_PATHS settings contain "/tmp" all tests will fail if that is not the case. """ + import pytest from uuid import uuid4 diff --git a/pulp_deb/tests/functional/api/test_sync.py b/pulp_deb/tests/functional/api/test_sync.py index 54ebb7c7a..fde4c207d 100644 --- a/pulp_deb/tests/functional/api/test_sync.py +++ b/pulp_deb/tests/functional/api/test_sync.py @@ -1,4 +1,5 @@ """Tests that sync deb repositories in optimized mode.""" + import pytest from pulpcore.tests.functional.utils import PulpTaskError diff --git a/pulp_deb/tests/performance/test_publish.py b/pulp_deb/tests/performance/test_publish.py index 63694083a..d46bf1ca7 100644 --- a/pulp_deb/tests/performance/test_publish.py +++ b/pulp_deb/tests/performance/test_publish.py @@ -1,4 +1,5 @@ """Tests that publish deb plugin repositories.""" + import pytest from pulp_deb.tests.performance.utils import write_csv_to_tmp diff --git a/pulp_deb/tests/performance/test_pulp_to_pulp.py b/pulp_deb/tests/performance/test_pulp_to_pulp.py index 38de61cbb..b9eac1a06 100644 --- a/pulp_deb/tests/performance/test_pulp_to_pulp.py +++ b/pulp_deb/tests/performance/test_pulp_to_pulp.py @@ -1,4 +1,5 @@ """Tests that verify download of deb content served by Pulp.""" + import pytest from pulp_deb.tests.performance.utils import write_csv_to_tmp diff --git a/pulp_deb/tests/performance/test_sync.py b/pulp_deb/tests/performance/test_sync.py index 2d5ced61d..b4859e3a5 100644 --- a/pulp_deb/tests/performance/test_sync.py +++ b/pulp_deb/tests/performance/test_sync.py @@ -1,4 +1,5 @@ """Tests that sync deb plugin repositories.""" + import pytest from pulp_deb.tests.performance.utils import write_csv_to_tmp