public
Last active

pip vendor libs

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
V=2.7
rm -rf build-env
rm -rf vendor/setuptools-*.egg vendor/pip-*.egg
virtualenv --python python$V --no-site-packages build-env
mv build-env/lib/python$V/site-packages/ build-env/lib/python$V/orig-site-packages
(cd build-env/lib/python$V &&
ln -s ../../../vendor site-packages &&
cd ../.. && mv bin bin-orig &&
ln -s ../vendor/bin bin &&
mv bin-orig/python* bin/ )
rm build-env/lib/python$V/orig-site-packages/easy-install.pth
mv build-env/lib/python$V/orig-site-packages/* build-env/lib/python$V/site-packages/
rmdir build-env/lib/python$V/orig-site-packages
pip -E build-env install --install-option="--install-platlib=$(pwd)/vendor/binary-libs" -r prod-reqs.txt
 
# If you see something in vendor/binary-libs, it is a library that can't be a proper vendor lib
# Scripts in vendor/bin need to be fixed up
# You should ignore vendor/bin/python*, vendor/setuptools-*.egg vendor/pip-*.egg vendor/setuptools.pth

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.