From 6f9a3dcad61e6d67c1e0a4d6e3e2acf2245aa616 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Thu, 20 Aug 2026 07:17:22 -0500 Subject: [PATCH 1/2] Fix update_version.py to bump the rattler-build recipe The script still targeted `conda_package/recipe/meta.yaml`, which no longer exists since the recipe moved to the rattler-build v1 schema in `recipe.yaml`. Because a missing file is silently skipped, the recipe version was never bumped by the script. Target `recipe.yaml` and the `version` entry in its `context` block instead. Also tighten the `version:` regexes: `\s*$` under `re.MULTILINE` could consume the trailing newline and a following blank line, which deleted the blank line after the `context` block. Document the script in the releasing docs so that CITATION.cff is not missed again. Co-Authored-By: Claude Opus 5 --- conda_package/docs/releasing.rst | 16 ++++++++++++++-- update_version.py | 20 ++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/conda_package/docs/releasing.rst b/conda_package/docs/releasing.rst index 80a5be486..84885bfde 100644 --- a/conda_package/docs/releasing.rst +++ b/conda_package/docs/releasing.rst @@ -12,14 +12,26 @@ Version Bump and Dependency Updates 1. **Update the Version Number** - - Open a pull request (PR) to update the version number in the following - two files: + - Run the helper script from the root of the repo: + + :: + + ./update_version.py -v 1.3.0 + + This updates the version in all three places that need it: + + - ``CITATION.cff`` (both ``version`` and ``date-released``, which is set + to today's date) - ``conda_package/mpas_tools/__init__.py`` - ``conda_package/recipe/recipe.yaml`` - Make sure the version follows `semantic versioning `_. For release candidates, use versions like ``1.3.0rc1`` (no ``v`` prefix). + The script only accepts ``X.Y.Z``, so update the files by hand for a + release candidate. + + - Open a pull request (PR) with these changes. 2. **Check and Update Dependencies** diff --git a/update_version.py b/update_version.py index af4cd77af..a054ae957 100755 --- a/update_version.py +++ b/update_version.py @@ -9,7 +9,8 @@ def parse_args(): parser = argparse.ArgumentParser( description=( - "Bump version across files (CITATION.cff, __init__.py, meta.yaml)." + "Bump version across files (CITATION.cff, __init__.py, " + "recipe.yaml)." ) ) parser.add_argument( @@ -54,7 +55,10 @@ def bump_citation(root: Path, version: str, today: str) -> bool: # version: 1.2.1 -> version: 1.2.2 content_new = re.sub( - r"(?m)^(version:\s*)(.+)\s*$", rf"\g<1>{version}", content, count=1 + r"(?m)^(version:[^\S\n]*)[^\n]*$", + rf"\g<1>{version}", + content, + count=1, ) # date-released: '2025-06-12' -> date-released: 'YYYY-MM-DD' content_new = re.sub( @@ -98,17 +102,17 @@ def bump_init(pkg_dir: Path, version_tuple) -> bool: return changed -def bump_meta(recipe_dir: Path, version: str) -> bool: - path = recipe_dir / "meta.yaml" +def bump_recipe(recipe_dir: Path, version: str) -> bool: + path = recipe_dir / "recipe.yaml" content = read_text(path) if content is None: print(f"Skip (not found): {path}") return False - # {% set version = "1.2.1" %} -> {% set version = "1.2.2" %} + # In the "context" block: version: 1.2.1 -> version: 1.2.2 content_new = re.sub( - r'(?m)^\{\%\s*set\s+version\s*=\s*["\']([^"\']+)["\']\s*\%\}', - f'{{% set version = "{version}" %}}', + r'(?m)^( version:[^\S\n]*)[^\n]*$', + rf"\g<1>{version}", content, count=1, ) @@ -136,7 +140,7 @@ def main(): changed = [] changed.append(bump_citation(repo_root, version, today)) changed.append(bump_init(pkg_dir, version_tuple)) - changed.append(bump_meta(recipe_dir, version)) + changed.append(bump_recipe(recipe_dir, version)) if not any(changed): print("No files modified.") From f5f2ad9052441e58f9625c9ed667419787203bb2 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Thu, 20 Aug 2026 07:17:49 -0500 Subject: [PATCH 2/2] Update version to 2.1.0 Bump the version and set the release date in CITATION.cff, the package's `__version_info__` and the conda recipe using `update_version.py`. Also add contributors with more than one commit who were missing from the author lists: Amrapalli Garanaik and Divya Jaganathan in CITATION.cff, and the larger set that `docs/authors.rst` had fallen behind on. Co-Authored-By: Claude Opus 5 --- CITATION.cff | 8 ++++++-- conda_package/docs/authors.rst | 11 +++++++++++ conda_package/mpas_tools/__init__.py | 2 +- conda_package/recipe/recipe.yaml | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index c42df2c57..d633d964c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -77,7 +77,11 @@ authors: orcid: 'https://orcid.org/0000-0003-2962-1049' - given-names: Cameron family-names: Smith + - given-names: Amrapalli + family-names: Garanaik + - given-names: Divya + family-names: Jaganathan repository-code: 'https://github.com/MPAS-Dev/MPAS-Tools' url: 'https://mpas-dev.github.io/MPAS-Tools/master/' -version: 2.0.0 -date-released: '2026-07-01' +version: 2.1.0 +date-released: '2026-08-20' diff --git a/conda_package/docs/authors.rst b/conda_package/docs/authors.rst index 3bb818ec6..43c66c2d2 100644 --- a/conda_package/docs/authors.rst +++ b/conda_package/docs/authors.rst @@ -7,19 +7,30 @@ Main Authors Contributors ============ +* Carolyn Begeman * Riley X. Brady * Miles Curry +* Althea Denlinger +* Darren Engwirda * Amrapalli Garanaik +* Alex Hager +* Holly Han * Dom Heinzeller * Trevor Hillebrand +* Divya Jaganathan * Joseph Kennedy * William Lipscomb +* Andrew Nolan * Mark Petersen * Stephen Price * Todd Ringler * Juan Saenz +* Courtney Shafer +* William Skamarock +* Cameron Smith * Adrian Turner * Luke Van Roekel +* Maciej Waruszewski * Phillip J. Wolfram * Tong Zhang diff --git a/conda_package/mpas_tools/__init__.py b/conda_package/mpas_tools/__init__.py index 09b6d0b04..d4e5c7ff8 100644 --- a/conda_package/mpas_tools/__init__.py +++ b/conda_package/mpas_tools/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = (2, 0, 0) +__version_info__ = (2, 1, 0) __version__ = '.'.join(str(vi) for vi in __version_info__) diff --git a/conda_package/recipe/recipe.yaml b/conda_package/recipe/recipe.yaml index 14d8453a5..3c15cf73d 100644 --- a/conda_package/recipe/recipe.yaml +++ b/conda_package/recipe/recipe.yaml @@ -2,7 +2,7 @@ schema_version: 1 context: name: mpas_tools - version: 2.0.0 + version: 2.1.0 package: name: ${{ name | lower }}