Skip to content

Commit f921e5e

Browse files
authored
Revert Create copy of nightly wheel without version number (#9318)
1 parent e38d280 commit f921e5e

File tree

1 file changed

+8
-14
lines changed
  • infra/ansible/roles/build_srcs/tasks

1 file changed

+8
-14
lines changed

infra/ansible/roles/build_srcs/tasks/main.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@
9191

9292
- name: Rename and append +YYYYMMDD suffix to nightly wheels
9393
ansible.builtin.shell: |
94-
# For both torch and torch_xla, we would like to have three copies of each
95-
# wheel. One with the date and version number, one with the version number
96-
# but no date, and one without date or version number.
94+
# For both torch and torch_xla, we would like to have one wheel without
95+
# date, and another copy of the same wheel with a date in the file name.
9796
# This script normalizes wheel names to:
9897
#
99-
# torch_xla.dev-cp310-cp310-linux_x86_64.whl
10098
# torch_xla-2.5.0.dev-cp310-cp310-linux_x86_64.whl
10199
# torch_xla-2.5.0.dev20240819-cp310-cp310-linux_x86_64.whl (extra copy)
102100
#
@@ -112,8 +110,8 @@
112110
# group 5: anything from next - to the end: `cp310-cp310-linux_x86_64.whl`.
113111
rename -v "s/^(.*?)\-(.*?)(\+([^ -]+))?\-(.+)/\1-\2.dev-\5/" *.whl
114112
115-
# At this point, we have *.dev*.whl files. Now we want to produce the other
116-
# versions as copies without losing the .dev one.
113+
# At this point, we have *.dev*.whl files. Now we want to produce the dated
114+
# YYYYMMDD versions as a second copy without losing the .dev one.
117115
current_date="$(date -u +%Y%m%d)"
118116
119117
for f in *.whl; do
@@ -123,14 +121,10 @@
123121
# torch-2.6.0.dev-cp310-cp310-linux_x86_64.whl
124122
# becomes
125123
# torch-2.6.0.dev20241206-cp310-cp310-linux_x86_64.whl
126-
datedf="${f/.dev-/.dev${current_date}-}"
127-
# Remove the version number. For example:
128-
# torch.dev-cp310-cp310-linux_x86_64.whl
129-
unversionedf="$(echo $f | sed 's/-.*\.dev/.dev/1')"
130-
131-
# Copy the file to the new filenames.
132-
cp "$f" "$datedf"
133-
cp "$f" "$unversionedf"
124+
newf="${f/.dev-/.dev${current_date}-}"
125+
126+
# Copy the file to the new filename.
127+
cp "$f" "$newf"
134128
fi
135129
done
136130
args:

0 commit comments

Comments
 (0)