Skip to content

Commit

Permalink
dev pip-compile: switch devel branch pip-compile to 3.11
Browse files Browse the repository at this point in the history
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: ansible#1614
Fixes: ansible#1450
  • Loading branch information
gotmax23 committed Jun 19, 2024
1 parent deaf1fd commit b9485eb
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 5 deletions.
70 changes: 68 additions & 2 deletions .github/workflows/pip-compile-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
2 changes: 1 addition & 1 deletion .github/workflows/pip-compile-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .github/workflows/reusable-pip-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -105,7 +106,7 @@ jobs:
then
command=(gh pr create
--base "${base_branch}"
--title "${message}"
--title "${pr_title}"
--body ""
--label dependency_update
)
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b9485eb

Please sign in to comment.