From b3aa85f5ecd608a1e69dc11bfb9301b0cbefb77f Mon Sep 17 00:00:00 2001 From: Jon Palmer Date: Tue, 9 Jun 2026 17:26:09 -0700 Subject: [PATCH 1/2] fix(hooks): make pre-commit CITATION sync portable The pre-commit hook auto-updates CITATION.cff whenever pyproject.toml changes, but two bugs caused it to silently corrupt the file on macOS/BSD: 1. The version-extraction regex used \s (GNU-only) in grep -E / sed -E. On BSD this matches a literal 's', so the capture fails and VERSION falls back to the entire matched line ('version = "X.Y.Z"'). 2. The CITATION.cff substitution `s/version: .*/.../` was unanchored, so it also rewrote the `cff-version:` line. Together these turned `cff-version: 1.2.0` and `version: X.Y.Z` into `cff-version: version = "X.Y.Z"` and `version: version = "X.Y.Z"`, which is invalid CFF (this is what PR #73 had to repair). Fix both by using POSIX [[:space:]] and anchoring the substitutions with ^. --- .githooks/pre-commit | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index d6371c9..d48ef0e 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -3,21 +3,25 @@ # Check if pyproject.toml is being modified if git diff --cached --name-only | grep -q "pyproject.toml"; then - # Extract the version from pyproject.toml - VERSION=$(grep -E 'version\s*=\s*"[^"]+"' pyproject.toml | head -1 | sed -E 's/.*version\s*=\s*"([^"]+)".*/\1/') - + # Extract the version from pyproject.toml. + # Use [[:space:]] instead of \s so the regex works on both GNU and BSD + # (macOS) grep/sed — BSD treats \s as a literal 's', which silently + # falls back to capturing the whole line and corrupts CITATION.cff. + VERSION=$(grep -E '^[[:space:]]*version[[:space:]]*=[[:space:]]*"[^"]+"' pyproject.toml | head -1 | sed -E 's/.*version[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/') + if [ -n "$VERSION" ]; then # Get current date in YYYY-MM-DD format TODAY=$(date +"%Y-%m-%d") - - # Update version and date in CITATION.cff - sed -i.bak -E "s/version: .*/version: $VERSION/" CITATION.cff - sed -i.bak -E "s/date-released: .*/date-released: '$TODAY'/" CITATION.cff + + # Update version and date in CITATION.cff. Anchor with ^ so the + # `version:` rule does not also clobber the `cff-version:` line. + sed -i.bak -E "s/^version: .*/version: $VERSION/" CITATION.cff + sed -i.bak -E "s/^date-released: .*/date-released: '$TODAY'/" CITATION.cff rm CITATION.cff.bak - + # Add the updated CITATION.cff to the commit git add CITATION.cff - + echo "Updated CITATION.cff to version $VERSION and date $TODAY" fi fi From a49c0092bd101e9f931d04abec308d9f11254fcb Mon Sep 17 00:00:00 2001 From: Jon Palmer Date: Tue, 9 Jun 2026 17:26:09 -0700 Subject: [PATCH 2/2] build: bump version to 2026.6.9 Release cut after #73. Switches to CalVer (YYYY.M.D) matching the prior v2025.11.1 tag rather than the intermediate YY.M.DD form used in 26.5.22. - pyproject.toml: 26.5.22 -> 2026.6.9 - CITATION.cff: version + date-released for today's tag --- CITATION.cff | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index babe0cb..6a48c29 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -17,5 +17,5 @@ keywords: - functional annotation - consensus gene models license: BSD-2-Clause -version: 26.5.22 -date-released: '2026-05-24' +version: 2026.6.9 +date-released: '2026-06-09' diff --git a/pyproject.toml b/pyproject.toml index 1a16fa4..84aada9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "funannotate2" -version = "26.5.22" +version = "2026.6.9" description = "Funannotate2: eukarytoic genome annotation pipeline" readme = {file = "README.md", content-type = "text/markdown"} authors = [