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
22 changes: 13 additions & 9 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Loading