Skip to content

Commit

Permalink
Update release.py to python3; omit help requests from resolved tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
dhleong committed Aug 27, 2020
1 parent 552e1e0 commit 13c9526
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Release script for ps4-waker
#
Expand All @@ -7,26 +7,26 @@
from collections import OrderedDict

try:
from hostage import *
from hostage import * #pylint: disable=unused-wildcard-import,wildcard-import
except ImportError:
print "!! Release library unavailable."
print "!! Use `pip install hostage` to fix."
print "!! You will also need an API token in .github.token,"
print "!! a .hubrrc config, or `brew install hub` configured."
print "!! A $GITHUB_TOKEN env variable will also work."
print("!! Release library unavailable.")
print("!! Use `pip install hostage` to fix.")
print("!! You will also need an API token in .github.token,")
print("!! a .hubrrc config, or `brew install hub` configured.")
print("!! A $GITHUB_TOKEN env variable will also work.")
exit(1)

#
# Globals
#

notes = File(".last-release-notes")
latestTag = git.Tag.latest()
latestTag = git.Tag.latest(branch = 'main')

def formatIssue(issue):
return "- {title} (#{number})\n".format(
number=issue.number,
title=issue.title.encode('utf-8'))
title=issue.title)

def buildLabeled(labelsToTitles):
"""Given a set of (label, title) tuples, produces an
Expand Down Expand Up @@ -68,15 +68,16 @@ def buildDefaultNotes(_):
if closedIssues:
for issue in closedIssues:
found = False
for label in labeled.iterkeys():
for label in labeled.keys():
if label in issue.labels:
labeled[label]['content'] += formatIssue(issue)
found = True
break
if not found:

if not found and 'helpme' not in issue.labels:
labeled['_default']['content'] += formatIssue(issue)

for labeledIssueInfo in labeled.itervalues():
for labeledIssueInfo in labeled.values():
if labeledIssueInfo['content']:
contents += "\n**{title}**:\n{content}".format(**labeledIssueInfo)

Expand Down Expand Up @@ -124,7 +125,7 @@ def buildDefaultNotes(_):
# Upload to github
#

print "Uploading to Github..."
print("Uploading to Github...")

verify(versionTag).create()
verify(versionTag).push("origin")
Expand Down

0 comments on commit 13c9526

Please sign in to comment.