Skip to content

Commit

Permalink
build: 'python igor.py cheats' shows a few things needed during releases
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 26, 2022
1 parent ed85bfb commit 7b7712a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions igor.py
Expand Up @@ -9,6 +9,7 @@
"""

import contextlib
import datetime
import fnmatch
import glob
import inspect
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 7b7712a

Please sign in to comment.