-
-
Save robo-corg/f712d55dc9f167a004ba96e997e88fce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://github.com/mitsuhiko/pipsi | |
BOOTSTRAP_DIR=~/.local/venvs/__bootstrap | |
BOOTSTRAP_PKGS=$(cat <<EOF | |
virtualenv | |
EOF | |
) | |
CMD=pipsi | |
VENV_DIR=~/.local/venvs/pipsi | |
BIN_DIR=~/.local/bin | |
PACKAGES=$(cat <<EOF | |
-e git+https://github.com/mitsuhiko/pipsi.git#egg=pipsi | |
EOF | |
) | |
set -e | |
( | |
echo 'Create the bootstrapping virtualenv w/ python 3'"'"'s `venv`' | |
set -x | |
/usr/bin/env python3 -m venv "${BOOTSTRAP_DIR}" | |
) | |
( | |
echo 'Activate bootstrapping virtualenv' | |
cd "${BOOTSTRAP_DIR}/bin/" | |
source ./activate # sourced with path prefix for pyenv compatibility | |
set -x | |
echo 'Install `virtualenv` into bootstrapping virtualenv' | |
"${BOOTSTRAP_DIR}/bin/pip" install -U pip | |
"${BOOTSTRAP_DIR}/bin/pip" install ${BOOTSTRAP_PKGS} | |
echo 'Create pipsi virtualenv w/ `virtualenv`' | |
virtualenv --python=python3 "${VENV_DIR}" | |
) | |
( | |
echo 'Activate pipsi virtualenv' | |
cd "${VENV_DIR}/bin/" | |
source ./activate | |
set -x | |
echo 'Install `pipsi` and `virtualenv`' | |
"${VENV_DIR}/bin/pip" install -U pip | |
"${VENV_DIR}/bin/pip" install ${BOOTSTRAP_PKGS} | |
"${VENV_DIR}/bin/pip" install ${PACKAGES} | |
mkdir -p "${BIN_DIR}" | |
ln -s "${VENV_DIR}/bin/${CMD}" "${BIN_DIR}/" | |
) | |
( | |
set -x | |
echo 'Clean up bootstrapping virtualenv' | |
rm -rf "${BOOTSTRAP_DIR}" | |
) | |
${CMD} --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment