Skip to content

Commit

Permalink
fix various formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfk committed Feb 1, 2017
1 parent 7fbfc8a commit c9ead86
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
23 changes: 13 additions & 10 deletions pyup/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def apply_updates(self, initial, scheduled):
title = "{prefix} {title}".format(prefix=self.config.pr_prefix, title=title)
if initial_pr:
pull_request = initial_pr
elif self.can_pull(initial, scheduled) and title not in [pr.title for pr in self.pull_requests]:
elif self.can_pull(initial, scheduled) and \
title not in [pr.title for pr in self.pull_requests]:
update_branch = self.config.branch_prefix + update_branch
pull_request = self.commit_and_pull(
initial=initial,
Expand Down Expand Up @@ -248,7 +249,6 @@ def close_stale_prs(self, update, pull_request, scheduled):
for closed_pr in closed:
self.pull_requests.remove(closed_pr)


def is_bot_the_only_committer(self, pr):
"""
Checks if the bot is the only committer for the given pull request.
Expand All @@ -268,8 +268,7 @@ def is_bot_the_only_committer(self, pr):

# check that there's exactly one committer in this PRs commit history and
# that the committer is the bot
return len(committer_set) == 1 and \
self.provider.is_same_user(self.bot, committer[0])
return len(committer_set) == 1 and self.provider.is_same_user(self.bot, committer[0])

def has_conflicting_update(self, update):
"""
Expand All @@ -282,10 +281,14 @@ def has_conflicting_update(self, update):
# with both `initial` and `scheduled` == False
for _, _, _, updates in self.iter_updates(initial=False, scheduled=False):
for _update in updates:
if (update.requirement.key == _update.requirement.key and
(update.commit_message != _update.commit_message or
update.requirement.latest_version_within_specs !=
_update.requirement.latest_version_within_specs)):
if (
update.requirement.key == _update.requirement.key and
(
update.commit_message != _update.commit_message or
update.requirement.latest_version_within_specs !=
_update.requirement.latest_version_within_specs
)
):
logger.info("{} conflicting with {}/{}".format(
update.requirement.key,
update.requirement.latest_version_within_specs,
Expand Down Expand Up @@ -340,7 +343,7 @@ def pull_config(self, new_config): # pragma: no cover
# a config file exists, update and commit it
logger.info(
"Config file exists, updating config for sha {}".format(content_file.sha))
commit = self.provider.create_commit(
self.provider.create_commit(
repo=self.user_repo,
path="/.pyup.yml",
branch=branch,
Expand All @@ -351,7 +354,7 @@ def pull_config(self, new_config): # pragma: no cover
)
logger.info("No config file found, writing new config file")
# there's no config file present, write a new config file and commit it
commit = self.provider.create_and_commit_file(
self.provider.create_and_commit_file(
repo=self.user_repo,
path="/.pyup.yml",
branch=branch,
Expand Down
3 changes: 1 addition & 2 deletions pyup/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _parse(self):
req.line = line
if req.package is not None:
self._requirements.append(req)
except ValueError as e:
except ValueError:
continue
self._is_valid = len(self._requirements) > 0 or len(self._other_files) > 0

Expand Down Expand Up @@ -365,7 +365,6 @@ def full_name(self):
return "{}[{}]".format(self.name, ",".join(self.extras))
return self.name


def get_hashes(self, version):
data = hashin.get_package_hashes(
self.name,
Expand Down
1 change: 1 addition & 0 deletions pyup/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def get_title(cls):
def get_branch(cls):
return "initial-update"


RequirementUpdate = namedtuple(
"RequirementUpdate",
["requirement_file", "requirement", "commit_message"]
Expand Down

0 comments on commit c9ead86

Please sign in to comment.