Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
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
7 changes: 7 additions & 0 deletions release/pypi/prep_binary_for_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ for whl_file in "$@"; do
)
version_with_suffix=$(grep '^Version:' "${whl_dir}"/*/METADATA | cut -d' ' -f2)
version_with_suffix_escaped=${version_with_suffix/+/%2B}

# Remove all suffixed +bleh versions
version_no_suffix=${version_with_suffix/+*/}
new_whl_file=${OUTPUT_DIR}/$(basename "${whl_file/${version_with_suffix_escaped}/${version_no_suffix}}")
Expand All @@ -37,6 +38,12 @@ for whl_file in "$@"; do
dirname_dist_info_folder=$(dirname "${dist_info_folder}")
(
set -x

# Special build with pypi cudnn remove it from version
if [[ $whl_file == *"with.pypi.cudnn"* ]]; then
sed -i -e "s/-with-pypi-cudnn//g" "${whl_dir}/torch/version.py"
fi

find "${dist_info_folder}" -type f -exec sed -i "s!${version_with_suffix}!${version_no_suffix}!" {} \;
# Moves distinfo from one with a version suffix to one without
# Example: torch-1.8.0+cpu.dist-info => torch-1.8.0.dist-info
Expand Down