Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
14 changes: 10 additions & 4 deletions scripts/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
Loading