|
91 | 91 |
|
92 | 92 | - name: Rename and append +YYYYMMDD suffix to nightly wheels
|
93 | 93 | ansible.builtin.shell: |
|
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. |
| 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. |
96 | 97 | # This script normalizes wheel names to:
|
97 | 98 | #
|
| 99 | + # torch_xla.dev-cp310-cp310-linux_x86_64.whl |
98 | 100 | # torch_xla-2.5.0.dev-cp310-cp310-linux_x86_64.whl
|
99 | 101 | # torch_xla-2.5.0.dev20240819-cp310-cp310-linux_x86_64.whl (extra copy)
|
100 | 102 | #
|
|
110 | 112 | # group 5: anything from next - to the end: `cp310-cp310-linux_x86_64.whl`.
|
111 | 113 | rename -v "s/^(.*?)\-(.*?)(\+([^ -]+))?\-(.+)/\1-\2.dev-\5/" *.whl
|
112 | 114 |
|
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. |
| 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. |
115 | 117 | current_date="$(date -u +%Y%m%d)"
|
116 |
| - wheels=( *.whl ) |
117 | 118 |
|
118 | 119 | for f in *.whl; do
|
119 | 120 | if [[ "$f" == *".dev-"* ]]; then
|
|
122 | 123 | # torch-2.6.0.dev-cp310-cp310-linux_x86_64.whl
|
123 | 124 | # becomes
|
124 | 125 | # torch-2.6.0.dev20241206-cp310-cp310-linux_x86_64.whl
|
125 |
| - newf="${f/.dev-/.dev${current_date}-}" |
126 |
| -
|
127 |
| - # Copy the file to the new filename. |
128 |
| - cp "$f" "$newf" |
| 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" |
129 | 134 | fi
|
130 | 135 | done
|
131 | 136 | args:
|
|
0 commit comments