From e346c0856084ec0f50fb0dac24c1dff97e3ad8e0 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Thu, 5 Mar 2026 04:43:50 -0500 Subject: [PATCH] [Release] Include source distribution (sdist) in PyPI uploads (#35136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dougbtv Co-authored-by: Daniele Trifirò (cherry picked from commit 0bfa229bf1f6b12f215d045f4acb4b9607937f32) --- .buildkite/scripts/upload-release-wheels-pypi.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.buildkite/scripts/upload-release-wheels-pypi.sh b/.buildkite/scripts/upload-release-wheels-pypi.sh index dacdb6e92..058e5bbe4 100644 --- a/.buildkite/scripts/upload-release-wheels-pypi.sh +++ b/.buildkite/scripts/upload-release-wheels-pypi.sh @@ -54,10 +54,13 @@ mkdir -p $DIST_DIR # include only wheels for the release version, ignore all files with "dev" or "rc" in the name (without excluding 'aarch64') aws s3 cp --recursive --exclude "*" --include "vllm-${PURE_VERSION}*.whl" --exclude "*dev*" --exclude "*rc[0-9]*" "$S3_COMMIT_PREFIX" $DIST_DIR echo "Wheels copied to local directory" -# generate source tarball -git archive --format=tar.gz --output="$DIST_DIR/vllm-${PURE_VERSION}.tar.gz" "$BUILDKITE_COMMIT" +# generate source distribution using setup.py +python setup.py sdist --dist-dir=$DIST_DIR ls -la $DIST_DIR +SDIST_FILE=$(find $DIST_DIR -name "vllm*.tar.gz") +echo "Found sdist: $SDIST_FILE" + # upload wheels to PyPI (only default variant, i.e. files without '+' in the name) PYPI_WHEEL_FILES=$(find $DIST_DIR -name "vllm-${PURE_VERSION}*.whl" -not -name "*+*") if [[ -z "$PYPI_WHEEL_FILES" ]]; then @@ -65,6 +68,6 @@ if [[ -z "$PYPI_WHEEL_FILES" ]]; then exit 1 fi -python3 -m twine check "$PYPI_WHEEL_FILES" -python3 -m twine upload --non-interactive --verbose "$PYPI_WHEEL_FILES" -echo "Wheels uploaded to PyPI" +python3 -m twine check "$PYPI_WHEEL_FILES" "$SDIST_FILE" +python3 -m twine upload --non-interactive --verbose "$PYPI_WHEEL_FILES" "$SDIST_FILE" +echo "Wheels and source distribution uploaded to PyPI"