summaryrefslogtreecommitdiff
path: root/igor.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-01-26 18:05:07 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-01-26 18:05:07 -0500
commit7b7712ab34b6f0f9dc880be3cd668e67cf903f76 (patch)
treeea2d329ff1c78c71da2529817b786798b3d514bf /igor.py
parented85bfb11be2456c8dc006f203ae3f656c7b885d (diff)
downloadpython-coveragepy-git-7b7712ab34b6f0f9dc880be3cd668e67cf903f76.tar.gz
build: 'python igor.py cheats' shows a few things needed during releases
Diffstat (limited to 'igor.py')
-rw-r--r--igor.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/igor.py b/igor.py
index 5aeb10fe..64903c20 100644
--- a/igor.py
+++ b/igor.py
@@ -9,6 +9,7 @@ of in shell scripts, batch files, or Makefiles.
"""
import contextlib
+import datetime
import fnmatch
import glob
import inspect
@@ -365,6 +366,45 @@ def do_quietly(command):
return proc.returncode
+def do_cheats():
+ """Show a cheatsheet of useful things during releasing."""
+ import coverage
+ ver = coverage.__version__
+ vi = coverage.version_info
+ anchor = f"{vi[0]}{vi[1]}"
+ if vi[2]:
+ anchor += f"{vi[2]}"
+ if vi[3] != "final":
+ anchor += vi[3][0]
+ anchor += f"{vi[4]}"
+ branch = subprocess.getoutput("git rev-parse --abbrev-ref @")
+ print(f"Coverage version is {ver}")
+
+ print(f"pip install git+https://github.com/nedbat/coveragepy@{branch}")
+ print(f".. _changes_{anchor}:")
+ print()
+ head = f"Version {ver} — {datetime.datetime.now():%Y-%m-%d}"
+ print(head)
+ print("-" * len(head))
+
+ print(f'git tag -a -m "Version {ver}" {ver}')
+ print(f'git branch -f stable {ver}')
+ print(f"https://coverage.readthedocs.io/en/{ver}/changes.html#changes-{anchor}")
+
+ print("\nnext:")
+ next_vi = (vi[0], vi[1], vi[2]+1, "alpha", 0)
+ print(f"version_info = {next_vi}".replace("'", '"'))
+ print("for CHANGES.rst:")
+ print(textwrap.dedent("""\
+ Unreleased
+ ----------
+
+ Nothing yet.
+
+
+ """))
+
+
def do_help():
"""List the available commands"""
items = list(globals().items())