mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-13 14:03:53 -05:00
store distribute/setuptools archive in $PYTHON_BUILD_CACHE_PATH to reuse
them between invocations.
This commit is contained in:
@@ -133,8 +133,14 @@ fi
|
|||||||
VIRTUALENV_NAME="${ARGUMENTS[1]##*/}"
|
VIRTUALENV_NAME="${ARGUMENTS[1]##*/}"
|
||||||
VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VIRTUALENV_NAME}"
|
VIRTUALENV_PATH="${PYENV_ROOT}/versions/${VIRTUALENV_NAME}"
|
||||||
|
|
||||||
# create virtualenv
|
# virtualenv may download distribute/setuptools in current directory.
|
||||||
"${PYTHON_BIN}" "${VIRTUALENV}" "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}"
|
# change to cache directory to reuse them between invocation.
|
||||||
|
VIRTUALENV_CACHE_PATH="${PYTHON_BUILD_CACHE_PATH:-${PYENV_ROOT}/cache}"
|
||||||
|
mkdir -p "${VIRTUALENV_CACHE_PATH}"
|
||||||
|
{
|
||||||
|
cd "${VIRTUALENV_CACHE_PATH}"
|
||||||
|
"${PYTHON_BIN}" "${VIRTUALENV}" "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
# create symlink of `python' bound for actual executable
|
# create symlink of `python' bound for actual executable
|
||||||
if [ ! -f "$VIRTUALENV_PYTHON_BIN" ]; then
|
if [ ! -f "$VIRTUALENV_PYTHON_BIN" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user