Pin Python version for precommit action and update flake8 #7172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On pull request branches, the
pre-commit/[email protected]
is failing. For example here.It looks like
actions/setup-python@v5
requires a Python version to be set as it reports the following warnings:Errors are then reported in the pre-commit action:
This issue seems to have been reported to https://github.com/pre-commit/action/ several times - most cases are not using
setup-python
, but some have the same error as the Python version isn't specified - see pre-commit/action#210 (comment)Switching to Python 3.12 caused the flake8 library to report the errors below. I've updated this to use the latest version of flake8 in the
.pre-commit-config.yaml
file.Updating flake8 then causes the following error:
ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'
This is due to changes in the
.flak8
config file format. The GDAL .flake8 file has been updated, so I've updated to the same format: - see OSGeo/gdal#9936It looks like caching means the pre-commit action is still passing on
mapserver/mapserver
.https://github.com/MapServer/MapServer/actions/runs/11366426395/job/31616775459#step:4:61