summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-01-25 13:23:29 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-01-25 13:23:29 -0500
commited85bfb11be2456c8dc006f203ae3f656c7b885d (patch)
treebb2e680554f2498acc8b9f2fc7607b0241da26ff
parent968c6c02f78d17abf3b8c37d3e569516dbbe6525 (diff)
downloadpython-coveragepy-git-ed85bfb11be2456c8dc006f203ae3f656c7b885d.tar.gz
build: latest tweaks to howto, and start of more automation
-rw-r--r--ci/comment_on_fixes.py32
-rw-r--r--howto.txt13
2 files changed, 42 insertions, 3 deletions
diff --git a/ci/comment_on_fixes.py b/ci/comment_on_fixes.py
new file mode 100644
index 00000000..b76a6cda
--- /dev/null
+++ b/ci/comment_on_fixes.py
@@ -0,0 +1,32 @@
+"""Add a release comment to all the issues mentioned in the latest release."""
+
+import json
+import re
+import time
+
+import requests
+
+with open("tmp/relnotes.json") as frn:
+ relnotes = json.load(frn)
+
+latest = relnotes[0]
+version = latest["version"]
+comment = (
+ f"This is now released as part of [coverage {version}]" +
+ f"(https://pypi.org/project/coverage/{version})."
+ )
+print(f"Comment will be: {comment}")
+
+owner = "nedbat"
+repo = "coveragepy"
+for m in re.finditer(r"https://github.com/nedbat/coveragepy/(issues|pull)/(\d+)", latest["text"]):
+ kind, number = m.groups()
+
+ if kind == "issues":
+ print(f"Commenting on {m[0]}")
+ url = f"https://api.github.com/repos/{owner}/{repo}/issues/{number}/comments"
+ resp = requests.post(url, json={"body": comment})
+ print(resp)
+ time.sleep(1)
+ else:
+ print(f"You need to manually coment on {m[0]}")
diff --git a/howto.txt b/howto.txt
index 12bc5b33..31c39cf5 100644
--- a/howto.txt
+++ b/howto.txt
@@ -61,6 +61,10 @@
- Tag the tree
$ git tag -a -m "Version 3.0.1" 3.0.1
$ git push --follow-tags
+ - IF NOT PRE-RELEASE:
+ - update git "stable" branch to point to latest release
+ $ git branch -f stable <latest-tag>
+ $ git push origin stable
- Update GitHub releases:
$ make clean github_releases
- Bump version:
@@ -77,9 +81,6 @@
- readthedocs won't find the tag until a commit is made on master.
- keep just the latest version of each x.y release, make the rest active but hidden.
- IF NOT PRE-RELEASE:
- - update git "stable" branch to point to latest release
- $ git branch -f stable <latest-tag>
- $ git push --all --follow-tags
- @ https://readthedocs.org/projects/coverage/builds/
- wait for the new tag build to finish successfully.
- @ https://readthedocs.org/dashboard/coverage/advanced/
@@ -89,6 +90,12 @@
- Announce:
- twitter @coveragepy
- nedbatchelder.com blog post?
+- things to automate:
+ - git tag command
+ - git stable branch update command
+ - comment-on-fixes.py
+ - url to link to latest changes in docs
+ - next version.py line
* Testing