fix: include correct __version__ in python packages (#218)

Updates:
- hindsight-api/hindsight_api/__init__.py: bump __version__ to 0.4.0
- scripts/release.sh: add logic to update __version__ in Python __init__.py files during release
This commit is contained in:
Nicolò Boschi 2026-01-28 17:25:17 +01:00 committed by GitHub
parent 20f2b92069
commit fccbdfef16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View file

@ -46,4 +46,4 @@ __all__ = [
"RemoteTEICrossEncoder",
"LLMConfig",
]
__version__ = "0.1.0"
__version__ = "0.4.0"

View file

@ -77,6 +77,22 @@ for package in "${PYTHON_PACKAGES[@]}"; do
fi
done
# Update __version__ in Python __init__.py files
PYTHON_INIT_FILES=(
"hindsight-api/hindsight_api/__init__.py"
"hindsight-embed/hindsight_embed/__init__.py"
"hindsight-clients/python/hindsight_client_api/__init__.py"
)
for init_file in "${PYTHON_INIT_FILES[@]}"; do
if [ -f "$init_file" ]; then
print_info "Updating __version__ in $init_file"
sed -i.bak "s/^__version__ = \".*\"/__version__ = \"$VERSION\"/" "$init_file"
rm "${init_file}.bak"
else
print_warn "File $init_file not found, skipping"
fi
done
# Update Rust CLI
CARGO_FILE="hindsight-cli/Cargo.toml"
if [ -f "$CARGO_FILE" ]; then