diff --git a/.ci/scripts/pr_labels.py b/.ci/scripts/pr_labels.py index 4f801c39..d4ccc5d9 100755 --- a/.ci/scripts/pr_labels.py +++ b/.ci/scripts/pr_labels.py @@ -1,4 +1,10 @@ #!/bin/env python3 +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "gitpython>=3.1.62", +# ] +# /// # This script is running with elevated privileges from the main branch against pull requests. diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index b984f107..86c46dbb 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -40,16 +40,15 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v6" with: - python-version: "3.11" + python-version: "3.14" - name: "Install uv" uses: "astral-sh/setup-uv@v7" with: enable-cache: true - name: "Determine PR labels" run: | - uv pip install GitPython<3.2 git fetch origin ${{ github.event.pull_request.head.sha }} - python .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" + uv run --script .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" - uses: "actions/github-script@v8" name: "Apply PR Labels" with: diff --git a/plugin-template b/plugin-template index 55c29f2f..60124b36 100755 --- a/plugin-template +++ b/plugin-template @@ -20,6 +20,7 @@ import shutil import subprocess import sys import typing as t +from contextlib import suppress from pathlib import Path import jamldump @@ -334,6 +335,13 @@ def load_config(plugin_config_path: Path, verbose: bool) -> tuple[dict[str, t.An if "flake8_ignore" in config: config["lint_ignore"] = config.pop("flake8_ignore") write_new_config = True + # Migrate minio to rustfs + with suppress(KeyError): + if "s3boto3" in config["pulp_settings_s3"]["STORAGES"]["default"]["BACKEND"]: + config["pulp_settings_s3"]["STORAGES"]["default"]["OPTIONS"]["endpoint_url"] = ( + "https://rustfs:9000" + ) + write_new_config = True # remove deprecated options for key in set(config.keys()) - set(DEFAULT_SETTINGS.keys()): config.pop(key) diff --git a/templates/github/.ci/scripts/pr_labels.py b/templates/github/.ci/scripts/pr_labels.py index 0c478a21..d4ccc5d9 100755 --- a/templates/github/.ci/scripts/pr_labels.py +++ b/templates/github/.ci/scripts/pr_labels.py @@ -1,12 +1,18 @@ #!/bin/env python3 +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "gitpython>=3.1.62", +# ] +# /// # This script is running with elevated privileges from the main branch against pull requests. import re import sys -import tomllib from pathlib import Path +import tomllib from git import Repo diff --git a/templates/github/.github/workflows/pr_checks.yml.j2 b/templates/github/.github/workflows/pr_checks.yml.j2 index c612268a..6e9a71cc 100644 --- a/templates/github/.github/workflows/pr_checks.yml.j2 +++ b/templates/github/.github/workflows/pr_checks.yml.j2 @@ -36,13 +36,13 @@ jobs: pull-requests: "write" steps: {{ checkout(depth=0) | indent(6) }} - {{ setup_python() | indent(6) }} + {{ setup_python(pyversion="3.14") | indent(6) }} - name: "Determine PR labels" run: | {%- raw %} uv pip install GitPython==3.1.42 git fetch origin ${{ github.event.pull_request.head.sha }} - python .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" + uv run --script .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" {%- endraw %} - uses: "actions/github-script@v8" name: "Apply PR Labels"