-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Add script to automatically download wheels #50859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/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 | ||
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)">.*/\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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a small QOL improvement would be to print which wheels were downloaded? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if I know how to do it without making the script significantly more complex. I can just do a It's not super nice, but the log of wget shows the file names as they are downloaded. There is some noise in between files, but my preference would be to just have that. The alternatives I see are to save the url list in a temporary file, and then print the file content with a regex to remove the parts of the url that are not the file. Not worth in my opinion. |
||
printf "\ttwine upload ${DIST_DIR}/pandas-${VERSION}*.{whl,tar.gz} --skip-existing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not now, but in the future, might want to expand this to downloading the sdist too when we move to cibuildwheel(hopefully for 2.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no sdist now in https://anaconda.org/multibuild-wheels-staging/pandas/files?version=1.5.3 . We can add it by editing the regex if the new implementation adds it. We can also edit the release instructions at that point to not build the sdist locally.