From 863fb1c7540603533334df8667697b4c2b3437e4 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 30 Jun 2026 15:51:54 +0100 Subject: [PATCH 1/6] Add pre-release parsing for alph versions to config --- .bumpversion.toml | 7 +++++-- CONTRIBUTING.rst | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 44146888..354346c7 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -2,14 +2,17 @@ current_version = "0.11.2" tag = true commit = true -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" -serialize = ["{major}.{minor}.{patch}"] +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?P0|[1-9]\\d*))?" +serialize = ["{major}.{minor}.{patch}-{pre_l}{pre_n}", "{major}.{minor}.{patch}"] search = "{current_version}" replace = "{new_version}" tag_name = "v{new_version}" tag_message = "Bump version: {current_version} → {new_version}" message = "Bump version: {current_version} → {new_version}" +[tool.bumpversion.parts.pre_l] +values = ["alpha"] + [[tool.bumpversion.files]] filename = "pyproject.toml" diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7323c0da..a531bf57 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -44,14 +44,14 @@ From inside a development environment, a release can be created from the command pip install bump-my-version -First, choose a release number and run bump2version in "pretend" mode with the to check that the final version will be updated correctly. +First, choose a release number and run bump-my-version in "pretend" mode with the to check that the final version will be updated correctly. .. code-block:: console bump-my-version bump --dry-run {major,minor,patch} --verbose -Once sure of the release number, run bump2version and push the the tags for the new version. +Once sure of the release number, run bump-my-version and push the the tags for the new version. .. code-block:: console @@ -64,6 +64,18 @@ Once sure of the release number, run bump2version and push the the tags for the After the second `git push`, the release will be published automatically both to Github and PYPI. +To make a pre-release + + +To visualise the versioning path: + +.. code-block:: console + + bump-my-version show-bump + bump-my-version show-bump {version} + + + Creating a release from Github ============================== From ef3eff2e056bda212023ea2277f0a1aba1189e40 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 30 Jun 2026 15:55:29 +0100 Subject: [PATCH 2/6] Sabe docs --- CONTRIBUTING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a531bf57..0601d9c2 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -80,7 +80,7 @@ Creating a release from Github ============================== 1. Create a new branch from main named pre followed by the release version e.g. pre_v0.1.0. The release versions should look like v{major}.{minor}.{patch}. -2. If you haven't run bump2version without creating tags, on this branch change manually change the version in `pyproject.toml` and `src/nexgen/__init__.py`. +2. If you haven't run bump-my-version without creating tags, on this branch change manually change the version in `pyproject.toml` and `src/nexgen/__init__.py`. 3. Go `here https://github.com/DiamondLightSource/nexgen/releases/new`. 4. Select Choose a new tag and type the version of the release, then select the branch created in step 1 as the target. 5. Click on Generate release notes. This will create a starting set of release notes based on PR titles since the last release. From 048d97cf1f18486d5ccdfdf1e8fd2a7f44dc61e9 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 30 Jun 2026 16:34:24 +0100 Subject: [PATCH 3/6] Update contributing --- CONTRIBUTING.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 0601d9c2..d9f9a2a1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -63,10 +63,6 @@ Once sure of the release number, run bump-my-version and push the the tags for t After the second `git push`, the release will be published automatically both to Github and PYPI. - -To make a pre-release - - To visualise the versioning path: .. code-block:: console From da170a62a2fe2b716f23968347d1fda9ad86e172 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 3 Jul 2026 15:10:34 +0100 Subject: [PATCH 4/6] Automate pre-release numbering --- .bumpversion.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 354346c7..d76c6634 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -2,8 +2,8 @@ current_version = "0.11.2" tag = true commit = true -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?P0|[1-9]\\d*))?" -serialize = ["{major}.{minor}.{patch}-{pre_l}{pre_n}", "{major}.{minor}.{patch}"] +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?P:0|[1-9]\\d*))?" +serialize = ["{major}.{minor}.{patch}-{pre_l}{distance_to_latest_tag}", "{major}.{minor}.{patch}"] search = "{current_version}" replace = "{new_version}" tag_name = "v{new_version}" From 48ca1b15e186c09fdfe3f02815f8dd680e627066 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 3 Jul 2026 15:11:27 +0100 Subject: [PATCH 5/6] Automate pre-release numbering - fix typo --- .bumpversion.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index d76c6634..382ffe12 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -2,7 +2,7 @@ current_version = "0.11.2" tag = true commit = true -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?P:0|[1-9]\\d*))?" +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?:0|[1-9]\\d*))?" serialize = ["{major}.{minor}.{patch}-{pre_l}{distance_to_latest_tag}", "{major}.{minor}.{patch}"] search = "{current_version}" replace = "{new_version}" From 840594333422bf122d3e5e920268836735481a5b Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 3 Jul 2026 15:15:49 +0100 Subject: [PATCH 6/6] Go back to non automated --- .bumpversion.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 382ffe12..354346c7 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -2,8 +2,8 @@ current_version = "0.11.2" tag = true commit = true -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?:0|[1-9]\\d*))?" -serialize = ["{major}.{minor}.{patch}-{pre_l}{distance_to_latest_tag}", "{major}.{minor}.{patch}"] +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(?:-(?P[a-zA-Z-]+)(?P0|[1-9]\\d*))?" +serialize = ["{major}.{minor}.{patch}-{pre_l}{pre_n}", "{major}.{minor}.{patch}"] search = "{current_version}" replace = "{new_version}" tag_name = "v{new_version}"