From b9485ebc9563ca97d27dc98286c119f11197f878 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 19 Jun 2024 15:23:33 -0500 Subject: [PATCH] dev pip-compile: switch devel branch pip-compile to 3.11 This adjusts the devel branch to use Python 3.11 to generate dependencies with pip-compile. This also adjusts the pip-compile-dev workflow to run separate jobs for the stable branches, which will still use Python 3.10 for requirements files. It's not a very DRY approach; Github Actions does not support loops. Fixes: https://github.com/ansible/ansible-documentation/issues/1614 Fixes: https://github.com/ansible/ansible-documentation/issues/1450 --- .github/workflows/pip-compile-dev.yml | 70 +++++++++++++++++++++- .github/workflows/pip-compile-docs.yml | 2 +- .github/workflows/reusable-pip-compile.yml | 3 +- noxfile.py | 2 +- 4 files changed, 72 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pip-compile-dev.yml b/.github/workflows/pip-compile-dev.yml index c648cd9dcf9..22ee769e510 100644 --- a/.github/workflows/pip-compile-dev.yml +++ b/.github/workflows/pip-compile-dev.yml @@ -34,11 +34,77 @@ jobs: message: "ci: refresh dev dependencies" base-branch: "${{ inputs.base-branch || 'devel' }}" pr-branch: "${{ inputs.pr-branch || 'pip-compile/devel/dev' }}" + nox-args: >- + -e 'pip-compile-3.11(formatters)' + 'pip-compile-3.11(typing)' + 'pip-compile-3.11(static)' + 'pip-compile-3.11(spelling)' + reset-branch: "${{ inputs.reset-branch || false }}" + labels: "${{ inputs.labels || 'no_backport,tooling' }}" + secrets: inherit + + # Additional jobs for stable branches. Only run when scheduled. + refresh_217: + name: "Refresh dev dependencies - 2.17" + uses: ./.github/workflows/reusable-pip-compile.yml + with: + message: "ci: refresh dev dependencies" + base-branch: "stable-2.17" + pr-branch: "pip-compile/stable-2.17/dev" nox-args: >- -e 'pip-compile-3.10(formatters)' 'pip-compile-3.10(typing)' 'pip-compile-3.10(static)' 'pip-compile-3.10(spelling)' - reset-branch: "${{ inputs.reset-branch || false }}" - labels: "${{ inputs.labels || 'backport-2.14,backport-2.15,backport-2.16,backport-2.17,tooling' }}" + reset-branch: false + labels: "tooling" + secrets: inherit + if: ${{ github.event_name == 'schedule' }} + refresh_216: + name: "Refresh dev dependencies - 2.16" + uses: ./.github/workflows/reusable-pip-compile.yml + with: + message: "ci: refresh dev dependencies" + base-branch: "stable-2.16" + pr-branch: "pip-compile/stable-2.16/dev" + nox-args: >- + -e 'pip-compile-3.10(formatters)' + 'pip-compile-3.10(typing)' + 'pip-compile-3.10(static)' + 'pip-compile-3.10(spelling)' + reset-branch: false + labels: "tooling" + secrets: inherit + if: ${{ github.event_name == 'schedule' }} + refresh_215: + name: "Refresh dev dependencies - 2.15" + uses: ./.github/workflows/reusable-pip-compile.yml + with: + message: "ci: refresh dev dependencies" + base-branch: "stable-2.15" + pr-branch: "pip-compile/stable-2.15/dev" + nox-args: >- + -e 'pip-compile-3.10(formatters)' + 'pip-compile-3.10(typing)' + 'pip-compile-3.10(static)' + 'pip-compile-3.10(spelling)' + reset-branch: false + labels: "tooling" + secrets: inherit + if: ${{ github.event_name == 'schedule' }} + refresh_214: + name: "Refresh dev dependencies - 2.14" + uses: ./.github/workflows/reusable-pip-compile.yml + with: + message: "ci: refresh dev dependencies" + base-branch: "stable-2.14" + pr-branch: "pip-compile/stable-2.14/dev" + nox-args: >- + -e 'pip-compile-3.10(formatters)' + 'pip-compile-3.10(typing)' + 'pip-compile-3.10(static)' + 'pip-compile-3.10(spelling)' + reset-branch: false + labels: "tooling" secrets: inherit + if: ${{ github.event_name == 'schedule' }} diff --git a/.github/workflows/pip-compile-docs.yml b/.github/workflows/pip-compile-docs.yml index 6c90c24e10c..a1f3c0cfbe9 100644 --- a/.github/workflows/pip-compile-docs.yml +++ b/.github/workflows/pip-compile-docs.yml @@ -34,7 +34,7 @@ jobs: message: "ci: refresh docs build dependencies" base-branch: "${{ inputs.base-branch || 'devel' }}" pr-branch: "${{ inputs.pr-branch || 'pip-compile/devel/docs' }}" - nox-args: "-e 'pip-compile-3.10(requirements)' 'pip-compile-3.10(requirements-relaxed)'" + nox-args: "-e 'pip-compile-3.11(requirements)' 'pip-compile-3.11(requirements-relaxed)'" reset-branch: "${{ inputs.reset-branch || false }}" labels: "${{ inputs.labels || 'doc builds,no_backport' }}" secrets: inherit diff --git a/.github/workflows/reusable-pip-compile.yml b/.github/workflows/reusable-pip-compile.yml index 0fcae147eec..b96bd0353a0 100644 --- a/.github/workflows/reusable-pip-compile.yml +++ b/.github/workflows/reusable-pip-compile.yml @@ -88,6 +88,7 @@ jobs: base_branch: "${{ inputs.base-branch }}" pr_branch: "${{ inputs.pr-branch }}" message: "${{ inputs.message }}" + pr_title: "[${{ inputs.base-branch }}] ${{ inputs.message }}" changed_files: "${{ inputs.changed-files }}" labels: "${{ inputs.labels }}" run: | @@ -105,7 +106,7 @@ jobs: then command=(gh pr create --base "${base_branch}" - --title "${message}" + --title "${pr_title}" --body "" --label dependency_update ) diff --git a/noxfile.py b/noxfile.py index fbb0beb757d..8b59212be8c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -88,7 +88,7 @@ def lint(session: nox.Session): ) -@nox.session(name="pip-compile", python=["3.10"]) +@nox.session(name="pip-compile", python=["3.11"]) @nox.parametrize(["req"], requirements_files, requirements_files) def pip_compile(session: nox.Session, req: str): # .pip-tools.toml was introduced in v7