diff --git a/setuptools/command/bdist_wheel.py b/setuptools/command/bdist_wheel.py index 8f067866594..926b4076142 100644 --- a/setuptools/command/bdist_wheel.py +++ b/setuptools/command/bdist_wheel.py @@ -209,9 +209,7 @@ class bdist_wheel(Command): ( "compression=", None, - "zipfile compression (one of: {}) [default: 'deflated']".format( - ", ".join(supported_compressions) - ), + f"zipfile compression (one of: {', '.join(supported_compressions)}) [default: 'deflated']", ), ( "python-tag=", diff --git a/setuptools/dist.py b/setuptools/dist.py index e32c5ed7c11..606dbd43ec5 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -125,8 +125,7 @@ def _check_marker(marker): def assert_bool(dist, attr, value): """Verify that value is True, False, 0, or 1""" if bool(value) != value: - tmpl = "{attr!r} must be a boolean value (got {value!r})" - raise DistutilsSetupError(tmpl.format(attr=attr, value=value)) + raise DistutilsSetupError(f"{attr!r} must be a boolean value (got {value!r})") def invalid_unless_false(dist, attr, value): @@ -144,11 +143,10 @@ def check_requirements(dist, attr, value): if isinstance(value, (dict, set)): raise TypeError("Unordered types are not allowed") except (TypeError, ValueError) as error: - tmpl = ( - "{attr!r} must be a string or list of strings " - "containing valid project/version requirement specifiers; {error}" - ) - raise DistutilsSetupError(tmpl.format(attr=attr, error=error)) from error + raise DistutilsSetupError( + f"{attr!r} must be a string or list of strings " + f"containing valid project/version requirement specifiers; {error}" + ) from error def check_specifier(dist, attr, value): @@ -156,8 +154,9 @@ def check_specifier(dist, attr, value): try: SpecifierSet(value) except (InvalidSpecifier, AttributeError) as error: - tmpl = "{attr!r} must be a string containing valid version specifiers; {error}" - raise DistutilsSetupError(tmpl.format(attr=attr, error=error)) from error + raise DistutilsSetupError( + f"{attr!r} must be a string containing valid version specifiers; {error}" + ) from error def check_entry_points(dist, attr, value):