Skip to content

Commit f28308a

Browse files
A round of ruff format after ruff check --fix
1 parent 050eafb commit f28308a

File tree

10 files changed

+46
-22
lines changed

10 files changed

+46
-22
lines changed

setuptools/command/bdist_egg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ def zap_pyfiles(self):
263263
pattern = r'(?P<name>.+)\.(?P<magic>[^.]+)\.pyc'
264264
m = re.match(pattern, name)
265265
path_new = os.path.join(base, os.pardir, m.group('name') + '.pyc')
266-
log.info("Renaming file from [{}] to [{}]".format(path_old, path_new))
266+
log.info(
267+
"Renaming file from [{}] to [{}]".format(path_old, path_new)
268+
)
267269
try:
268270
os.remove(path_new)
269271
except OSError:

setuptools/command/easy_install.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,9 @@ def check_editable(self, spec) -> None:
659659

660660
if os.path.exists(os.path.join(self.build_directory, spec.key)):
661661
raise DistutilsArgError(
662-
"{!r} already exists in {}; can't do a checkout there".format(spec.key, self.build_directory)
662+
"{!r} already exists in {}; can't do a checkout there".format(
663+
spec.key, self.build_directory
664+
)
663665
)
664666

665667
@contextlib.contextmanager
@@ -916,11 +918,15 @@ def install_eggs(self, spec, dist_filename, tmpdir) -> list[Distribution]:
916918
setups = glob(os.path.join(setup_base, '*', 'setup.py'))
917919
if not setups:
918920
raise DistutilsError(
919-
"Couldn't find a setup script in {}".format(os.path.abspath(dist_filename))
921+
"Couldn't find a setup script in {}".format(
922+
os.path.abspath(dist_filename)
923+
)
920924
)
921925
if len(setups) > 1:
922926
raise DistutilsError(
923-
"Multiple setup scripts in {}".format(os.path.abspath(dist_filename))
927+
"Multiple setup scripts in {}".format(
928+
os.path.abspath(dist_filename)
929+
)
924930
)
925931
setup_script = setups[0]
926932

@@ -1112,7 +1118,9 @@ def install_wheel(self, wheel_path, tmpdir):
11121118
self.execute(
11131119
wheel.install_as_egg,
11141120
(destination,),
1115-
("Installing {} to {}").format(os.path.basename(wheel_path), os.path.dirname(destination)),
1121+
("Installing {} to {}").format(
1122+
os.path.basename(wheel_path), os.path.dirname(destination)
1123+
),
11161124
)
11171125
finally:
11181126
update_dist_caches(destination, fix_zipimporter_caches=False)

setuptools/command/egg_info.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ def finalize_options(self) -> None:
231231
packaging.requirements.Requirement(spec % (self.egg_name, self.egg_version))
232232
except ValueError as e:
233233
raise distutils.errors.DistutilsOptionError(
234-
"Invalid distribution name or version syntax: {}-{}".format(self.egg_name, self.egg_version)
234+
"Invalid distribution name or version syntax: {}-{}".format(
235+
self.egg_name, self.egg_version
236+
)
235237
) from e
236238

237239
if self.egg_base is None:

setuptools/command/install_egg_info.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def run(self) -> None:
3636
self.execute(os.unlink, (self.target,), "Removing " + self.target)
3737
if not self.dry_run:
3838
ensure_directory(self.target)
39-
self.execute(self.copytree, (), "Copying {} to {}".format(self.source, self.target))
39+
self.execute(
40+
self.copytree, (), "Copying {} to {}".format(self.source, self.target)
41+
)
4042
self.install_namespaces()
4143

4244
def get_outputs(self):

setuptools/dist.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def check_importable(dist, attr, value):
8585
assert not ep.extras
8686
except (TypeError, ValueError, AttributeError, AssertionError) as e:
8787
raise DistutilsSetupError(
88-
"{!r} must be importable 'module:attrs' string (got {!r})".format(attr, value)
88+
"{!r} must be importable 'module:attrs' string (got {!r})".format(
89+
attr, value
90+
)
8991
) from e
9092

9193

@@ -611,7 +613,9 @@ def _set_command_options(self, command_obj, option_dict=None): # noqa: C901
611613
setattr(command_obj, option, value)
612614
else:
613615
raise DistutilsOptionError(
614-
"error in {}: command '{}' has no such option '{}'".format(source, command_name, option)
616+
"error in {}: command '{}' has no such option '{}'".format(
617+
source, command_name, option
618+
)
615619
)
616620
except ValueError as e:
617621
raise DistutilsOptionError(e) from e
@@ -835,7 +839,9 @@ def _include_misc(self, name: str, value: _Sequence) -> None:
835839
try:
836840
old = getattr(self, name)
837841
except AttributeError as e:
838-
raise DistutilsSetupError("{}: No such distribution setting".format(name)) from e
842+
raise DistutilsSetupError(
843+
"{}: No such distribution setting".format(name)
844+
) from e
839845
if old is None:
840846
setattr(self, name, value)
841847
elif not isinstance(old, _sequence):

setuptools/msvc.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ def _guess_vc_legacy(self):
561561
path
562562
"""
563563
default = os.path.join(
564-
self.ProgramFilesx86, r'Microsoft Visual Studio {:0.1f}\VC'.format(self.vs_ver)
564+
self.ProgramFilesx86,
565+
r'Microsoft Visual Studio {:0.1f}\VC'.format(self.vs_ver),
565566
)
566567

567568
# Try to get "VC++ for Python" path from registry as default path
@@ -696,7 +697,9 @@ def FSharpInstallDir(self):
696697
str
697698
path
698699
"""
699-
path = os.path.join(self.ri.visualstudio, r'{:0.1f}\Setup\F#'.format(self.vs_ver))
700+
path = os.path.join(
701+
self.ri.visualstudio, r'{:0.1f}\Setup\F#'.format(self.vs_ver)
702+
)
700703
return self.ri.lookup(path, 'productdir') or ''
701704

702705
@property
@@ -714,7 +717,9 @@ def UniversalCRTSdkDir(self):
714717

715718
# Find path of the more recent Kit
716719
for ver in vers:
717-
sdkdir = self.ri.lookup(self.ri.windows_kits_roots, 'kitsroot{}'.format(ver))
720+
sdkdir = self.ri.lookup(
721+
self.ri.windows_kits_roots, 'kitsroot{}'.format(ver)
722+
)
718723
if sdkdir:
719724
return sdkdir or ''
720725

setuptools/package_index.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,9 @@ def check_hash(self, checker, filename, tfp) -> None:
530530
tfp.close()
531531
os.unlink(filename)
532532
raise DistutilsError(
533-
"{} validation failed for {}; "
534-
"possible download problem?".format(checker.hash.name, os.path.basename(filename))
533+
"{} validation failed for {}; " "possible download problem?".format(
534+
checker.hash.name, os.path.basename(filename)
535+
)
535536
)
536537

537538
def add_find_links(self, urls) -> None:

setuptools/tests/test_manifest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ def make_local_path(s):
3434
'packages': ['app'],
3535
}
3636

37-
SETUP_PY = (
38-
"""\
37+
SETUP_PY = """\
3938
from setuptools import setup
4039
4140
setup(**{!r})
4241
""".format(SETUP_ATTRS)
43-
)
4442

4543

4644
@contextlib.contextmanager

setuptools/tests/test_sdist.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@
3737
'data_files': [("data", [os.path.join("d", "e.dat")])],
3838
}
3939

40-
SETUP_PY = (
41-
"""\
40+
SETUP_PY = """\
4241
from setuptools import setup
4342
4443
setup(**{!r})
4544
""".format(SETUP_ATTRS)
46-
)
4745

4846
EXTENSION = Extension(
4947
name="sdist_test.f",

setuptools/wheel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def get_metadata(name):
145145
wheel_version = parse_version(wheel_metadata.get('Wheel-Version'))
146146
wheel_v1 = parse_version('1.0') <= wheel_version < parse_version('2.0dev0')
147147
if not wheel_v1:
148-
raise ValueError('unsupported wheel format version: {}'.format(wheel_version))
148+
raise ValueError(
149+
'unsupported wheel format version: {}'.format(wheel_version)
150+
)
149151
# Extract to target directory.
150152
_unpack_zipfile_obj(zf, destination_eggdir)
151153
# Convert metadata.

0 commit comments

Comments
 (0)