Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip pypi-cudnn from the version.py #1167

Merged
merged 2 commits into from
Oct 20, 2022
Merged
Changes from 1 commit
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" ./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