|
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 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. |
97 | 96 | # This script normalizes wheel names to: |
98 | 97 | # |
99 | | - # torch_xla.dev-cp310-cp310-linux_x86_64.whl |
100 | 98 | # torch_xla-2.5.0.dev-cp310-cp310-linux_x86_64.whl |
101 | 99 | # torch_xla-2.5.0.dev20240819-cp310-cp310-linux_x86_64.whl (extra copy) |
102 | 100 | # |
|
112 | 110 | # group 5: anything from next - to the end: `cp310-cp310-linux_x86_64.whl`. |
113 | 111 | rename -v "s/^(.*?)\-(.*?)(\+([^ -]+))?\-(.+)/\1-\2.dev-\5/" *.whl |
114 | 112 |
|
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. |
117 | 115 | current_date="$(date -u +%Y%m%d)" |
118 | 116 |
|
119 | 117 | for f in *.whl; do |
|
123 | 121 | # torch-2.6.0.dev-cp310-cp310-linux_x86_64.whl |
124 | 122 | # becomes |
125 | 123 | # 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" |
134 | 128 | fi |
135 | 129 | done |
136 | 130 | args: |
|
0 commit comments