From 384fab86ef4e9a79bf46aeebbfa24fbc31d73363 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Thu, 20 Jun 2013 14:50:20 +0900 Subject: [PATCH] add EZ_SETUP_URL and GET_PIP_URL --- README.md | 4 +++- bin/pyenv-virtualenv | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 66bbe52..ef00f1d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,9 @@ You can set certain environment variables to control the pyenv-virtualenv. * `VIRTUALENV_VERSION`, if set, forces pyenv-virtualenv to install desired version of virtualenv. If the virtualenv has not been installed, pyenv-virtualenv will try to install the given version of virtualenv. -* `SETUPTOOLS_VERSION` and `PIP_VERSION`, if set and if pyvenv is preferred +* `EZ_SETUP_URL` and `GET_PIP_URL`, if set and pyvenv is preferred + than virtualenv, download `ez_setup.py` and `get_pip.py` from specified URL. +* `SETUPTOOLS_VERSION` and `PIP_VERSION`, if set and pyvenv is preferred than virtualenv, install specified version of setuptools and pip. diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index 3dd8699..c1f3d64 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -293,12 +293,14 @@ if [ ! -e "${VIRTUALENV_PATH}/bin/python" ]; then fi if virtualenv_is_pyvenv; then + [ -n "${EZ_SETUP_URL}" ] || EZ_SETUP_URL="https://bitbucket.org/pypa/setuptools/raw/${SETUPTOOLS_VERSION:-0.7.4}/ez_setup.py" PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python -c 'import setuptools' 1>/dev/null 2>&1 || { - http get "https://bitbucket.org/pypa/setuptools/raw/${SETUPTOOLS_VERSION:-0.7.4}/ez_setup.py" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python + http get "${EZ_SETUP_URL}" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python } + [ -n "${GET_PIP_URL}" ] || GET_PIP_URL="https://raw.github.com/pypa/pip/${PIP_VERSION:-master}/contrib/get-pip.py" PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-which pip 1>/dev/null 2>&1 || { - http get "https://raw.github.com/pypa/pip/${PIP_VERSION:-master}/contrib/get-pip.py" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python + http get "${GET_PIP_URL}" | PYENV_VERSION="${VIRTUALENV_NAME}" pyenv-exec python } fi