From e383ab1a17d914ead8c08599c451f51601ca65ad Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 7 Apr 2026 15:46:32 -0500 Subject: [PATCH 1/3] add twine check to package test script to lint RST long descriptions `twine check` validates that the `long_description` (README.rst + HISTORY.rst) renders correctly on PyPI. Previously this check only existed in the per-package Makefile `lint-dist` target and in the publish workflow, meaning RST markup errors could slip in through PRs undetected and only surface at release time. For each package, the script now builds a wheel into a temp directory and runs `twine check` against it. Supports both uv (`uv build --wheel`) and plain pip (`pip wheel --no-deps`) backends. Co-Authored-By: Claude --- packages/test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/test.sh b/packages/test.sh index fa9114e7ee6..3b39167eb01 100755 --- a/packages/test.sh +++ b/packages/test.sh @@ -43,9 +43,11 @@ TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)} if command -v uv >/dev/null; then uv venv --python "$TEST_PYTHON" "$TEST_ENV_DIR" PIP_CMD="$(command -v uv) pip" + BUILD_WHEEL_CMD="uv build --wheel --out-dir" else "$TEST_PYTHON" -m venv "$TEST_ENV_DIR" PIP_CMD='python -m pip' + BUILD_WHEEL_CMD="pip wheel --no-deps -w" fi # shellcheck disable=SC1091 @@ -53,6 +55,7 @@ fi if [ "${PIP_CMD}" = 'python -m pip' ]; then ${PIP_CMD} install --upgrade pip setuptools wheel fi +${PIP_CMD} install twine if [ $FOR_PULSAR -eq 0 ]; then # shellcheck disable=SC2086 - word splitting is intentional for PIP_EXTRA_ARGS ${PIP_CMD} install ${PIP_EXTRA_ARGS} -r ../lib/galaxy/dependencies/pinned-typecheck-requirements.txt @@ -101,5 +104,10 @@ while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow. # directly to use the venv we have already activated mypy . fi + DIST_DIR=$(mktemp -d) + # shellcheck disable=SC2086 - word splitting is intentional for BUILD_WHEEL_CMD + $BUILD_WHEEL_CMD "$DIST_DIR" . >/dev/null + twine check "$DIST_DIR"/* + rm -rf "$DIST_DIR" cd .. done < $PACKAGE_LIST_FILE From c76c9260f949523eb1a73a4f11bdaeacc60de973 Mon Sep 17 00:00:00 2001 From: Ahmed Hamid Awan Date: Tue, 7 Apr 2026 20:38:47 -0500 Subject: [PATCH 2/3] various fixes to twine check in packages tests Co-authored-by: Nicola Soranzo --- packages/test.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/test.sh b/packages/test.sh index 3b39167eb01..8df6ea5ca4c 100755 --- a/packages/test.sh +++ b/packages/test.sh @@ -43,19 +43,19 @@ TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)} if command -v uv >/dev/null; then uv venv --python "$TEST_PYTHON" "$TEST_ENV_DIR" PIP_CMD="$(command -v uv) pip" - BUILD_WHEEL_CMD="uv build --wheel --out-dir" + BUILD_WHEEL_CMD="uv build" else "$TEST_PYTHON" -m venv "$TEST_ENV_DIR" PIP_CMD='python -m pip' - BUILD_WHEEL_CMD="pip wheel --no-deps -w" + BUILD_WHEEL_CMD="python -m build" fi # shellcheck disable=SC1091 . "${TEST_ENV_DIR}/bin/activate" if [ "${PIP_CMD}" = 'python -m pip' ]; then - ${PIP_CMD} install --upgrade pip setuptools wheel + ${PIP_CMD} install --upgrade build pip setuptools wheel fi -${PIP_CMD} install twine +${PIP_CMD} install --upgrade twine if [ $FOR_PULSAR -eq 0 ]; then # shellcheck disable=SC2086 - word splitting is intentional for PIP_EXTRA_ARGS ${PIP_CMD} install ${PIP_EXTRA_ARGS} -r ../lib/galaxy/dependencies/pinned-typecheck-requirements.txt @@ -104,10 +104,8 @@ while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow. # directly to use the venv we have already activated mypy . fi - DIST_DIR=$(mktemp -d) # shellcheck disable=SC2086 - word splitting is intentional for BUILD_WHEEL_CMD - $BUILD_WHEEL_CMD "$DIST_DIR" . >/dev/null - twine check "$DIST_DIR"/* - rm -rf "$DIST_DIR" + $BUILD_WHEEL_CMD -o dist + twine check dist/* cd .. done < $PACKAGE_LIST_FILE From 94c9f6f1b215b291719a278fa7d07c5cf0550fae Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Wed, 8 Apr 2026 03:18:41 +0100 Subject: [PATCH 3/3] Don't run ``twine check`` for test_galaxy_packages_for_pulsar Also: - Run twine via uvx when using uv --- packages/test.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/test.sh b/packages/test.sh index 8df6ea5ca4c..b2491df1eba 100755 --- a/packages/test.sh +++ b/packages/test.sh @@ -43,19 +43,20 @@ TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)} if command -v uv >/dev/null; then uv venv --python "$TEST_PYTHON" "$TEST_ENV_DIR" PIP_CMD="$(command -v uv) pip" - BUILD_WHEEL_CMD="uv build" + BUILD_WHEEL_CMD="$(command -v uv) build" + TWINE_CMD="$(command -v uvx) twine" else "$TEST_PYTHON" -m venv "$TEST_ENV_DIR" PIP_CMD='python -m pip' - BUILD_WHEEL_CMD="python -m build" + BUILD_WHEEL_CMD='python -m build' + TWINE_CMD=twine fi # shellcheck disable=SC1091 . "${TEST_ENV_DIR}/bin/activate" if [ "${PIP_CMD}" = 'python -m pip' ]; then - ${PIP_CMD} install --upgrade build pip setuptools wheel + ${PIP_CMD} install --upgrade build pip setuptools twine wheel fi -${PIP_CMD} install --upgrade twine if [ $FOR_PULSAR -eq 0 ]; then # shellcheck disable=SC2086 - word splitting is intentional for PIP_EXTRA_ARGS ${PIP_CMD} install ${PIP_EXTRA_ARGS} -r ../lib/galaxy/dependencies/pinned-typecheck-requirements.txt @@ -103,9 +104,11 @@ while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow. # make mypy uses uv now and so this legacy code should just run mypy # directly to use the venv we have already activated mypy . + + # shellcheck disable=SC2086 - word splitting is intentional for BUILD_WHEEL_CMD + ${BUILD_WHEEL_CMD} -o dist + # shellcheck disable=SC2086 - word splitting is intentional for TWINE_CMD + ${TWINE_CMD} check dist/* fi - # shellcheck disable=SC2086 - word splitting is intentional for BUILD_WHEEL_CMD - $BUILD_WHEEL_CMD -o dist - twine check dist/* cd .. done < $PACKAGE_LIST_FILE