Skip to content

Commit 0c7cd3d

Browse files
atalmanjithunnair-amd
authored andcommitted
Strip pypi-cudnn from the version.py (pytorch#1167)
* Strip pypi-cudnn from the version.py * small fix
1 parent 54e188a commit 0c7cd3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

release/pypi/prep_binary_for_pypi.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ for whl_file in "$@"; do
2929
)
3030
version_with_suffix=$(grep '^Version:' "${whl_dir}"/*/METADATA | cut -d' ' -f2)
3131
version_with_suffix_escaped=${version_with_suffix/+/%2B}
32+
3233
# Remove all suffixed +bleh versions
3334
version_no_suffix=${version_with_suffix/+*/}
3435
new_whl_file=${OUTPUT_DIR}/$(basename "${whl_file/${version_with_suffix_escaped}/${version_no_suffix}}")
@@ -37,6 +38,12 @@ for whl_file in "$@"; do
3738
dirname_dist_info_folder=$(dirname "${dist_info_folder}")
3839
(
3940
set -x
41+
42+
# Special build with pypi cudnn remove it from version
43+
if [[ $whl_file == *"with.pypi.cudnn"* ]]; then
44+
sed -i -e "s/-with-pypi-cudnn//g" "${whl_dir}/torch/version.py"
45+
fi
46+
4047
find "${dist_info_folder}" -type f -exec sed -i "s!${version_with_suffix}!${version_no_suffix}!" {} \;
4148
# Moves distinfo from one with a version suffix to one without
4249
# Example: torch-1.8.0+cpu.dist-info => torch-1.8.0.dist-info

0 commit comments

Comments
 (0)