diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfa09553..3aa1ee88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -319,7 +319,8 @@ jobs: ver=$(cat version.txt) branch="post-release-$ver-reset" - # bump the minor version and re-add the '.dev0' suffix; prints the new version + # bump to the next minor version, with a '.devN' suffix where N is the + # patch number of the version just released; prints the new version next=$(python scripts/update_version.py --post-release) git config core.sharedRepository true diff --git a/DEVELOPER.md b/DEVELOPER.md index 3cd6208b..8ccc252a 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -127,7 +127,9 @@ Review the draft release and publish it. Publishing it triggers jobs that: 1. build the package and upload it to [PyPI](https://pypi.org/project/modflow-devtools) 2. open a follow-up pull request resetting `develop` from `main`, with the version number - incremented to the next development version (minor bumped, `.dev0` suffix) + incremented to the next development version: the next minor version, with a `.devN` suffix + where `N` is the patch number of the version just released (e.g. `1.9.2` → `1.10.0.dev2`, + `1.11.0` → `1.12.0.dev0`) Merge (do not squash) the reset pull request to finish the release. diff --git a/scripts/update_version.py b/scripts/update_version.py index c39b37ad..20735554 100644 --- a/scripts/update_version.py +++ b/scripts/update_version.py @@ -21,9 +21,15 @@ def release_version() -> Version: def post_release_version() -> Version: - """Development version for the next cycle: minor incremented, '.dev0' suffix.""" + """Development version for the next cycle, following a release. + + Targets the next anticipated minor version, with the development segment + set to the micro (patch) number of the version just released: e.g. after + 1.9.2 comes 1.10.0.dev2, and after 1.11.0 comes 1.12.0.dev0. The counter + marks how many releases have been cut in the current minor version cycle. + """ version = Version(_current_version.base_version) - return Version(f"{version.major}.{version.minor + 1}.0.dev0") + return Version(f"{version.major}.{version.minor + 1}.0.dev{version.micro}") def update_version_txt(version: Version): @@ -107,8 +113,8 @@ def update_version( required=False, action="store_true", help=( - "Use the development version for the next cycle: the minor version " - "incremented, with a '.dev0' suffix" + "Use the development version for the next cycle: the next minor " + "version, with a development segment set to the released patch number" ), ) parser.add_argument(