From 59a3b576ef506a955152e195a4467b162940a8fb Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 9 Sep 2026 13:36:23 -0400 Subject: [PATCH 1/2] ci(release): increment devN counter after releases Port flopy's post-release version scheme: the development segment counter is set to the patch number of the version just released instead of always being reset to dev0. e.g. after 1.9.2 comes 1.10.0.dev2, after 1.11.0 comes 1.12.0.dev0. The counter marks how many releases into the series development has resumed. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014v2ecPwSZui4d9pGGuLApL --- .github/workflows/release.yml | 3 ++- DEVELOPER.md | 4 +++- scripts/update_version.py | 14 ++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) 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..c6ebb870 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 into the series development has resumed. + """ 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( From 8d3a028e47204967d4263da6514aef5fa6d5d38c Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 9 Sep 2026 13:56:53 -0400 Subject: [PATCH 2/2] rephrase --- scripts/update_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_version.py b/scripts/update_version.py index c6ebb870..20735554 100644 --- a/scripts/update_version.py +++ b/scripts/update_version.py @@ -26,7 +26,7 @@ def post_release_version() -> Version: 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 into the series development has resumed. + 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.dev{version.micro}")