Skip to content

Commit 7a9818b

Browse files
committed
Merge pull request pypa/distutils#255 from DimitriPapadopoulos/ISC
Apply ruff/flake8-implicit-str-concat rules (ISC)
2 parents 418589c + 4208e32 commit 7a9818b

File tree

10 files changed

+14
-23
lines changed

10 files changed

+14
-23
lines changed

distutils/ccompiler.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,8 @@ def _check_macro_definitions(self, definitions):
202202
and isinstance(defn[0], str)
203203
):
204204
raise TypeError(
205-
(f"invalid macro definition '{defn}': ")
206-
+ "must be tuple (string,), (string, string), or "
207-
+ "(string, None)"
205+
f"invalid macro definition '{defn}': "
206+
"must be tuple (string,), (string, string), or (string, None)"
208207
)
209208

210209
# -- Bookkeeping methods -------------------------------------------

distutils/command/bdist_dumb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class bdist_dumb(Command):
3333
(
3434
'keep-temp',
3535
'k',
36-
"keep the pseudo-installation tree around after "
37-
+ "creating the distribution archive",
36+
"keep the pseudo-installation tree around after creating the distribution archive",
3837
),
3938
('dist-dir=', 'd', "directory to put final built distributions in"),
4039
('skip-build', None, "skip rebuilding everything (for testing/debugging)"),

distutils/command/bdist_rpm.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,7 @@ def _make_spec_file(self): # noqa: C901
528528
# that we open and interpolate into the spec file, but the defaults
529529
# are just text that we drop in as-is. Hmmm.
530530

531-
install_cmd = (
532-
f'{def_setup_call} install -O1 --root=$RPM_BUILD_ROOT '
533-
'--record=INSTALLED_FILES'
534-
)
531+
install_cmd = f'{def_setup_call} install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES'
535532

536533
script_options = [
537534
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),

distutils/command/build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class build(Command):
2727
(
2828
'build-lib=',
2929
None,
30-
"build directory for all distribution (defaults to either "
31-
+ "build-purelib or build-platlib",
30+
"build directory for all distribution (defaults to either build-purelib or build-platlib",
3231
),
3332
('build-scripts=', None, "build directory for scripts"),
3433
('build-temp=', 't', "temporary build directory"),

distutils/command/build_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class build_ext(Command):
7171
'inplace',
7272
'i',
7373
"ignore build-lib and put compiled extensions into the source "
74-
+ "directory alongside your pure Python modules",
74+
"directory alongside your pure Python modules",
7575
),
7676
(
7777
'include-dirs=',

distutils/command/install.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ class install(Command):
193193
(
194194
'install-platbase=',
195195
None,
196-
"base installation directory for platform-specific files "
197-
+ "(instead of --exec-prefix or --home)",
196+
"base installation directory for platform-specific files (instead of --exec-prefix or --home)",
198197
),
199198
('root=', None, "install everything relative to this alternate root directory"),
200199
# Or, explicitly set the installation scheme
@@ -211,8 +210,7 @@ class install(Command):
211210
(
212211
'install-lib=',
213212
None,
214-
"installation directory for all module distributions "
215-
+ "(overrides --install-purelib and --install-platlib)",
213+
"installation directory for all module distributions (overrides --install-purelib and --install-platlib)",
216214
),
217215
('install-headers=', None, "installation directory for C/C++ headers"),
218216
('install-scripts=', None, "installation directory for Python scripts"),
@@ -348,8 +346,7 @@ def finalize_options(self): # noqa: C901
348346
self.install_base or self.install_platbase
349347
):
350348
raise DistutilsOptionError(
351-
"must supply either prefix/exec-prefix/home or "
352-
+ "install-base/install-platbase -- not both"
349+
"must supply either prefix/exec-prefix/home or install-base/install-platbase -- not both"
353350
)
354351

355352
if self.home and (self.prefix or self.exec_prefix):

distutils/command/register.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def send_metadata(self): # noqa: C901
225225
log.info('Server response (%s): %s', code, result)
226226
else:
227227
log.info('You will receive an email shortly.')
228-
log.info('Follow the instructions in it to ' 'complete registration.')
228+
log.info('Follow the instructions in it to complete registration.')
229229
elif choice == '3':
230230
data = {':action': 'password_reset'}
231231
data['email'] = ''

distutils/dist.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,7 @@ def _show_help(
654654
if display_options:
655655
parser.set_option_table(self.display_options)
656656
parser.print_help(
657-
"Information display options (just display "
658-
+ "information, ignore any commands)"
657+
"Information display options (just display information, ignore any commands)"
659658
)
660659
print()
661660

distutils/fancy_getopt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ def _check_alias_dict(self, aliases, what):
118118
for alias, opt in aliases.items():
119119
if alias not in self.option_index:
120120
raise DistutilsGetoptError(
121-
f"invalid {what} '{alias}': " f"option '{alias}' not defined"
121+
f"invalid {what} '{alias}': option '{alias}' not defined"
122122
)
123123
if opt not in self.option_index:
124124
raise DistutilsGetoptError(
125-
f"invalid {what} '{alias}': " f"aliased option '{opt}' not defined"
125+
f"invalid {what} '{alias}': aliased option '{opt}' not defined"
126126
)
127127

128128
def set_aliases(self, alias):

ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extend-select = [
44
"W",
55

66
# local
7+
"ISC",
78
"RUF010",
89
"RUF100",
910
"UP",

0 commit comments

Comments
 (0)