jerry-024 commented on code in PR #79:
URL:
https://github.com/apache/paimon-vector-index/pull/79#discussion_r3794147683
##########
tools/update_branch_version.sh:
##########
@@ -36,33 +37,38 @@ fi
###########################
-OLD_VERSION=${OLD_VERSION}
-NEW_VERSION=${NEW_VERSION}
-
-
-if [ -z "${OLD_VERSION}" ]; then
+if [ -z "${OLD_VERSION:-}" ]; then
echo "OLD_VERSION is unset"
exit 1
fi
-if [ -z "${NEW_VERSION}" ]; then
+if [ -z "${NEW_VERSION:-}" ]; then
echo "NEW_VERSION is unset"
exit 1
fi
cd ..
-# For Cargo.toml and pyproject.toml, strip any -SNAPSHOT suffix (not valid in
those ecosystems)
+# Cargo and Python use clean SemVer versions without Maven's -SNAPSHOT suffix.
+OLD_VERSION_CLEAN=$(echo "$OLD_VERSION" | sed 's/-SNAPSHOT//')
NEW_VERSION_CLEAN=$(echo "$NEW_VERSION" | sed 's/-SNAPSHOT//')
-#change version in all pom files (match both exact and -SNAPSHOT suffix)
+# Change version in all pom files (match both exact and -SNAPSHOT suffix).
find . -name 'pom.xml' -type f -exec perl -pi -e
's#<version>'$OLD_VERSION'(-SNAPSHOT)?</version>#<version>'$NEW_VERSION'</version>#'
{} \;
-#change version in Cargo.toml files
-find . -name 'Cargo.toml' -not -path '*/target/*' -type f -exec perl -pi -e
's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION_CLEAN'"#' {} \;
+# Change workspace package versions and version requirements for local
+# paimon-vindex path dependencies without touching unrelated dependencies.
+find . -name 'Cargo.toml' -not -path '*/target/*' -type f \
+ -exec perl -pi -e 's#^version = "'$OLD_VERSION_CLEAN'"#version =
"'$NEW_VERSION_CLEAN'"#' {} \;
+find . -name 'Cargo.toml' -not -path '*/target/*' -type f \
+ -exec perl -pi -e 'if (/^paimon-vindex-/) { s#version =
"'$OLD_VERSION_CLEAN'"#version = "'$NEW_VERSION_CLEAN'"# }' {} \;
+
+# Change the Python package version.
+perl -pi -e 's#^version = "'$OLD_VERSION_CLEAN'"#version =
"'$NEW_VERSION_CLEAN'"#' python/pyproject.toml
-#change version in pyproject.toml
-perl -pi -e 's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION_CLEAN'"#'
python/pyproject.toml
+# Refresh workspace package versions in Cargo.lock while preserving the
+# already locked third-party dependency set, and reject inconsistent manifests.
+cargo check --workspace
Review Comment:
`cargo check --workspace` compiles the workspace, but this block only needs
to refresh workspace package versions in `Cargo.lock`. Cargo documents `cargo
update --workspace` for this exact case and it keeps already-locked
non-workspace packages unchanged. Could we use that instead to avoid compiling
during release preparation?
https://doc.rust-lang.org/cargo/commands/cargo-update.html#update-options
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]