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
29 changes: 24 additions & 5 deletions .github/scripts/apply_dev_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@
"lib/kvbm-physical/Cargo.toml",
]

# Member manifests that pin the workspace version inside a dependency
# inline table, e.g. backend-common's
# `dynamo-llm = { path = "../llm", version = "1.4.0", default-features = false }`
# (a direct path dep because cargo cannot express `workspace = true` +
# `default-features = false`). VERSION_LINE_RE is line-anchored and
# intentionally skips inline tables, so these files get the same exact-string
# rewrite as the root path-dep pins (the pinned value always equals
# [workspace.package].version).
WORKSPACE_PIN_CARGO_TARGETS = [
"lib/backend-common/Cargo.toml",
]

# Line-anchored: matches `version = "X.Y.Z"` lines. Skips `version.workspace = true`
# (no quotes) and `version = { ... }` (no string). Safe for sub-crate Cargo.tomls
# whose only `version = "..."` line is the [package] one; external-crate deps use
Expand Down Expand Up @@ -140,13 +152,20 @@ def rewrite_root_cargo(root: Path, suffix: str) -> None:
return # already stamped -- idempotent no-op
new = semver(suffix, base)

text = re.sub(
rf'(\bversion\s*=\s*"){re.escape(base)}(")',
lambda mm: f"{mm.group(1)}{new}{mm.group(2)}",
text,
)
pin_re = re.compile(rf'(\bversion\s*=\s*"){re.escape(base)}(")')
text = pin_re.sub(lambda mm: f"{mm.group(1)}{new}{mm.group(2)}", text)
path.write_text(text)

# Bump the same literal pin where it lives in member manifests (inline
# dep tables that VERSION_LINE_RE deliberately skips). The early
# "already stamped" return above keeps this idempotent.
for rel in WORKSPACE_PIN_CARGO_TARGETS:
p = root / rel
t = p.read_text()
t2 = pin_re.sub(lambda mm: f"{mm.group(1)}{new}{mm.group(2)}", t)
if t2 != t:
p.write_text(t2)


def main() -> int:
ap = argparse.ArgumentParser(description=__doc__)
Expand Down
2 changes: 1 addition & 1 deletion lib/backend-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ integration = ["dynamo-runtime/integration"]

[dependencies]
dynamo-runtime = { workspace = true }
dynamo-llm = { path = "../llm", default-features = false }
dynamo-llm = { path = "../llm", version = "1.4.1", default-features = false }
dynamo-protocols = { workspace = true }

anyhow = { workspace = true }
Expand Down
Loading