Skip to content

Commit

Permalink
Add/Remove empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Aug 6, 2017
1 parent 1a38963 commit a617339
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion pip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
InsecureRequestWarning,
)


# assignment for flake8 to be happy

# This fixes a peculiarity when importing via __import__ - as we are
Expand Down
5 changes: 3 additions & 2 deletions pip/basecommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def main(self, args):
)
with session:
pip_version_check(session, options)

# Avoid leaking loggers
for handler in set(logging.root.handlers) - original_root_handlers:
# this method benefit from the Logger class internal lock
Expand All @@ -270,8 +271,8 @@ def populate_requirement_set(requirement_set, args, options, finder,

for filename in options.constraints:
parsed_constraints = parse_requirements(
filename,
constraint=True, finder=finder, options=options,
filename,
constraint=True, finder=finder, options=options,
session=session, wheel_cache=wheel_cache
)
for req in parsed_constraints:
Expand Down
3 changes: 3 additions & 0 deletions pip/baseparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def _update_defaults(self, defaults):
late_eval.add(option.dest)
opt_str = option.get_opt_string()
val = option.convert_value(opt_str, val)

# From take_action
args = option.callback_args or ()
kwargs = option.callback_kwargs or {}
Expand All @@ -214,6 +215,7 @@ def _update_defaults(self, defaults):

for key in late_eval:
defaults[key] = getattr(self.values, key)

self.values = None
return defaults

Expand All @@ -230,6 +232,7 @@ def get_default_values(self):
if isinstance(default, string_types):
opt_str = option.get_opt_string()
defaults[option.dest] = option.check_value(opt_str, default)

return optparse.Values(defaults)

def error(self, msg):
Expand Down
1 change: 1 addition & 0 deletions pip/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@ def print_results(distributions, list_files=False, verbose=False):
logger.info(" %s", line.strip())
if "files" not in dist:
logger.info("Cannot locate installed-files.txt")

return results_printed
2 changes: 2 additions & 0 deletions pip/commands/uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ def run(self, options, args):
for req in parsed_reqs:
if req.name:
reqs_to_uninstall[canonicalize_name(req.name)] = req

if not reqs_to_uninstall:
raise InstallationError(
'You must give at least one requirement to %(name)s (see '
'"pip help %(name)s")' % dict(name=self.name)
)

for req in reqs_to_uninstall.values():
verbose = options.verbose != 0
req.uninstall(auto_confirm=options.yes, verbose=verbose)
Expand Down
2 changes: 1 addition & 1 deletion pip/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ def _prepare_linked_requirement(self, req, resolver):
# occurs when the script attempts to unpack the
# build directory
req.ensure_has_source_dir(self.build_dir)

# If a checkout exists, it's unwise to keep going. version
# inconsistencies are logged later, but do not fail the
# installation.
# FIXME: this won't upgrade when there's an existing
# package unpacked in `req.source_dir`
# package unpacked in `req.source_dir`
if os.path.exists(os.path.join(req.source_dir, 'setup.py')):
raise PreviousBuildDirError(
"pip can't proceed with requirements '%s' due to a"
Expand Down

0 comments on commit a617339

Please sign in to comment.