From 57d95b419d531081710a9795dfb67f1c2aba04b1 Mon Sep 17 00:00:00 2001 From: atalman Date: Wed, 19 Oct 2022 14:09:02 -0700 Subject: [PATCH 1/2] Strip pypi-cudnn from the version.py --- release/pypi/prep_binary_for_pypi.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release/pypi/prep_binary_for_pypi.sh b/release/pypi/prep_binary_for_pypi.sh index 201e4b9ac..5d3059e1b 100644 --- a/release/pypi/prep_binary_for_pypi.sh +++ b/release/pypi/prep_binary_for_pypi.sh @@ -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}}") @@ -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" ./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 From c3e9838eee58e82550b8427547d6b08760011829 Mon Sep 17 00:00:00 2001 From: atalman Date: Wed, 19 Oct 2022 15:29:07 -0700 Subject: [PATCH 2/2] small fix --- release/pypi/prep_binary_for_pypi.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/pypi/prep_binary_for_pypi.sh b/release/pypi/prep_binary_for_pypi.sh index 5d3059e1b..c6c0615c0 100644 --- a/release/pypi/prep_binary_for_pypi.sh +++ b/release/pypi/prep_binary_for_pypi.sh @@ -40,8 +40,8 @@ for whl_file in "$@"; do 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" ./torch/version.py + 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}!" {} \;