Make sure haiku.rag always requires same version of haiku.rag-slim

This commit is contained in:
Yiorgis Gozadinos 2025-11-26 17:14:58 +02:00
parent ca2445d869
commit 6e24d5772b
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View file

@ -21,7 +21,7 @@ classifiers = [
"Typing :: Typed",
]
dependencies = ["haiku.rag-slim[docling,voyageai,mxbai,cohere,zeroentropy,inspector]"]
dependencies = ["haiku.rag-slim[docling,voyageai,mxbai,cohere,zeroentropy,inspector]==0.19.1"]
[project.scripts]
haiku-rag = "haiku.rag.cli:cli"

View file

@ -31,6 +31,16 @@ def update_version_in_file(file_path: Path, new_version: str) -> None:
print(f"✓ Updated {file_path.relative_to(Path.cwd())}")
def update_dependency_version(file_path: Path, new_version: str) -> None:
"""Update haiku.rag-slim dependency version in root pyproject.toml."""
content = file_path.read_text()
updated = re.sub(
r"(haiku\.rag-slim\[.*?\])==[0-9.]+", rf"\1=={new_version}", content
)
file_path.write_text(updated)
print(f"✓ Updated haiku.rag-slim dependency in {file_path.relative_to(Path.cwd())}")
def update_changelog(changelog_path: Path, new_version: str) -> None:
"""Update CHANGELOG.md with new version."""
content = changelog_path.read_text()
@ -121,6 +131,9 @@ def main():
for file in pyproject_files:
update_version_in_file(file, new_version)
# Update haiku.rag-slim dependency version in root pyproject.toml
update_dependency_version(pyproject_files[0], new_version)
# Update CHANGELOG.md
update_changelog(changelog_file, new_version)