diff --git a/distutils/cmd.py b/distutils/cmd.py index 241621bd..10b1f42a 100644 --- a/distutils/cmd.py +++ b/distutils/cmd.py @@ -533,7 +533,7 @@ def make_file( timestamp checks. """ if skip_msg is None: - skip_msg = f"skipping {outfile} (inputs unchanged)" + skip_msg = f"skipping {outfile!r} (inputs unchanged)" # Allow 'infiles' to be a single string if isinstance(infiles, str): @@ -542,7 +542,7 @@ def make_file( raise TypeError("'infiles' must be a string, or a list or tuple of strings") if exec_msg is None: - exec_msg = "generating {} from {}".format(outfile, ', '.join(infiles)) + exec_msg = f"generating {outfile!r} from {', '.join(infiles)!r}" # If 'outfile' must be regenerated (either because it doesn't # exist, is out-of-date, or the 'force' flag is true) then diff --git a/distutils/tests/test_cmd.py b/distutils/tests/test_cmd.py index 76e8f598..85056229 100644 --- a/distutils/tests/test_cmd.py +++ b/distutils/tests/test_cmd.py @@ -52,7 +52,7 @@ def test_make_file(self, cmd): # making sure execute gets called properly def _execute(func, args, exec_msg, level): - assert exec_msg == 'generating out from in' + assert exec_msg == "generating 'out' from 'in'" cmd.force = True cmd.execute = _execute diff --git a/mypy.ini b/mypy.ini index 146222a5..29d8e5d2 100644 --- a/mypy.ini +++ b/mypy.ini @@ -16,20 +16,21 @@ disable_error_code = # local + # Code that is too dynamic using variable command names; + # and code that uses platform checks mypy doesn't understand + attr-defined, + # These reveal issues in distutils/_modified.py that should be fixed + return-value, + type-var, # TODO: Resolve and re-enable these gradually operator, - attr-defined, arg-type, assignment, call-overload, - return-value, index, - type-var, func-returns-value, union-attr, - str-bytes-safe, misc, - has-type, # stdlib's test module is not typed on typeshed [mypy-test.*]