From 13c952620ab976ac8371faae4649564bbc51deee Mon Sep 17 00:00:00 2001 From: Daniel Leong Date: Thu, 27 Aug 2020 11:02:26 -0400 Subject: [PATCH] Update release.py to python3; omit help requests from resolved tickets --- release.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/release.py b/release.py index 1304238..5e47126 100755 --- a/release.py +++ b/release.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Release script for ps4-waker # @@ -7,13 +7,13 @@ 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) # @@ -21,12 +21,12 @@ # 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 @@ -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) @@ -124,7 +125,7 @@ def buildDefaultNotes(_): # Upload to github # -print "Uploading to Github..." +print("Uploading to Github...") verify(versionTag).create() verify(versionTag).push("origin")