Skip to content

Commit 4f92a39

Browse files
committed
Update Python version requirement to 3.8+ and fix test workflow PR creation
1 parent e190d4c commit 4f92a39

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,32 @@ jobs:
200200
runs-on: ubuntu-latest
201201
steps:
202202
- uses: actions/checkout@v4
203-
- name: Check files using the black formatter
203+
- name: Check Python formatting with black
204204
uses: rickstaa/action-black@v1
205205
id: action_black
206206
with:
207207
black_args: "."
208-
- name: Create Pull Request
209-
if: steps.action_black.outputs.is_formatted == 'true'
210-
uses: peter-evans/create-pull-request@v6
208+
fail_on_error: false # Don't fail, we'll handle it
209+
210+
- name: Comment on PR if formatting needed
211+
if: steps.action_black.outputs.is_formatted == 'true' && github.event_name == 'pull_request'
212+
uses: actions/github-script@v7
211213
with:
212-
token: ${{ secrets.GITHUB_TOKEN }}
213-
title: "Format Python code with psf/black push"
214-
commit-message: ":art: Format Python code with psf/black"
215-
body: |
216-
There appear to be some python formatting errors in ${{ github.sha }}. This pull request
217-
uses the [psf/black](https://github.com/psf/black) formatter to fix these issues.
218-
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
219-
# branch: actions/black
214+
script: |
215+
github.rest.issues.createComment({
216+
issue_number: context.issue.number,
217+
owner: context.repo.owner,
218+
repo: context.repo.repo,
219+
body: '⚠️ **Code formatting issue detected**\n\n' +
220+
'This PR contains Python code that doesn\'t conform to the [Black](https://github.com/psf/black) formatting standard.\n\n' +
221+
'Please run `black .` locally and commit the changes, or use the "Auto-fix formatting" workflow if available.'
222+
})
223+
224+
- name: Fail CI if formatting issues found
225+
if: steps.action_black.outputs.is_formatted == 'true'
226+
run: |
227+
echo "❌ Code formatting issues detected. Please run 'black .' to fix."
228+
exit 1
220229
221230
test-installation:
222231
name: Test Package Installation

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
description = "A comprehensive tool to generate argument_specs.yml files for Ansible collections and roles"
1212
readme = "README.md"
1313
license = {file = "LICENSE"}
14-
requires-python = ">=3.6"
14+
requires-python = ">=3.8"
1515
classifiers = [
1616
"Development Status :: 5 - Production/Stable",
1717
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)