Skip to content

Commit d1efef0

Browse files
committed
Fix wheel naming
1 parent 6180011 commit d1efef0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ci/build_pynvbench_wheel_inner.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,22 @@ mkdir -p /workspace/wheelhouse
6262
for wheel in dist_repaired/pynvbench-*.whl; do
6363
if [[ -f "$wheel" ]]; then
6464
base_name=$(basename "$wheel" .whl)
65-
# Insert CUDA version before the platform tag
66-
# e.g., pynvbench-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
67-
# becomes pynvbench-0.1.0+cu12-cp312-cp312-manylinux_2_28_x86_64.whl
65+
# Append CUDA version to the local version identifier
66+
# e.g., pynvbench-0.1.0.dev1+gabc123-cp312-cp312-manylinux_2_28_x86_64.whl
67+
# becomes pynvbench-0.1.0.dev1+gabc123.cu12-cp312-cp312-manylinux_2_28_x86_64.whl
6868
if [[ "$base_name" =~ ^(.*)-cp([0-9]+)-cp([0-9]+)-(.*) ]]; then
6969
pkg_version="${BASH_REMATCH[1]}"
7070
py_tag="cp${BASH_REMATCH[2]}"
7171
abi_tag="cp${BASH_REMATCH[3]}"
7272
platform="${BASH_REMATCH[4]}"
73-
new_name="${pkg_version}+cu${cuda_major}-${py_tag}-${abi_tag}-${platform}.whl"
73+
# If version has a local part (contains +), append .cu${cuda_major} to it
74+
# Otherwise add +cu${cuda_major}
75+
if [[ "$pkg_version" =~ \+ ]]; then
76+
new_version="${pkg_version}.cu${cuda_major}"
77+
else
78+
new_version="${pkg_version}+cu${cuda_major}"
79+
fi
80+
new_name="${new_version}-${py_tag}-${abi_tag}-${platform}.whl"
7481
mv "$wheel" "/workspace/wheelhouse/${new_name}"
7582
echo "Renamed wheel to: ${new_name}"
7683
else

0 commit comments

Comments
 (0)