Skip to content

Commit

Permalink
Merge pull request h5py#2004 from takluyver/aarch64-wheels-refine
Browse files Browse the repository at this point in the history
Refine how aarch64 wheels are named for upload to anaconda.org
  • Loading branch information
aragilar authored Nov 24, 2021
2 parents f155036 + d3048e4 commit 050c8fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ after_success:
# ANACONDA_ORG_UPLOAD_TOKEN is a secret token
# used in Travis CI config, originally
# generated at anaconda.org for scipy-wheels-nightly (cron jobs).
- if [[ $CIBW_ARCHS == aarch64 && "$TRAVIS_EVENT_TYPE" == "cron" ]]; then bash ci/upload_wheels.sh; fi
- if [[ $CIBW_ARCHS == aarch64 ]]; then bash ci/upload_wheels.sh; fi
32 changes: 22 additions & 10 deletions ci/upload_wheels.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
ANACONDA_ORG="scipy-wheels-nightly";
pip install git+https://github.com/Anaconda-Server/anaconda-client;

# rename wheels
# appending timestamp to wheels package name
# e.g. h5py-3.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl to h5py-3.3.0-20211004151033-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
for whl in ${TRAVIS_BUILD_DIR}/wheelhouse/h5py-*.whl; do
newname=$(echo "$whl" | sed "s/\(h5py-[0-9][0-9]*[.[0-9]*]*-\)\(cp*\)/\1$(date '+%Y%m%d%H%M%S')-\2/")
if [ "$newname" != "$whl" ]; then
mv $whl $newname
fi
done
if [[ "$TRAVIS_EVENT_TYPE" != "cron" && -z "$TRAVIS_TAG" ]] ; then
echo "Not uploading wheels (build not for cron or git tag)"
exit 0
fi

# rename wheels if not on a tag
# inserting commit count & hash from git describe
# e.g. h5py-3.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl to
# h5py-3.3.0-3-g4320f2ea-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
if [[ -z "$TRAVIS_TAG" ]] ; then
descr=$(git describe --tags)
descr=${descr#*-} # Chop off tag (should be version number)
build_tag=${descr//-/_} # Convert - to _ for build tag
echo "Setting build tag to ${build_tag}"
for whl in "${TRAVIS_BUILD_DIR}"/wheelhouse/h5py-*.whl; do
newname=$(echo "$whl" | sed "s/\(h5py-[0-9][0-9]*[.[0-9]*]*-\)\(cp*\)/\1${build_tag}-\2/")
if [ "$newname" != "$whl" ]; then
mv "$whl" "$newname"
fi
done
fi

# upload wheels
if [[ -n "${ANACONDA_ORG_UPLOAD_TOKEN}" ]] ; then
anaconda -t ${ANACONDA_ORG_UPLOAD_TOKEN} upload --force -u ${ANACONDA_ORG} ${TRAVIS_BUILD_DIR}/wheelhouse/h5py-*.whl;
anaconda -t ${ANACONDA_ORG_UPLOAD_TOKEN} upload -u ${ANACONDA_ORG} "${TRAVIS_BUILD_DIR}"/wheelhouse/h5py-*.whl;
fi;

0 comments on commit 050c8fc

Please sign in to comment.