Skip to content

Commit 737e57e

Browse files
committed
Fix verify scripts: prereq check and contrib CWD issue
- Add prerequisite check for gpg, java, flit, uv, svn at script start (fails early with clear error instead of cryptic flit-not-found) - Fix contrib verify: cd to /tmp before running python imports to avoid CWD shadowing installed hamilton package with local repo directory
1 parent 170017e commit 737e57e

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

scripts/verify-sub-packages/verify_contrib.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if [ -z "$VERSION" ] || [ -z "$RC" ]; then
3838
fi
3939

4040
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
41+
42+
# Check prerequisites
43+
for cmd in gpg java flit uv svn; do
44+
if ! command -v "$cmd" > /dev/null 2>&1; then
45+
echo "ERROR: $cmd is required but not found. Please install it."
46+
exit 1
47+
fi
48+
done
4149
PACKAGE="apache-hamilton-contrib"
4250
SRC_TAR="${PACKAGE}-${VERSION}-incubating-src.tar.gz"
4351
WHEEL="apache_hamilton_contrib-${VERSION}-py3-none-any.whl"
@@ -135,6 +143,9 @@ cd /tmp # prevent '' in sys.path from resolving local hamilton checkout
135143

136144
uv pip install -q "$ARTIFACTS_DIR/$WHEEL" apache-hamilton
137145

146+
# Run from /tmp to avoid CWD shadowing the installed hamilton package
147+
cd /tmp
148+
138149
python -c "import importlib.metadata; assert importlib.metadata.version('apache-hamilton-contrib') == '${VERSION}'"
139150
echo " ✓ Version correct"
140151

scripts/verify-sub-packages/verify_lsp.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if [ -z "$VERSION" ] || [ -z "$RC" ]; then
3838
fi
3939

4040
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
41+
42+
# Check prerequisites
43+
for cmd in gpg java flit uv svn; do
44+
if ! command -v "$cmd" > /dev/null 2>&1; then
45+
echo "ERROR: $cmd is required but not found. Please install it."
46+
exit 1
47+
fi
48+
done
4149
PACKAGE="apache-hamilton-lsp"
4250
SRC_TAR="${PACKAGE}-${VERSION}-incubating-src.tar.gz"
4351
WHEEL="apache_hamilton_lsp-${VERSION}-py3-none-any.whl"

scripts/verify-sub-packages/verify_sdk.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if [ -z "$VERSION" ] || [ -z "$RC" ]; then
3838
fi
3939

4040
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
41+
42+
# Check prerequisites
43+
for cmd in gpg java flit uv svn; do
44+
if ! command -v "$cmd" > /dev/null 2>&1; then
45+
echo "ERROR: $cmd is required but not found. Please install it."
46+
exit 1
47+
fi
48+
done
4149
PACKAGE="apache-hamilton-sdk"
4250
SRC_TAR="${PACKAGE}-${VERSION}-incubating-src.tar.gz"
4351
WHEEL="apache_hamilton_sdk-${VERSION}-py3-none-any.whl"

scripts/verify-sub-packages/verify_ui.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if [ -z "$VERSION" ] || [ -z "$RC" ]; then
3838
fi
3939

4040
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
41+
42+
# Check prerequisites
43+
for cmd in gpg java flit uv svn; do
44+
if ! command -v "$cmd" > /dev/null 2>&1; then
45+
echo "ERROR: $cmd is required but not found. Please install it."
46+
exit 1
47+
fi
48+
done
4149
PACKAGE="apache-hamilton-ui"
4250
SRC_TAR="${PACKAGE}-${VERSION}-incubating-src.tar.gz"
4351
WHEEL="apache_hamilton_ui-${VERSION}-py3-none-any.whl"

0 commit comments

Comments
 (0)