summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-11-16 05:44:14 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-11-16 05:44:14 +0100
commit16b0b61e26e457413ef9f765eacbb177cc749e83 (patch)
tree9b39a0ae853619eae14de6a8c06f81d5d4796663
parent32e0d83016bbf5fdff9a562998fb8564adb3d952 (diff)
downloadpsutil-16b0b61e26e457413ef9f765eacbb177cc749e83.tar.gz
refact
-rw-r--r--Makefile1
-rwxr-xr-xscripts/internal/github_issue_labeler.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2e921031..42e0c5ee 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ DEPS = \
coverage \
flake8 \
flake8-print \
+ PyGithub \
pyperf \
pypinfo \
requests \
diff --git a/scripts/internal/github_issue_labeler.py b/scripts/internal/github_issue_labeler.py
index 32c22b4a..49307b7b 100755
--- a/scripts/internal/github_issue_labeler.py
+++ b/scripts/internal/github_issue_labeler.py
@@ -18,6 +18,8 @@ from github import Github
USER = "giampaolo"
PROJECT = "psutil"
+OS_LABELS = ["linux", "windows", "macos", "freebsd", "openbsd", "netbsd",
+ "openbsd", "sunos", "unix", "wsl", "aix", "cygwin"]
TOKEN = ""
DRYRUN = False
@@ -100,6 +102,7 @@ def set_labels_from_title(issue):
def main():
global TOKEN, DRYRUN
+ # parser
parser = argparse.ArgumentParser(description='GitHub issue labeler')
parser.add_argument('--tokenfile', required=False,
default='~/.github.token',
@@ -108,9 +111,13 @@ def main():
action='store_true',
help="don't make actual changes")
args = parser.parse_args()
+
+ # set globals
with open(os.path.expanduser(args.tokenfile)) as f:
TOKEN = f.read().strip()
+ DRYRUN = args.dryrun
+ # run
g = Github(TOKEN)
repo = g.get_repo("%s/%s" % (USER, PROJECT))
issues = repo.get_issues(state='all')