Skip to content

Instantly share code, notes, and snippets.

@timonwong
Last active August 29, 2015 14:01
Show Gist options
  • Save timonwong/92d19a2709898ed93c79 to your computer and use it in GitHub Desktop.
Save timonwong/92d19a2709898ed93c79 to your computer and use it in GitHub Desktop.
#!/bin/bash
# !!path to the pip binary!!
PIP_BIN=/opt/python2.7/bin/pip
WHEEL_DIR=wheelhouse
DOWNLOAD_CACHE_DIR=cache
PIP_WHELL_REQUIREMENT="$@"
echo ${PIP_WHELL_REQUIREMENT}
#rm -rf ${DOWNLOAD_CACHE_DIR}
mkdir -p ${DOWNLOAD_CACHE_DIR}
${PIP_BIN} wheel -f "$WHEEL_DIR" \
-i http://pypi.douban.com/simple/ \
-f http://pypi.douban.com/simple/ \
--download-cache "$DOWNLOAD_CACHE_DIR" ${PIP_WHELL_REQUIREMENT}
for f in $(find "$DOWNLOAD_CACHE_DIR" -type f -name '*.whl'); do
actual_wheel=${f##*%2F}
echo "Copying ${f##*/} to ${actual_wheel}..."
cp "${f}" "${WHEEL_DIR}/${actual_wheel}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment