forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdownload_wheels.sh
executable file
·29 lines (25 loc) · 1.09 KB
/
download_wheels.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
#!/bin/sh
#
# Download all wheels for a pandas version.
#
# This script is mostly useful during the release process, when wheels
# generated by the MacPython repo need to be downloaded locally to then
# be uploaded to the PyPI.
#
# There is no API to access the wheel files, so the script downloads the
# website, extracts the file urls from the html, and then downloads it
# one by one to the dist/ directory where they would be generated.
VERSION=$1
mkdir -p $(dirname -- $0)/../dist
DIST_DIR="$(realpath $(dirname -- $0)/../dist)"
if [ -z $VERSION ]; then
printf "Usage:\n\t$0 <version>\n\nWhere <version> is for example 1.5.3"
exit 1
fi
curl "https://anaconda.org/multibuild-wheels-staging/pandas/files?version=${VERSION}" | \
grep "href=\"/multibuild-wheels-staging/pandas/${VERSION}" | \
sed -r 's/.*<a href="([^"]+\.(whl|tar.gz))">.*/\1/g' | \
awk '{print "https://anaconda.org" $0 }' | \
xargs wget -P $DIST_DIR
printf "\nWheels downloaded to $DIST_DIR\nYou can upload them to PyPI using:\n\n"
printf "\ttwine upload ${DIST_DIR}/pandas-${VERSION}*.{whl,tar.gz} --skip-existing"