Skip to content

Commit 448a2a1

Browse files
committed
👹 Feed the hobgoblins (delint).
Add immutable type declarations to satisfy B006 checks.
1 parent 7414bc5 commit 448a2a1

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

distutils/_collections.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import functools
55
import itertools
66
import operator
7-
87
from collections.abc import Mapping
98
from typing import Any
109

distutils/command/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
this header file lives".
1010
"""
1111

12+
from __future__ import annotations
13+
1214
import os
1315
import pathlib
1416
import re
17+
from collections.abc import Sequence
1518
from distutils._log import log
1619

1720
from ..core import Command
@@ -325,7 +328,7 @@ def check_lib(
325328
library_dirs=None,
326329
headers=None,
327330
include_dirs=None,
328-
other_libraries=[],
331+
other_libraries: Sequence[str] = [],
329332
):
330333
"""Determine if 'library' is available to be linked against,
331334
without actually checking that any particular symbols are provided
@@ -340,7 +343,7 @@ def check_lib(
340343
"int main (void) { }",
341344
headers,
342345
include_dirs,
343-
[library] + other_libraries,
346+
[library] + list(other_libraries),
344347
library_dirs,
345348
)
346349

distutils/dist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pathlib
1111
import re
1212
import sys
13+
from collections.abc import Iterable
1314
from email import message_from_file
1415

1516
try:
@@ -620,7 +621,9 @@ def finalize_options(self):
620621
value = [elm.strip() for elm in value.split(',')]
621622
setattr(self.metadata, attr, value)
622623

623-
def _show_help(self, parser, global_options=1, display_options=1, commands=[]):
624+
def _show_help(
625+
self, parser, global_options=1, display_options=1, commands: Iterable = ()
626+
):
624627
"""Show help for the setup script command-line in the form of
625628
several lists of command-line options. 'parser' should be a
626629
FancyGetopt instance; do not expect it to be returned in the

distutils/fancy_getopt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import re
1313
import string
1414
import sys
15+
from typing import Any, Sequence
1516

1617
from .errors import DistutilsArgError, DistutilsGetoptError
1718

@@ -448,7 +449,7 @@ class OptionDummy:
448449
"""Dummy class just used as a place to hold command-line option
449450
values as instance attributes."""
450451

451-
def __init__(self, options=[]):
452+
def __init__(self, options: Sequence[Any] = []):
452453
"""Create a new OptionDummy instance. The attributes listed in
453454
'options' will be initialized to None."""
454455
for opt in options:

distutils/tests/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
by import rather than matching pre-defined names.
88
"""
99

10+
from typing import Sequence
1011

11-
def missing_compiler_executable(cmd_names=[]): # pragma: no cover
12+
13+
def missing_compiler_executable(cmd_names: Sequence[str] = []): # pragma: no cover
1214
"""Check if the compiler components used to build the interpreter exist.
1315
1416
Check for the existence of the compiler executables whose names are listed

0 commit comments

Comments
 (0)