From c5a3d4078d67f72aebe1ed892efad4ac7ff4794b Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Tue, 14 Oct 2025 10:04:49 +0200 Subject: [PATCH] Allow to use python 3.14 (cherry picked from commit 0f06dd0e39c689d89df6784e996d3898b289791b) --- .github/workflows/build.yml | 2 +- .github/workflows/collect_changes.yml | 2 +- .github/workflows/cookiecutter.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/pr.yml | 2 +- .github/workflows/pr_checks.yml | 2 +- .github/workflows/release_branch.yml | 2 +- .github/workflows/test.yml | 4 +- .../.github/workflows/build.yml | 2 +- .../.github/workflows/collect_changes.yml | 2 +- .../.github/workflows/cookiecutter.yml | 57 ++++++++++++++++++- .../.github/workflows/lint.yml | 2 +- .../.github/workflows/pr.yml | 2 +- .../.github/workflows/pr_checks.yml | 2 +- .../.github/workflows/release_branch.yml | 2 +- .../.github/workflows/test.yml | 2 +- pulp-glue/pyproject.toml | 2 +- pulp_cli/generic.py | 3 +- pyproject.toml | 2 +- 19 files changed, 76 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcb24a3b8..08389fbd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.14" - name: "Install python dependencies" run: | pip install build setuptools wheel diff --git a/.github/workflows/collect_changes.yml b/.github/workflows/collect_changes.yml index 7db5e6efd..ebe429afe 100644 --- a/.github/workflows/collect_changes.yml +++ b/.github/workflows/collect_changes.yml @@ -14,7 +14,7 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot diff --git a/.github/workflows/cookiecutter.yml b/.github/workflows/cookiecutter.yml index 9ba12098e..ee59331f3 100644 --- a/.github/workflows/cookiecutter.yml +++ b/.github/workflows/cookiecutter.yml @@ -24,7 +24,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0910b0394..2bc6eb751 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: matrix: python: - "3.11" - - "3.13" + - "3.14" steps: - uses: "actions/checkout@v5" - uses: "actions/cache@v4" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a439236e1..9f0d630cd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -39,7 +39,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Install python dependencies" run: | pip install toml pygithub diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index 912d1aa9a..ec590e501 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v5" with: - python-version: "3.12" + python-version: "3.x" - name: "Determine PR labels" run: | pip install GitPython==3.1.42 diff --git a/.github/workflows/release_branch.yml b/.github/workflows/release_branch.yml index f81ea9b80..aedcbf4c8 100644 --- a/.github/workflows/release_branch.yml +++ b/.github/workflows/release_branch.yml @@ -13,7 +13,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a4a4fccc..5dcc4e764 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.12" + python-version: "3.14" - name: "Install Python Test Dependencies" run: | pip install dist/pulp_cli-*.whl pulp-glue/dist/pulp_glue-*.whl -r test_requirements.txt @@ -59,7 +59,7 @@ jobs: - image_tag: "3.63" pulp_https: "true" pulp_oauth2: "true" - python: "3.10" + python: "3.14" - image_tag: "3.49" pulp_https: "true" python: "3.10" diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/build.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/build.yml index 76fc03066..61af6b250 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/build.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.14" - name: "Install python dependencies" run: | pip install build setuptools wheel diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/collect_changes.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/collect_changes.yml index 7db5e6efd..ebe429afe 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/collect_changes.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/collect_changes.yml @@ -14,7 +14,7 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/cookiecutter.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/cookiecutter.yml index 47174ac2e..339782ac6 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/cookiecutter.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/cookiecutter.yml @@ -26,7 +26,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot @@ -63,4 +63,59 @@ jobs: GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" continue-on-error: true {%- endraw %} + {%- if cookiecutter.app_label %} + update-dependencies: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v5" + with: + repository: "pulp/pulp-cli" + path: "pulp-cli" + - uses: "actions/checkout@v5" + with: + {%- raw %} + token: "${{ secrets.RELEASE_TOKEN }}" + {%- endraw %} + path: "pulp-cli{{ cookiecutter.__app_label_suffix }}" + - name: "Set up Python" + uses: "actions/setup-python@v6" + with: + python-version: "3.x" + - name: "Setup git" + run: | + git config user.name pulpbot + git config user.email pulp-infra@redhat.com + - name: "Install python dependencies" + run: | + pip install packaging tomlkit + - name: "Apply cookiecutter templates" + run: | + ../pulp-cli/cookiecutter/update_pulp_cli.py + if [ "$(git status --porcelain)" ] + then + git add . + git commit -m "Update CLI and GLUE" + fi + - name: "Create Pull Request" + uses: "peter-evans/create-pull-request@v7" + id: "create_pr" + with: + {%- raw %} + token: "${{ secrets.RELEASE_TOKEN }}" + {%- endraw %} + title: "Update CLI and GLUE" + body: "" + branch: "update_cli" + delete-branch: true + path: "pulp-cli{{ cookiecutter.__app_label_suffix }}" + {%- raw %} + - name: "Mark PR automerge" + run: | + gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" + if: "steps.create_pr.outputs.pull-request-number" + env: + GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + continue-on-error: true + {%- endraw %} + {%- endif %} ... diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml index deba122ea..a75c6fb2b 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: matrix: python: - "3.11" - - "3.13" + - "3.14" steps: - uses: "actions/checkout@v5" {%- include "cache_action" %} diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr.yml index bc8885b98..a3c17ed01 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr.yml @@ -41,7 +41,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Install python dependencies" run: | pip install toml pygithub diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr_checks.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr_checks.yml index 912d1aa9a..ec590e501 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr_checks.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr_checks.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v5" with: - python-version: "3.12" + python-version: "3.x" - name: "Determine PR labels" run: | pip install GitPython==3.1.42 diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/release_branch.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/release_branch.yml index f81ea9b80..aedcbf4c8 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/release_branch.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/release_branch.yml @@ -13,7 +13,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml index fbd85ce78..501aacc83 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v5" with: - python-version: "3.12" + python-version: "3.14" - name: "Install Python Test Dependencies" run: | pip install dist/pulp_cli{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/pulp_glue{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- endif %} -r test_requirements.txt diff --git a/pulp-glue/pyproject.toml b/pulp-glue/pyproject.toml index c2a95e16a..e5a33bbe3 100644 --- a/pulp-glue/pyproject.toml +++ b/pulp-glue/pyproject.toml @@ -7,7 +7,7 @@ name = "pulp-glue" version = "0.36.1.dev" description = "Version agnostic glue library to talk to pulpcore's REST API." readme = "README.md" -requires-python = ">=3.9,<3.14" +requires-python = ">=3.9,<3.15" license = {text = "GPLv2+"} authors = [ {name = "Pulp Team", email = "pulp-list@redhat.com"}, diff --git a/pulp_cli/generic.py b/pulp_cli/generic.py index 26089d8bf..3d7f07a43 100644 --- a/pulp_cli/generic.py +++ b/pulp_cli/generic.py @@ -675,7 +675,8 @@ def load_labels_callback( def create_content_json_callback( - context_class: t.Optional[t.Type[PulpContentContext]] = None, schema: s.Schema = None + context_class: t.Optional[t.Type[PulpContentContext]] = None, + schema: t.Optional[s.Schema] = None, ) -> t.Any: @load_file_wrapper def _callback( diff --git a/pyproject.toml b/pyproject.toml index 58b23af2f..6f829357f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pulp-cli" version = "0.36.1.dev" description = "Command line interface to talk to pulpcore's REST API." readme = "README.md" -requires-python = ">=3.9,<3.14" +requires-python = ">=3.9,<3.15" license = {text = "GPLv2+"} authors = [ {name = "Pulp Team", email = "pulp-list@redhat.com"},