diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py index 611c882c..6e079995 100755 --- a/.ci/scripts/check_release.py +++ b/.ci/scripts/check_release.py @@ -99,9 +99,9 @@ def main(options: argparse.Namespace, template_config: dict[str, t.Any]) -> int: # Warning: This will not work if branch names contain "/" but we don't really care here. heads = [h.split("/")[-1] for h in repo.git.branch("--remote").split("\n")] - available_branches = [h for h in heads if re.fullmatch(RELEASE_BRANCH_REGEX, h)] - available_branches.sort(key=lambda ver: Version(ver)) - available_branches.append(DEFAULT_BRANCH) + available_branches = sorted( + {h for h in heads if re.fullmatch(RELEASE_BRANCH_REGEX, h)}, key=lambda ver: Version(ver) + ) + [DEFAULT_BRANCH] branches = options.branches if branches == "supported": diff --git a/.ci/scripts/check_requirements.py b/.ci/scripts/check_requirements.py index a2c713d3..d3da988b 100755 --- a/.ci/scripts/check_requirements.py +++ b/.ci/scripts/check_requirements.py @@ -9,7 +9,6 @@ import warnings from packaging.requirements import Requirement - CHECK_MATRIX = [ ("pyproject.toml", True, True, True), ("requirements.txt", True, True, True), diff --git a/.ci/scripts/collect_changes.py b/.ci/scripts/collect_changes.py index 15059664..3d3df0a3 100755 --- a/.ci/scripts/collect_changes.py +++ b/.ci/scripts/collect_changes.py @@ -25,7 +25,6 @@ from git import GitCommandError, Repo from packaging.version import parse as parse_version - PYPI_PROJECT = "pulp_ostree" # Read Towncrier settings diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b47d0718..1978f107 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: pulpcore-manager openapi --file "api.json" pulpcore-manager openapi --bindings --component "ostree" --file "ostree-api.json" - name: "Upload Package whl" - uses: "actions/upload-artifact@v5" + uses: "actions/upload-artifact@v7" with: name: "plugin_package" path: "pulp_ostree/dist/" @@ -58,7 +58,7 @@ jobs: retention-days: 5 overwrite: true - name: "Upload API specs" - uses: "actions/upload-artifact@v5" + uses: "actions/upload-artifact@v7" with: name: "api_spec" path: | @@ -77,7 +77,7 @@ jobs: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}" - name: "Upload python client packages" - uses: "actions/upload-artifact@v5" + uses: "actions/upload-artifact@v7" with: name: "python-client.tar" path: | @@ -86,7 +86,7 @@ jobs: retention-days: 5 overwrite: true - name: "Upload python client docs" - uses: "actions/upload-artifact@v5" + uses: "actions/upload-artifact@v7" with: name: "python-client-docs.tar" path: | @@ -104,7 +104,7 @@ jobs: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}" - name: "Upload Ruby client" - uses: "actions/upload-artifact@v5" + uses: "actions/upload-artifact@v7" with: name: "ruby-client.tar" path: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1545b27f..1d479358 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,7 @@ jobs: id-token: "write" steps: - - uses: "actions/download-artifact@v4" + - uses: "actions/download-artifact@v8" with: name: "plugin_package" path: "dist/" @@ -53,7 +53,7 @@ jobs: path: "pulp_ostree" - name: "Download Python client" - uses: "actions/download-artifact@v4" + uses: "actions/download-artifact@v8" with: name: "python-client.tar" path: "pulp_ostree/" @@ -82,7 +82,7 @@ jobs: path: "pulp_ostree" - name: "Download Ruby client" - uses: "actions/download-artifact@v4" + uses: "actions/download-artifact@v8" with: name: "ruby-client.tar" path: "pulp_ostree/" diff --git a/.github/workflows/scripts/stage-changelog-for-default-branch.py b/.github/workflows/scripts/stage-changelog-for-default-branch.py index 4d6bb4ce..61d8c526 100755 --- a/.github/workflows/scripts/stage-changelog-for-default-branch.py +++ b/.github/workflows/scripts/stage-changelog-for-default-branch.py @@ -12,16 +12,13 @@ from git import Repo from git.exc import GitCommandError - -helper = textwrap.dedent( - """\ +helper = textwrap.dedent("""\ Stage the changelog for a release on main branch. Example: $ python .github/workflows/scripts/stage-changelog-for-default-branch.py 3.4.0 - """ -) + """) parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=helper) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6d41f4f..99a7c55b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: docker logs pulp 2>&1 | grep -i pulpcore.deprecation | tee deprecations-${{ matrix.env.TEST }}.txt - name: "Upload Deprecations" - uses: "actions/upload-artifact@v5" + uses: "actions/upload-artifact@v7" with: name: "deprecations-${{ matrix.env.TEST }}" path: "pulp_ostree/deprecations-${{ matrix.env.TEST }}.txt" diff --git a/lint_requirements.txt b/lint_requirements.txt index eac20d34..2dbc9c7d 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -5,7 +5,7 @@ # # For more info visit https://github.com/pulp/plugin_template -black==24.3.0 +black~=26.3 # Pin style to the year. https://black.readthedocs.io/en/stable/faq.html#how-stable-is-black-s-style bump-my-version check-manifest flake8 diff --git a/pulp_ostree/app/serializers.py b/pulp_ostree/app/serializers.py index bb4f72b8..847d8a90 100755 --- a/pulp_ostree/app/serializers.py +++ b/pulp_ostree/app/serializers.py @@ -106,12 +106,10 @@ class OstreeObjectSerializer(platform.SingleArtifactContentSerializer): """A Serializer class for OSTree objects (e.g., dirtree, dirmeta, file).""" typ = serializers.IntegerField( - help_text=_( - """ + help_text=_(""" The type of an object. All values are described by the mapping declared at https://lazka.github.io/pgi-docs/OSTree-1.0/enums.html#OSTree.ObjectType - """ - ), + """), ) checksum = serializers.CharField() @@ -175,25 +173,21 @@ class OstreeRemoteSerializer(platform.RemoteSerializer): child=serializers.CharField(max_length=255), allow_null=True, required=False, - help_text=_( - """ + help_text=_(""" A list of refs to include during a sync. The wildcards *, ? are recognized. 'include_refs' is evaluated before 'exclude_refs'. - """ - ), + """), ) exclude_refs = serializers.ListField( child=serializers.CharField(max_length=255), allow_null=True, required=False, - help_text=_( - """ + help_text=_(""" A list of tags to exclude during a sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'. - """ - ), + """), ) class Meta: diff --git a/pulp_ostree/app/viewsets.py b/pulp_ostree/app/viewsets.py index 026422a5..5cc3e425 100755 --- a/pulp_ostree/app/viewsets.py +++ b/pulp_ostree/app/viewsets.py @@ -24,7 +24,6 @@ from . import models, serializers, tasks - REPO_VIEW_PERM = "ostree.view_ostreerepository" diff --git a/pulp_ostree/tests/functional/utils.py b/pulp_ostree/tests/functional/utils.py index 543ea93c..28c5f0bb 100755 --- a/pulp_ostree/tests/functional/utils.py +++ b/pulp_ostree/tests/functional/utils.py @@ -22,7 +22,6 @@ ) from pulpcore.client.pulp_ostree import ApiClient as OstreeApiClient - cfg = config.get_config() configuration = cfg.get_bindings_config()