From 931469484ecbae1f7254e6726f9dd11dde37d67c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 16 Oct 2024 20:38:56 +1100 Subject: [PATCH] pyproject.toml: correct autopep8 configuration for 2.3.1 The updated autopep8 was ignoring the "exclude" values because they started with a "./" instead of a "/". The documentation I found doesn't go into details, even if this is a regression in autopep8, update the configuration as it causes "make format" to format files that aren't meant to be modified. --- pyproject.toml | 10 +++++----- tools/utils_maintenance/autopep8_format_paths.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d026fd6357b..d5778fb7eeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,11 +38,11 @@ aggressive = 2 # which can contain their own configuration and be handled separately. # - `./scripts/modules/rna_manual_reference.py` because it's a generated data-file. exclude = """ -./extern/*, -./scripts/addons_core/*, -./scripts/modules/rna_manual_reference.py, -./tools/svn_rev_map/sha1_to_rev.py, -./tools/svn_rev_map/rev_to_sha1.py, +extern/*, +scripts/addons_core/*, +scripts/modules/rna_manual_reference.py, +tools/svn_rev_map/sha1_to_rev.py, +tools/svn_rev_map/rev_to_sha1.py, """ # Omit settings such as `jobs`, `in_place` & `recursive` as they can cause editor utilities that auto-format on save diff --git a/tools/utils_maintenance/autopep8_format_paths.py b/tools/utils_maintenance/autopep8_format_paths.py index 9f92679a63d..7ba29a8593d 100755 --- a/tools/utils_maintenance/autopep8_format_paths.py +++ b/tools/utils_maintenance/autopep8_format_paths.py @@ -27,8 +27,9 @@ from typing import ( Optional, ) +# Temporary, until all platforms update to 2.3.1. VERSION_MIN = (1, 6, 0) -VERSION_MAX_RECOMMENDED = (1, 6, 0) +VERSION_MAX_RECOMMENDED = (2, 3, 1) AUTOPEP8_FORMAT_CMD = "autopep8" AUTOPEP8_FORMAT_DEFAULT_ARGS = ( # Operate on all directories recursively.