From 992ebe311ac16b382b2e1f26ec77bfe4653e7e82 Mon Sep 17 00:00:00 2001 From: pulpbot Date: Tue, 28 Apr 2026 08:30:07 +0000 Subject: [PATCH 1/2] Update CI files --- .ci/ansible/Containerfile.j2 | 8 +++---- .ci/scripts/check_gettext.sh | 21 ------------------- .github/workflows/lint.yml | 4 ---- .../commands/check_dangling_content.py | 1 + pulp_deb/app/modelresource.py | 1 + pulp_deb/app/models/content/content.py | 1 + pulp_deb/app/models/content/metadata.py | 1 + .../app/models/content/structure_content.py | 1 + .../app/models/content/verbatim_metadata.py | 1 + pulp_deb/app/models/publication.py | 1 + pulp_deb/app/models/remote.py | 1 + pulp_deb/app/models/repository.py | 1 + pulp_deb/app/models/signing_service.py | 1 + .../app/serializers/content_serializers.py | 17 ++++++++------- .../serializers/publication_serializers.py | 3 ++- .../app/serializers/remote_serializers.py | 3 ++- .../app/serializers/repository_serializers.py | 5 +++-- pulp_deb/app/tasks/copy.py | 1 + pulp_deb/app/tasks/publishing.py | 1 + pulp_deb/app/tasks/synchronizing.py | 3 ++- pulp_deb/tests/conftest.py | 1 + .../tests/functional/api/test_crud_remotes.py | 1 + .../functional/api/test_duplicate_packages.py | 1 + pulp_deb/tests/functional/api/test_publish.py | 1 + pulp_deb/tests/functional/api/test_rbac.py | 1 + .../functional/api/test_source_package.py | 1 + pulp_deb/tests/functional/api/test_sync.py | 1 + pulp_deb/tests/functional/conftest.py | 1 + pulp_deb/tests/unit/test_models.py | 1 + pulp_deb/tests/unit/test_serializers.py | 1 + pyproject.toml | 19 +++++++++++++++++ template_config.yml | 1 - 32 files changed, 62 insertions(+), 44 deletions(-) delete mode 100755 .ci/scripts/check_gettext.sh diff --git a/.ci/ansible/Containerfile.j2 b/.ci/ansible/Containerfile.j2 index a446f3394..13b5ff05e 100644 --- a/.ci/ansible/Containerfile.j2 +++ b/.ci/ansible/Containerfile.j2 @@ -10,9 +10,8 @@ ADD ./{{ item.origin }} {{ item.destination }} {%- endfor %} # This MUST be the ONLY call to pip install in inside the container. -RUN pip3 install --upgrade pip setuptools wheel && \ - rm -rf /root/.cache/pip && \ - pip3 install {{ image.source }} +RUN --mount=type=cache,target=/root/.cache/uv uv pip install --upgrade setuptools wheel && \ + uv pip install {{ image.source }} {%- if image.upperbounds | default(false) -%} {{ " " }}-c ./{{ plugin_name }}/upperbounds_constraints.txt {%- endif -%} @@ -22,8 +21,7 @@ RUN pip3 install --upgrade pip setuptools wheel && \ {%- if image.ci_requirements | default(false) -%} {{ " " }}-r ./{{ plugin_name }}/ci_requirements.txt {%- endif -%} -{{ " " }}-c ./{{ plugin_name }}/.ci/assets/ci_constraints.txt && \ - rm -rf /root/.cache/pip +{{ " " }}-c ./{{ plugin_name }}/.ci/assets/ci_constraints.txt {% if pulp_env is defined and pulp_env %} {% for key, value in pulp_env.items() %} diff --git a/.ci/scripts/check_gettext.sh b/.ci/scripts/check_gettext.sh deleted file mode 100755 index e1b70e7ad..000000000 --- a/.ci/scripts/check_gettext.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by it. Please use -# './plugin-template --github pulp_deb' to update this file. -# -# For more info visit https://github.com/pulp/plugin_template - -# make sure this script runs at the repo root -cd "$(dirname "$(realpath -e "$0")")"/../.. - -set -u - -MATCHES="$(grep -n -r --include \*.py "_(f" pulp_deb )" - -if [ $? -ne 1 ]; then - printf "\nERROR: Detected mix of f-strings and gettext:\n" - echo "$MATCHES" - exit 1 -fi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3e963b275..75c475213 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -44,10 +44,6 @@ jobs: run: | ruff check - - name: "Check for common gettext problems" - run: | - sh .ci/scripts/check_gettext.sh - - name: "Run extra lint checks" run: | [ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh diff --git a/pulp_deb/app/management/commands/check_dangling_content.py b/pulp_deb/app/management/commands/check_dangling_content.py index e0f5f01d5..276a57308 100644 --- a/pulp_deb/app/management/commands/check_dangling_content.py +++ b/pulp_deb/app/management/commands/check_dangling_content.py @@ -1,6 +1,7 @@ from gettext import gettext as _ from django.core.management import BaseCommand + from pulpcore.plugin.models import RepositoryVersion from pulp_deb.app.models.content.content import Package diff --git a/pulp_deb/app/modelresource.py b/pulp_deb/app/modelresource.py index 4febf2b2f..b92c0a92d 100644 --- a/pulp_deb/app/modelresource.py +++ b/pulp_deb/app/modelresource.py @@ -1,5 +1,6 @@ from import_export import fields from import_export.widgets import ForeignKeyWidget + from pulpcore.plugin.importexport import BaseContentResource from pulpcore.plugin.modelresources import RepositoryResource from pulpcore.plugin.util import get_domain diff --git a/pulp_deb/app/models/content/content.py b/pulp_deb/app/models/content/content.py index 8eb67dd0a..acc1d6e4e 100644 --- a/pulp_deb/app/models/content/content.py +++ b/pulp_deb/app/models/content/content.py @@ -11,6 +11,7 @@ from django.db import models from django.db.models import JSONField + from pulpcore.plugin.models import Content BOOL_CHOICES = [(True, "yes"), (False, "no")] diff --git a/pulp_deb/app/models/content/metadata.py b/pulp_deb/app/models/content/metadata.py index cdd2fc57e..4809a4b10 100644 --- a/pulp_deb/app/models/content/metadata.py +++ b/pulp_deb/app/models/content/metadata.py @@ -6,6 +6,7 @@ """ from django.db import models + from pulpcore.plugin.models import Content from pulp_deb.app.constants import NULL_VALUE diff --git a/pulp_deb/app/models/content/structure_content.py b/pulp_deb/app/models/content/structure_content.py index 4eb6b9530..00d81fd2c 100644 --- a/pulp_deb/app/models/content/structure_content.py +++ b/pulp_deb/app/models/content/structure_content.py @@ -14,6 +14,7 @@ import os from django.db import models + from pulpcore.plugin.models import Content from pulp_deb.app.models import Package, SourcePackage diff --git a/pulp_deb/app/models/content/verbatim_metadata.py b/pulp_deb/app/models/content/verbatim_metadata.py index fe0f3aaee..4b63efa48 100644 --- a/pulp_deb/app/models/content/verbatim_metadata.py +++ b/pulp_deb/app/models/content/verbatim_metadata.py @@ -6,6 +6,7 @@ """ from django.db import models + from pulpcore.plugin.models import Content BOOL_CHOICES = [(True, "yes"), (False, "no")] diff --git a/pulp_deb/app/models/publication.py b/pulp_deb/app/models/publication.py index 3e030d930..f5b04951c 100644 --- a/pulp_deb/app/models/publication.py +++ b/pulp_deb/app/models/publication.py @@ -4,6 +4,7 @@ from django.db import models from django.utils import timezone from django_lifecycle import AFTER_CREATE, AFTER_UPDATE, hook + from pulpcore.plugin.models import ( AutoAddObjPermsMixin, BaseModel, diff --git a/pulp_deb/app/models/remote.py b/pulp_deb/app/models/remote.py index b23a2e367..82288c741 100644 --- a/pulp_deb/app/models/remote.py +++ b/pulp_deb/app/models/remote.py @@ -1,4 +1,5 @@ from django.db import models + from pulpcore.plugin.models import AutoAddObjPermsMixin, Remote diff --git a/pulp_deb/app/models/repository.py b/pulp_deb/app/models/repository.py index 60aca8fa1..ee40fdd64 100644 --- a/pulp_deb/app/models/repository.py +++ b/pulp_deb/app/models/repository.py @@ -2,6 +2,7 @@ from gettext import gettext as _ from django.db import models + from pulpcore.plugin.models import ( AutoAddObjPermsMixin, BaseModel, diff --git a/pulp_deb/app/models/signing_service.py b/pulp_deb/app/models/signing_service.py index 97561e666..e080489b1 100644 --- a/pulp_deb/app/models/signing_service.py +++ b/pulp_deb/app/models/signing_service.py @@ -2,6 +2,7 @@ import tempfile import gnupg + from pulpcore.plugin.models import SigningService diff --git a/pulp_deb/app/serializers/content_serializers.py b/pulp_deb/app/serializers/content_serializers.py index 66f26f6f6..358f49c01 100644 --- a/pulp_deb/app/serializers/content_serializers.py +++ b/pulp_deb/app/serializers/content_serializers.py @@ -4,6 +4,15 @@ from debian import deb822, debfile from django.conf import settings +from rest_framework.serializers import ( + CharField, + DictField, + Field, + ListField, + Serializer, + ValidationError, +) + from pulpcore.plugin.models import Artifact, Content, CreatedResource from pulpcore.plugin.serializers import ( ContentChecksumSerializer, @@ -14,14 +23,6 @@ SingleArtifactContentUploadSerializer, SingleContentArtifactField, ) -from rest_framework.serializers import ( - CharField, - DictField, - Field, - ListField, - Serializer, - ValidationError, -) from pulp_deb.app.constants import ( NULL_VALUE, diff --git a/pulp_deb/app/serializers/publication_serializers.py b/pulp_deb/app/serializers/publication_serializers.py index 9b707667e..7533b0326 100644 --- a/pulp_deb/app/serializers/publication_serializers.py +++ b/pulp_deb/app/serializers/publication_serializers.py @@ -1,3 +1,5 @@ +from rest_framework.serializers import BooleanField, ValidationError + from pulpcore.plugin.models import Publication from pulpcore.plugin.serializers import ( DetailRelatedField, @@ -5,7 +7,6 @@ PublicationSerializer, RelatedField, ) -from rest_framework.serializers import BooleanField, ValidationError from pulp_deb.app.models import ( AptDistribution, diff --git a/pulp_deb/app/serializers/remote_serializers.py b/pulp_deb/app/serializers/remote_serializers.py index dd6cf7f1d..1c939de41 100644 --- a/pulp_deb/app/serializers/remote_serializers.py +++ b/pulp_deb/app/serializers/remote_serializers.py @@ -1,6 +1,7 @@ +from rest_framework.serializers import BooleanField, CharField, ChoiceField + from pulpcore.plugin.models import Remote from pulpcore.plugin.serializers import RemoteSerializer -from rest_framework.serializers import BooleanField, CharField, ChoiceField from pulp_deb.app.models import AptRemote diff --git a/pulp_deb/app/serializers/repository_serializers.py b/pulp_deb/app/serializers/repository_serializers.py index df5fa4ae0..6728afffa 100644 --- a/pulp_deb/app/serializers/repository_serializers.py +++ b/pulp_deb/app/serializers/repository_serializers.py @@ -2,6 +2,9 @@ from django.db import transaction from jsonschema import Draft7Validator +from rest_framework import serializers +from rest_framework.exceptions import ValidationError as DRFValidationError + from pulpcore.plugin.models import SigningService from pulpcore.plugin.serializers import ( RelatedField, @@ -10,8 +13,6 @@ validate_unknown_fields, ) from pulpcore.plugin.util import get_url -from rest_framework import serializers -from rest_framework.exceptions import ValidationError as DRFValidationError from pulp_deb.app.models import ( AptReleaseSigningService, diff --git a/pulp_deb/app/tasks/copy.py b/pulp_deb/app/tasks/copy.py index 1b721d126..09c226174 100644 --- a/pulp_deb/app/tasks/copy.py +++ b/pulp_deb/app/tasks/copy.py @@ -3,6 +3,7 @@ from django.db import transaction from django.db.models import Q + from pulpcore.plugin.models import RepositoryVersion from pulp_deb.app.models import ( diff --git a/pulp_deb/app/tasks/publishing.py b/pulp_deb/app/tasks/publishing.py index 72ad74cae..8f2064775 100644 --- a/pulp_deb/app/tasks/publishing.py +++ b/pulp_deb/app/tasks/publishing.py @@ -17,6 +17,7 @@ from django.db import transaction from django.db.utils import IntegrityError from django.forms.models import model_to_dict + from pulpcore.plugin.models import ( Artifact, PublishedArtifact, diff --git a/pulp_deb/app/tasks/synchronizing.py b/pulp_deb/app/tasks/synchronizing.py index aa06ccbdb..691c0bae8 100644 --- a/pulp_deb/app/tasks/synchronizing.py +++ b/pulp_deb/app/tasks/synchronizing.py @@ -17,6 +17,8 @@ from debian import deb822 from django.conf import settings from django.db.utils import IntegrityError +from rest_framework.exceptions import ValidationError + from pulpcore.plugin.exceptions import DigestValidationError from pulpcore.plugin.models import ( Artifact, @@ -36,7 +38,6 @@ ResolveContentFutures, Stage, ) -from rest_framework.exceptions import ValidationError from pulp_deb.app.constants import ( CHECKSUM_TYPE_MAP, diff --git a/pulp_deb/tests/conftest.py b/pulp_deb/tests/conftest.py index 221b2d588..e684193d2 100644 --- a/pulp_deb/tests/conftest.py +++ b/pulp_deb/tests/conftest.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest + from pulpcore.client.pulp_deb import ( ApiClient, AptRepositorySyncURL, diff --git a/pulp_deb/tests/functional/api/test_crud_remotes.py b/pulp_deb/tests/functional/api/test_crud_remotes.py index ab386523e..0290bf718 100644 --- a/pulp_deb/tests/functional/api/test_crud_remotes.py +++ b/pulp_deb/tests/functional/api/test_crud_remotes.py @@ -4,6 +4,7 @@ from uuid import uuid4 import pytest + from pulpcore.client.pulp_deb.exceptions import ApiException from pulp_deb.tests.functional.constants import DOWNLOAD_POLICIES diff --git a/pulp_deb/tests/functional/api/test_duplicate_packages.py b/pulp_deb/tests/functional/api/test_duplicate_packages.py index 1509f5f05..62d6fcb4a 100644 --- a/pulp_deb/tests/functional/api/test_duplicate_packages.py +++ b/pulp_deb/tests/functional/api/test_duplicate_packages.py @@ -12,6 +12,7 @@ from uuid import uuid4 import pytest + from pulpcore.tests.functional.utils import PulpTaskError from pulp_deb.tests.functional.constants import DEB_PACKAGE_RELPATH diff --git a/pulp_deb/tests/functional/api/test_publish.py b/pulp_deb/tests/functional/api/test_publish.py index 28df06024..324261b5d 100644 --- a/pulp_deb/tests/functional/api/test_publish.py +++ b/pulp_deb/tests/functional/api/test_publish.py @@ -3,6 +3,7 @@ import pytest from debian import deb822 + from pulpcore.client.pulp_deb.exceptions import ApiException from pulp_deb.tests.functional.constants import ( diff --git a/pulp_deb/tests/functional/api/test_rbac.py b/pulp_deb/tests/functional/api/test_rbac.py index 36549ef50..4a2164f67 100644 --- a/pulp_deb/tests/functional/api/test_rbac.py +++ b/pulp_deb/tests/functional/api/test_rbac.py @@ -1,6 +1,7 @@ """Tests role-based access control.""" import pytest + from pulpcore.client.pulp_deb.exceptions import ApiException from pulp_deb.tests.functional.constants import DEB_PACKAGE_RELPATH diff --git a/pulp_deb/tests/functional/api/test_source_package.py b/pulp_deb/tests/functional/api/test_source_package.py index c0457b195..7c68ca093 100644 --- a/pulp_deb/tests/functional/api/test_source_package.py +++ b/pulp_deb/tests/functional/api/test_source_package.py @@ -5,6 +5,7 @@ from uuid import uuid4 import pytest + from pulpcore.client.pulpcore.exceptions import ApiException from pulp_deb.tests.functional.utils import ( diff --git a/pulp_deb/tests/functional/api/test_sync.py b/pulp_deb/tests/functional/api/test_sync.py index d07905a5c..02c317c09 100644 --- a/pulp_deb/tests/functional/api/test_sync.py +++ b/pulp_deb/tests/functional/api/test_sync.py @@ -1,6 +1,7 @@ """Tests that sync deb repositories in optimized mode.""" import pytest + from pulpcore.tests.functional.utils import PulpTaskError from pulp_deb.tests.functional.constants import ( diff --git a/pulp_deb/tests/functional/conftest.py b/pulp_deb/tests/functional/conftest.py index 7c96e19ec..60fafcd9f 100644 --- a/pulp_deb/tests/functional/conftest.py +++ b/pulp_deb/tests/functional/conftest.py @@ -6,6 +6,7 @@ from uuid import uuid4 import pytest + from pulpcore.client.pulp_deb import ( ContentGenericContentsApi, ContentPackageIndicesApi, diff --git a/pulp_deb/tests/unit/test_models.py b/pulp_deb/tests/unit/test_models.py index d01f8b944..1a7b42a5a 100644 --- a/pulp_deb/tests/unit/test_models.py +++ b/pulp_deb/tests/unit/test_models.py @@ -1,5 +1,6 @@ from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase + from pulpcore.plugin.models import Artifact, ContentArtifact from pulp_deb.app.models import Package diff --git a/pulp_deb/tests/unit/test_serializers.py b/pulp_deb/tests/unit/test_serializers.py index b44b33923..535cdce4c 100644 --- a/pulp_deb/tests/unit/test_serializers.py +++ b/pulp_deb/tests/unit/test_serializers.py @@ -1,6 +1,7 @@ import unittest from django.test import TestCase + from pulpcore.plugin.models import Artifact from pulp_deb.app.models import GenericContent diff --git a/pyproject.toml b/pyproject.toml index 6cc078e73..120fa3abc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -177,3 +177,22 @@ extend-exclude = [ "docs/**", "**/migrations/*.py", ] + +[tool.ruff.lint] +# This section is managed by the plugin template. Do not edit manually. +extend-select = [ + "I", + "INT", + "TID", + "T10", +] + +[tool.ruff.lint.flake8-tidy-imports.banned-api] +# This section is managed by the plugin template. Do not edit manually. +"distutils".msg = "The 'distutils' module has been deprecated since Python 3.9." +"pulpcore.app".msg = "The 'pulpcore' apis must only be consumed via 'pulpcore.plugin'." + +[tool.ruff.lint.isort] +# This section is managed by the plugin template. Do not edit manually. +sections = { second-party = ["pulpcore"] } +section-order = ["future", "standard-library", "third-party", "second-party", "first-party", "local-folder"] diff --git a/template_config.yml b/template_config.yml index ae363a51e..f8b4d02d8 100644 --- a/template_config.yml +++ b/template_config.yml @@ -7,7 +7,6 @@ --- check_commit_message: true -check_gettext: true check_manifest: true check_stray_pulpcore_imports: true ci_base_image: "ghcr.io/pulp/pulp-ci-centos9" From 103fcc468fb8fe35e9c2f6376792d2696a5964a8 Mon Sep 17 00:00:00 2001 From: Jitka Halova Date: Tue, 28 Apr 2026 13:20:17 +0200 Subject: [PATCH 2/2] Resolve ruff check warnings --- pulp_deb/app/serializers/repository_serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulp_deb/app/serializers/repository_serializers.py b/pulp_deb/app/serializers/repository_serializers.py index 6728afffa..b6ad41526 100644 --- a/pulp_deb/app/serializers/repository_serializers.py +++ b/pulp_deb/app/serializers/repository_serializers.py @@ -193,7 +193,7 @@ def validate(self, data): err.append(error.message) if err: raise serializers.ValidationError( - _("Provided copy criteria is invalid:'{}'".format(err)) + _("Provided copy criteria is invalid:'{}'").format(err) ) return data