diff --git a/distutils/ccompiler.py b/distutils/ccompiler.py index 0671bd3f..4585512f 100644 --- a/distutils/ccompiler.py +++ b/distutils/ccompiler.py @@ -202,9 +202,8 @@ def _check_macro_definitions(self, definitions): and isinstance(defn[0], str) ): raise TypeError( - (f"invalid macro definition '{defn}': ") - + "must be tuple (string,), (string, string), or " - + "(string, None)" + f"invalid macro definition '{defn}': " + "must be tuple (string,), (string, string), or (string, None)" ) # -- Bookkeeping methods ------------------------------------------- diff --git a/distutils/command/bdist_dumb.py b/distutils/command/bdist_dumb.py index 53c709fc..d50459d6 100644 --- a/distutils/command/bdist_dumb.py +++ b/distutils/command/bdist_dumb.py @@ -33,8 +33,7 @@ class bdist_dumb(Command): ( 'keep-temp', 'k', - "keep the pseudo-installation tree around after " - + "creating the distribution archive", + "keep the pseudo-installation tree around after creating the distribution archive", ), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), diff --git a/distutils/command/bdist_rpm.py b/distutils/command/bdist_rpm.py index ba8da8c5..b18db5e4 100644 --- a/distutils/command/bdist_rpm.py +++ b/distutils/command/bdist_rpm.py @@ -528,10 +528,7 @@ def _make_spec_file(self): # noqa: C901 # that we open and interpolate into the spec file, but the defaults # are just text that we drop in as-is. Hmmm. - install_cmd = ( - f'{def_setup_call} install -O1 --root=$RPM_BUILD_ROOT ' - '--record=INSTALLED_FILES' - ) + install_cmd = f'{def_setup_call} install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES' script_options = [ ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"), diff --git a/distutils/command/build.py b/distutils/command/build.py index 67ea394f..bc7bcd73 100644 --- a/distutils/command/build.py +++ b/distutils/command/build.py @@ -27,8 +27,7 @@ class build(Command): ( 'build-lib=', None, - "build directory for all distribution (defaults to either " - + "build-purelib or build-platlib", + "build directory for all distribution (defaults to either build-purelib or build-platlib", ), ('build-scripts=', None, "build directory for scripts"), ('build-temp=', 't', "temporary build directory"), diff --git a/distutils/command/build_ext.py b/distutils/command/build_ext.py index fe06eed0..999ed641 100644 --- a/distutils/command/build_ext.py +++ b/distutils/command/build_ext.py @@ -71,7 +71,7 @@ class build_ext(Command): 'inplace', 'i', "ignore build-lib and put compiled extensions into the source " - + "directory alongside your pure Python modules", + "directory alongside your pure Python modules", ), ( 'include-dirs=', diff --git a/distutils/command/install.py b/distutils/command/install.py index 960ff64b..e68a9ff6 100644 --- a/distutils/command/install.py +++ b/distutils/command/install.py @@ -193,8 +193,7 @@ class install(Command): ( 'install-platbase=', None, - "base installation directory for platform-specific files " - + "(instead of --exec-prefix or --home)", + "base installation directory for platform-specific files (instead of --exec-prefix or --home)", ), ('root=', None, "install everything relative to this alternate root directory"), # Or, explicitly set the installation scheme @@ -211,8 +210,7 @@ class install(Command): ( 'install-lib=', None, - "installation directory for all module distributions " - + "(overrides --install-purelib and --install-platlib)", + "installation directory for all module distributions (overrides --install-purelib and --install-platlib)", ), ('install-headers=', None, "installation directory for C/C++ headers"), ('install-scripts=', None, "installation directory for Python scripts"), @@ -348,8 +346,7 @@ def finalize_options(self): # noqa: C901 self.install_base or self.install_platbase ): raise DistutilsOptionError( - "must supply either prefix/exec-prefix/home or " - + "install-base/install-platbase -- not both" + "must supply either prefix/exec-prefix/home or install-base/install-platbase -- not both" ) if self.home and (self.prefix or self.exec_prefix): diff --git a/distutils/command/register.py b/distutils/command/register.py index 6b837275..24121abe 100644 --- a/distutils/command/register.py +++ b/distutils/command/register.py @@ -225,7 +225,7 @@ def send_metadata(self): # noqa: C901 log.info('Server response (%s): %s', code, result) else: log.info('You will receive an email shortly.') - log.info('Follow the instructions in it to ' 'complete registration.') + log.info('Follow the instructions in it to complete registration.') elif choice == '3': data = {':action': 'password_reset'} data['email'] = '' diff --git a/distutils/dist.py b/distutils/dist.py index 2faf0f0c..1d5506f1 100644 --- a/distutils/dist.py +++ b/distutils/dist.py @@ -654,8 +654,7 @@ def _show_help( if display_options: parser.set_option_table(self.display_options) parser.print_help( - "Information display options (just display " - + "information, ignore any commands)" + "Information display options (just display information, ignore any commands)" ) print() diff --git a/distutils/fancy_getopt.py b/distutils/fancy_getopt.py index 69143029..62cf3194 100644 --- a/distutils/fancy_getopt.py +++ b/distutils/fancy_getopt.py @@ -118,11 +118,11 @@ def _check_alias_dict(self, aliases, what): for alias, opt in aliases.items(): if alias not in self.option_index: raise DistutilsGetoptError( - f"invalid {what} '{alias}': " f"option '{alias}' not defined" + f"invalid {what} '{alias}': option '{alias}' not defined" ) if opt not in self.option_index: raise DistutilsGetoptError( - f"invalid {what} '{alias}': " f"aliased option '{opt}' not defined" + f"invalid {what} '{alias}': aliased option '{opt}' not defined" ) def set_aliases(self, alias): diff --git a/ruff.toml b/ruff.toml index 562178fc..3f71515b 100644 --- a/ruff.toml +++ b/ruff.toml @@ -4,6 +4,7 @@ extend-select = [ "W", # local + "ISC", "RUF010", "RUF100", "UP",