-
Notifications
You must be signed in to change notification settings - Fork 3
/
rename_wheel__github_actions__macos__cpython.sh
executable file
·160 lines (151 loc) · 3.97 KB
/
rename_wheel__github_actions__macos__cpython.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 PYTHON_VER PLATFORM_TAG"
exit 1
fi
PYTHON_VER="$1"
PLATFORM_TAG="$2"
# Determine the short Python version string
case "$PYTHON_VER" in
"3.8")
PYTHON_SHORT_VER="cp38"
;;
"3.9")
PYTHON_SHORT_VER="cp39"
;;
"3.10")
PYTHON_SHORT_VER="cp310"
;;
"3.11")
PYTHON_SHORT_VER="cp311"
;;
"3.12")
PYTHON_SHORT_VER="cp312"
;;
"3.13")
PYTHON_SHORT_VER="cp313"
;;
*)
echo "Unsupported Python version"
exit 1
;;
esac
# Determine the platform tag string
case "$PLATFORM_TAG" in
"macos-13")
PLATFORM_TAG_STR="macosx_13_0_x86_64"
;;
"macos-14")
PLATFORM_TAG_STR="macosx_14_0_arm64"
;;
*)
echo "Unsupported platform tag"
exit 1
;;
esac
# # # Determine the platform tag string
# # case "$PLATFORM_TAG" in
# # "macos-13")
# # PLATFORM_TAG_STR="macosx_13_0_universal2"
# # ;;
# # "macos-14")
# # PLATFORM_TAG_STR="macosx_14_0_universal2"
# # ;;
# # *)
# # echo "Unsupported platform tag"
# # exit 1
# # ;;
# # esac
# # Determine the short Python version string
# case "$PYTHON_VER" in
# "3.8")
# # Determine the platform tag string
# case "$PLATFORM_TAG" in
# "macos-13")
# PLATFORM_TAG_STR="macosx_13_0_x86_64"
# ;;
# "macos-14")
# PLATFORM_TAG_STR="macosx_14_0_arm64"
# ;;
# *)
# echo "Unsupported platform tag"
# exit 1
# ;;
# esac
# ;;
# "3.9")
# # Determine the platform tag string
# case "$PLATFORM_TAG" in
# "macos-13")
# PLATFORM_TAG_STR="macosx_13_0_x86_64"
# ;;
# "macos-14")
# PLATFORM_TAG_STR="macosx_14_0_arm64"
# ;;
# *)
# echo "Unsupported platform tag"
# exit 1
# ;;
# esac
# ;;
# "3.10")
# # Determine the platform tag string
# case "$PLATFORM_TAG" in
# "macos-13")
# PLATFORM_TAG_STR="macosx_13_0_x86_64"
# ;;
# "macos-14")
# PLATFORM_TAG_STR="macosx_14_0_universal2"
# ;;
# *)
# echo "Unsupported platform tag"
# exit 1
# ;;
# esac
# ;;
# "3.11")
# # Determine the platform tag string
# case "$PLATFORM_TAG" in
# "macos-13")
# PLATFORM_TAG_STR="macosx_13_0_universal2"
# ;;
# "macos-14")
# PLATFORM_TAG_STR="macosx_14_0_universal2"
# ;;
# *)
# echo "Unsupported platform tag"
# exit 1
# ;;
# esac
# ;;
# "3.12")
# # Determine the platform tag string
# case "$PLATFORM_TAG" in
# "macos-13")
# PLATFORM_TAG_STR="macosx_13_0_universal2"
# ;;
# "macos-14")
# PLATFORM_TAG_STR="macosx_14_0_universal2"
# ;;
# *)
# echo "Unsupported platform tag"
# exit 1
# ;;
# esac
# ;;
# *)
# echo "Unsupported Python version"
# exit 1
# ;;
# esac
WHEELHOUSE_DIR="wheelhouse_temp"
shopt -s nullglob
for file in "$WHEELHOUSE_DIR"/cengal-*-py3-none-any.whl; do
if [ -f "$file" ]; then
version=$(echo "$file" | sed 's|.*/cengal-\(.*\)-py3-none-any.whl|\1|')
new_filename="$WHEELHOUSE_DIR/cengal-${version}-${PYTHON_SHORT_VER}-none-${PLATFORM_TAG_STR}.whl"
echo "Renaming $file to $new_filename"
mv "$file" "$new_filename"
fi
done
shopt -u nullglob