diff --git a/Makefile b/Makefile index e17d0fe92..ad8018b51 100644 --- a/Makefile +++ b/Makefile @@ -176,12 +176,15 @@ sample_html_beta: _sample_cog_html ## Generate sample HTML report for a beta rel ##@ Kitting: making releases -.PHONY: edit_for_release cheats relbranch relcommit1 relcommit2 +.PHONY: release_version edit_for_release cheats relbranch relcommit1 relcommit2 .PHONY: kit pypi_upload test_upload kit_local build_kits .PHONY: tag bump_version REPO_OWNER = nedbat/coveragepy +release_version: #: Update the version for a release. + python igor.py release_version + edit_for_release: #: Edit sources to insert release facts (see howto.txt). python igor.py edit_for_release diff --git a/howto.txt b/howto.txt index d871e991b..1c7b114fc 100644 --- a/howto.txt +++ b/howto.txt @@ -3,16 +3,19 @@ - Check that the current virtualenv matches the current coverage branch. - start branch for release work $ make relbranch -- Edit version number in coverage/version.py +- check version number in coverage/version.py + - IF PRE-RELEASE: + - edit to look like one of these: version_info = (4, 0, 2, "alpha", 1) version_info = (4, 0, 2, "beta", 1) version_info = (4, 0, 2, "candidate", 1) version_info = (4, 0, 2, "final", 0) - - make sure: _dev = 0 -- Edit supported Python version numbers. Search for "PYVERSIONS". - - Especially README.rst and doc/index.rst + - IF NOT PRE-RELEASE: + $ make release_version - Update source files with release facts, and get useful snippets: $ make edit_for_release cheats +- Edit supported Python version numbers. Search for "PYVERSIONS". + - Especially README.rst and doc/index.rst - Look over CHANGES.rst - Update README.rst - "New in x.y:" diff --git a/igor.py b/igor.py index 5564f52cf..e313d941e 100644 --- a/igor.py +++ b/igor.py @@ -419,6 +419,15 @@ def do_edit_for_release(): ) update_file("doc/conf.py", r"(?s)# @@@ editable\n.*# @@@ end\n", new_conf) +def do_release_version(): + """Set the version to 'final' for a release.""" + facts = get_release_facts() + rel_vi = facts.vi[:3] + ("final", 0) + rel_version = f"version_info = {rel_vi}\n_dev = 0".replace("'", '"') + update_file( + "coverage/version.py", r"(?m)^version_info = .*\n_dev = \d+$", rel_version, + ) + def do_bump_version(): """Edit a few files right after a release to bump the version."""