Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 34c2cda

Browse files
authored
Merge pull request #84 from MacPython/rename-wheels
add a date to make the dev wheels sortable
2 parents 5ff80f0 + 9037b26 commit 34c2cda

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

azure/posix.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090

9191
- bash: |
9292
set -e
93-
if [ "$BUILD_REASON" == "Schedule" ]; then
93+
if [ "$BUILD_COMMIT" == "master" ]; then
9494
ANACONDA_ORG="scipy-wheels-nightly"
9595
TOKEN="$MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN"
9696
else
@@ -111,10 +111,12 @@ jobs:
111111
112112
- bash: |
113113
set -e
114-
# The --force option forces a replacement if the remote file already
115-
# exists.
114+
source extra_functions.sh
115+
for f in wheelhouse/*.whl; do rename_wheel $f; done
116+
116117
echo uploading wheelhouse/*.whl
117-
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG wheelhouse/*.whl
118+
119+
anaconda -t $TOKEN upload -u $ANACONDA_ORG wheelhouse/*.whl
118120
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
119121
displayName: Upload to anaconda.org (only if secret token is retrieved)
120122
condition: ne(variables['TOKEN'], '')

azure/windows.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118

119119
- bash: |
120120
set -e
121-
if [ "$BUILD_REASON" == "Schedule" ]; then
121+
if [ "$BUILD_COMMIT" == "master" ]; then
122122
ANACONDA_ORG="scipy-wheels-nightly"
123123
TOKEN="$MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN"
124124
else
@@ -139,10 +139,12 @@ jobs:
139139
140140
- bash: |
141141
set -e
142-
# The --force option forces a replacement if the remote file already
143-
# exists.
142+
source extra_functions.sh
143+
for f in numpy/dist/numpy-*.whl; do rename_wheel $f; done
144+
144145
echo uploading numpy/dist/numpy-*.whl
145-
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG numpy/dist/numpy-*.whl
146+
147+
anaconda -t $TOKEN upload -u $ANACONDA_ORG numpy/dist/numpy-*.whl
146148
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
147149
displayName: Upload to anaconda.org (only if secret token is retrieved)
148150
condition: ne(variables['TOKEN'], '')

extra_functions.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ function teardown_test_venv {
2929
source venv/bin/activate
3030
fi
3131
fi
32-
}
32+
}
33+
34+
function rename_wheel {
35+
# Call with a name like numpy-1.19.0.dev0+58dbafa-cp37-cp37m-linux_x86_64.whl
36+
37+
# Add a date after the dev0+ and before the hash in yyymmddHHMMSS format
38+
# so pip will pick up the newest build. Try a little to make sure
39+
# - the first part ends with 'dev0+'
40+
# - the second part starts with a lower case alphanumeric then a '-'
41+
# if those conditions are not met, the name will be returned as-is
42+
43+
newname=$(echo "$1" | sed "s/\(.*dev0+\)\([a-z0-9]*-.*\)/\1$(date '+%Y%m%d%H%M%S_')\2/")
44+
if [ "$newname" != "$1" ]; then
45+
mv $1 $newname
46+
fi
47+
}
48+
3349
# Work around bug in multibuild
3450
if [ ! -o PIP_CMD ]; then PIP_CMD="$PYTHON_EXE -m pip"; fi

0 commit comments

Comments
 (0)