Skip to content

Commit c7dd4c4

Browse files
committed
Revert selected changes
1 parent e71dbd4 commit c7dd4c4

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

Tools/build/.ruff.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ select = [
1212
"LOG", # flake8-logging
1313
"PGH", # pygrep-hooks
1414
"PT", # flake8-pytest-style
15-
"PYI", # flake8-pyi
1615
"RUF100", # Ban unused `# noqa` comments
1716
"UP", # pyupgrade
1817
"W", # pycodestyle
@@ -30,10 +29,3 @@ ignore = [
3029
"{check_extension_modules,freeze_modules,generate_re_casefix,generate_sre_constants}.py" = [
3130
"UP031", # Use format specifiers instead of percent format
3231
]
33-
34-
"check_extension_modules.py" = [
35-
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
36-
]
37-
"freeze_modules.py" = [
38-
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
39-
]

Tools/build/compute-changes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
TYPE_CHECKING = False
1818
if TYPE_CHECKING:
19-
from collections.abc import Set as AbstractSet
19+
from collections.abc import Set
2020

2121
GITHUB_DEFAULT_BRANCH = os.environ["GITHUB_DEFAULT_BRANCH"]
2222
GITHUB_CODEOWNERS_PATH = Path(".github/CODEOWNERS")
@@ -102,7 +102,7 @@ def git_branches() -> tuple[str, str]:
102102

103103
def get_changed_files(
104104
ref_a: str = GITHUB_DEFAULT_BRANCH, ref_b: str = "HEAD"
105-
) -> AbstractSet[Path]:
105+
) -> Set[Path]:
106106
"""List the files changed between two Git refs, filtered by change type."""
107107
args = ("git", "diff", "--name-only", f"{ref_a}...{ref_b}", "--")
108108
print(*args)
@@ -113,7 +113,7 @@ def get_changed_files(
113113
return frozenset(map(Path, filter(None, map(str.strip, changed_files))))
114114

115115

116-
def process_changed_files(changed_files: AbstractSet[Path]) -> Outputs:
116+
def process_changed_files(changed_files: Set[Path]) -> Outputs:
117117
run_tests = False
118118
run_ci_fuzz = False
119119
run_docs = False

Tools/build/generate_global_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def get_identifiers_and_strings() -> 'tuple[set[str], dict[str, str]]':
434434
# Give a nice message for common mistakes.
435435
# To cover tricky cases (like "\n") we also generate C asserts.
436436
raise ValueError(
437-
f'do not use &_Py_ID or &_Py_STR for one-character latin-1 '
437+
'do not use &_Py_ID or &_Py_STR for one-character latin-1 '
438438
f'strings, use _Py_LATIN1_CHR instead: {string!r}')
439439
if string not in strings:
440440
strings[string] = name

Tools/build/regen-configure.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@ set -e -x
66
# sync with this script. Use the same container image than the job so the job
77
# doesn't need to run autoreconf in a container.
88
IMAGE="ghcr.io/python/autoconf:2025.01.02.12581854023"
9-
# shellcheck disable=SC2034
109
AUTORECONF="autoreconf -ivf -Werror"
1110

1211
WORK_DIR="/src"
1312

14-
abs_srcdir="$(cd "$(dirname "$0")/../.."; pwd)"
13+
abs_srcdir=$(cd $(dirname $0)/../..; pwd)
1514

1615
if podman --version &>/dev/null; then
1716
RUNTIME="podman"
1817
elif docker --version &>/dev/null; then
1918
RUNTIME="docker"
2019
else
21-
echo "$* needs either Podman or Docker container runtime." >&2
20+
echo "$@ needs either Podman or Docker container runtime." >&2
2221
exit 1
2322
fi
2423

Tools/build/stable_abi.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,7 @@ def gcc_get_limited_api_macros(headers):
548548
text=True,
549549
)
550550

551-
matches = re.findall(r"#define (\w+)", preprocessor_output_with_macros)
552-
return set(matches)
551+
return set(re.findall(r"#define (\w+)", preprocessor_output_with_macros))
553552

554553

555554
def gcc_get_limited_api_definitions(headers):
@@ -607,7 +606,7 @@ def check_private_names(manifest):
607606
if name.startswith('_') and not item.abi_only:
608607
raise ValueError(
609608
f'`{name}` is private (underscore-prefixed) and should be '
610-
f'removed from the stable ABI list or marked `abi_only`')
609+
'removed from the stable ABI list or marked `abi_only`')
611610

612611
def check_dump(manifest, filename):
613612
"""Check that manifest.dump() corresponds to the data.
@@ -647,8 +646,8 @@ def main():
647646
)
648647
parser.add_argument(
649648
"--generate-all", action='store_true',
650-
help="as --generate, but generate all file(s) using default filenames. "
651-
"(unlike --all, does not run any extra checks)",
649+
help="as --generate, but generate all file(s) using default filenames."
650+
" (unlike --all, does not run any extra checks)",
652651
)
653652
parser.add_argument(
654653
"-a", "--all", action='store_true',

0 commit comments

Comments
 (0)