Skip to content

Instantly share code, notes, and snippets.

@ionelmc
Last active December 20, 2015 23:58
Show Gist options
  • Select an option

  • Save ionelmc/6215920 to your computer and use it in GitHub Desktop.

Select an option

Save ionelmc/6215920 to your computer and use it in GitHub Desktop.
replacing pip bundle with pip wheels
#!/bin/bash -eE
-pip bundle -r requirements.txt --timeout=60 --download-cache=.pip-cache --use-mirrors deps.zip
+(
+ tempdir=$(mktemp -d /tmp/wheelhouse-XXXXX)
+ trap 'rm -rf "$tempdir"' EXIT QUIT
+ pip wheel -r requirements.txt --timeout=60 --download-cache=.pip-cache --use-mirrors --wheel-dir=$tempdir
+ cwd=`pwd`
+ (cd "$tempdir"; tar -cjvf "$cwd/deps.tar.bz2" *)
+)
#!/bin/bash -eE
-/path/to/environment/bin/pip install --force-reinstall --ignore-installed /path/to/deps.zip
+(
+ tempdir=$(mktemp -d /tmp/wheelhouse-XXXXX)
+ trap 'rm -rf "$tempdir"' EXIT QUIT
+ (cd $tempdir; tar -xvf /path/to/deps.tar.bz2)
+ /path/to/environment/bin/pip install --force-reinstall --ignore-installed --upgrade --no-index --use-wheel --no-deps $tempdir/*
+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment