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

Commit cda42ec

Browse files
committed
add a date to make the dev wheels sortable
1 parent 5ff80f0 commit cda42ec

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

azure/posix.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -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
@@ -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.
144-
echo uploading numpy/dist/numpy-*.whl
145-
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG numpy/dist/numpy-*.whl
142+
source extra_functions.sh
143+
for f in wheelhouse/*.whl; do rename_wheel $f; done
144+
145+
echo uploading wheelhouse/*.whl
146+
147+
anaconda -t $TOKEN upload -u $ANACONDA_ORG wheelhouse/*.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

+13
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,18 @@ function teardown_test_venv {
3030
fi
3131
fi
3232
}
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+
echo "$1" | sed "s/\(.*dev0+\)\([a-z0-9]*-.*\)/\1$(date '+%Y%m%d%H%M%S_')\2/"
44+
}
45+
3346
# Work around bug in multibuild
3447
if [ ! -o PIP_CMD ]; then PIP_CMD="$PYTHON_EXE -m pip"; fi

0 commit comments

Comments
 (0)