mirror of https://github.com/pypa/pip
Clean up code style changes
Toward minimizing style changes in the overall PR diff, or toward consistency with the future use of black (in cases where I wasn't sure of a good way to minimize the diff).
This commit is contained in:
parent
f8b06a3906
commit
6fa4a9a0a7
|
@ -230,7 +230,8 @@ class SimpleWheelCache(Cache):
|
|||
logger.debug(
|
||||
"Ignoring cached wheel %s for %s as it "
|
||||
"does not match the expected distribution name %s.",
|
||||
wheel_name, link, package_name)
|
||||
wheel_name, link, package_name,
|
||||
)
|
||||
continue
|
||||
if not wheel.supported(supported_tags):
|
||||
# Built for a different python/arch/etc
|
||||
|
|
|
@ -59,8 +59,10 @@ class CacheCommand(Command):
|
|||
|
||||
# Determine action
|
||||
if not args or args[0] not in handlers:
|
||||
logger.error("Need an action (%s) to perform.",
|
||||
", ".join(sorted(handlers)))
|
||||
logger.error(
|
||||
"Need an action (%s) to perform.",
|
||||
", ".join(sorted(handlers)),
|
||||
)
|
||||
return ERROR
|
||||
|
||||
action = args[0]
|
||||
|
|
|
@ -105,8 +105,10 @@ class ConfigurationCommand(Command):
|
|||
|
||||
# Determine action
|
||||
if not args or args[0] not in handlers:
|
||||
logger.error("Need an action (%s) to perform.",
|
||||
", ".join(sorted(handlers)))
|
||||
logger.error(
|
||||
"Need an action (%s) to perform.",
|
||||
", ".join(sorted(handlers)),
|
||||
)
|
||||
return ERROR
|
||||
|
||||
action = args[0]
|
||||
|
@ -265,8 +267,9 @@ class ConfigurationCommand(Command):
|
|||
try:
|
||||
self.configuration.save()
|
||||
except Exception:
|
||||
logger.exception("Unable to save configuration. "
|
||||
"Please report this as a bug.")
|
||||
logger.exception(
|
||||
"Unable to save configuration. Please report this as a bug."
|
||||
)
|
||||
raise PipError("Internal Error.")
|
||||
|
||||
def _determine_editor(self, options):
|
||||
|
|
|
@ -529,7 +529,8 @@ def group_locations(locations, expand_dir=False):
|
|||
urls.append(url)
|
||||
else:
|
||||
logger.warning(
|
||||
"Path '%s' is ignored: it is a directory.", path)
|
||||
"Path '%s' is ignored: it is a directory.", path,
|
||||
)
|
||||
elif os.path.isfile(path):
|
||||
sort_path(path)
|
||||
else:
|
||||
|
|
|
@ -173,8 +173,9 @@ def deduce_helpful_msg(req):
|
|||
" the packages specified within it."
|
||||
).format(req)
|
||||
except RequirementParseError:
|
||||
logger.debug("Cannot parse '%s' as requirements file",
|
||||
req, exc_info=True)
|
||||
logger.debug(
|
||||
"Cannot parse '%s' as requirements file", req, exc_info=True
|
||||
)
|
||||
else:
|
||||
msg += " File '{}' does not exist.".format(req)
|
||||
return msg
|
||||
|
|
|
@ -612,7 +612,8 @@ class UninstallPthEntries(object):
|
|||
# If the file doesn't exist, log a warning and return
|
||||
if not os.path.isfile(self.file):
|
||||
logger.warning(
|
||||
"Cannot remove entries from nonexistent file %s", self.file)
|
||||
"Cannot remove entries from nonexistent file %s", self.file
|
||||
)
|
||||
return
|
||||
with open(self.file, 'rb') as fh:
|
||||
# windows uses '\r\n' with py3k, but uses '\n' with py2.x
|
||||
|
|
|
@ -121,8 +121,11 @@ def str_to_display(data, desc=None):
|
|||
try:
|
||||
decoded_data = data.decode(encoding)
|
||||
except UnicodeDecodeError:
|
||||
logger.warning('%s does not appear to be encoded as %s',
|
||||
desc or 'Bytes object', encoding)
|
||||
logger.warning(
|
||||
'%s does not appear to be encoded as %s',
|
||||
desc or 'Bytes object',
|
||||
encoding,
|
||||
)
|
||||
decoded_data = data.decode(encoding, errors=backslashreplace_decode)
|
||||
|
||||
# Make sure we can print the output, by encoding it to the output
|
||||
|
|
|
@ -241,8 +241,12 @@ def call_subprocess(
|
|||
).format(proc.returncode, command_desc)
|
||||
raise InstallationError(exc_msg)
|
||||
elif on_returncode == 'warn':
|
||||
subprocess_logger.warning('Command "%s" had error code %s in %s',
|
||||
command_desc, proc.returncode, cwd)
|
||||
subprocess_logger.warning(
|
||||
'Command "%s" had error code %s in %s',
|
||||
command_desc,
|
||||
proc.returncode,
|
||||
cwd,
|
||||
)
|
||||
elif on_returncode == 'ignore':
|
||||
pass
|
||||
else:
|
||||
|
|
|
@ -183,7 +183,8 @@ class TempDirectory(object):
|
|||
# scripts, so we canonicalize the path by traversing potential
|
||||
# symlinks here.
|
||||
path = os.path.realpath(
|
||||
tempfile.mkdtemp(prefix="pip-{}-".format(kind)))
|
||||
tempfile.mkdtemp(prefix="pip-{}-".format(kind))
|
||||
)
|
||||
logger.debug("Created temporary directory: %s", path)
|
||||
return path
|
||||
|
||||
|
@ -266,7 +267,8 @@ class AdjacentTempDirectory(TempDirectory):
|
|||
else:
|
||||
# Final fallback on the default behavior.
|
||||
path = os.path.realpath(
|
||||
tempfile.mkdtemp(prefix="pip-{}-".format(kind)))
|
||||
tempfile.mkdtemp(prefix="pip-{}-".format(kind))
|
||||
)
|
||||
|
||||
logger.debug("Created temporary directory: %s", path)
|
||||
return path
|
||||
|
|
Loading…
Reference in New Issue