mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-09 12:03:55 -05:00
Compare commits
6 Commits
check-usag
...
v20140602
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9043920db | ||
|
|
26f2004abb | ||
|
|
b9e2fc6acb | ||
|
|
21a8745bcf | ||
|
|
f7da0c5808 | ||
|
|
3f5171e2fc |
@@ -131,6 +131,11 @@ You can set certain environment variables to control the pyenv-virtualenv.
|
||||
|
||||
## Version History
|
||||
|
||||
#### 20140602
|
||||
|
||||
* Use new style GH raw url to avoid redirects (raw.github.com -> raw.githubusercontent.com)
|
||||
* Repaired virtualenv activation and deactivation for the fish shell (#23)
|
||||
|
||||
#### 20140421
|
||||
|
||||
* Display error if `pyenv activate` was invoked as a command
|
||||
|
||||
@@ -41,7 +41,7 @@ fi
|
||||
|
||||
pyenv-virtualenv-prefix "${versions}" 1>/dev/null
|
||||
|
||||
echo "pyenv shell \"${versions}\""
|
||||
echo "pyenv shell \"${versions}\";"
|
||||
case "$shell" in
|
||||
fish ) echo ". \"$(pyenv-prefix "${versions}")/bin/activate.fish\"" ;;
|
||||
* ) echo "source \"$(pyenv-prefix "${versions}")/bin/activate\"" ;;
|
||||
|
||||
@@ -11,7 +11,7 @@ set -e
|
||||
|
||||
shell="$(basename "${PYENV_SHELL:-$SHELL}")"
|
||||
case "$shell" in
|
||||
fish ) echo "functions -q deactivate; and deactivate";;
|
||||
* ) echo "declare -f deactivate 1>/dev/null 2>&1 && deactivate";;
|
||||
fish ) echo "functions -q deactivate; and deactivate;";;
|
||||
* ) echo "declare -f deactivate 1>/dev/null 2>&1 && deactivate;";;
|
||||
esac
|
||||
echo "pyenv shell --unset"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# -f/--force Install even if the version appears to be installed already
|
||||
#
|
||||
|
||||
PYENV_VIRTUALENV_VERSION="20140421"
|
||||
PYENV_VIRTUALENV_VERSION="20140602"
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
@@ -181,9 +181,9 @@ install_pip() {
|
||||
else
|
||||
[ -n "${GET_PIP_URL}" ] || {
|
||||
if [ -n "${PIP_VERSION}" ]; then
|
||||
GET_PIP_URL="https://raw.github.com/pypa/pip/${PIP_VERSION}/contrib/get-pip.py"
|
||||
GET_PIP_URL="https://raw.githubusercontent.com/pypa/pip/${PIP_VERSION}/contrib/get-pip.py"
|
||||
else
|
||||
GET_PIP_URL="https://raw.github.com/pypa/pip/master/contrib/get-pip.py"
|
||||
GET_PIP_URL="https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py"
|
||||
fi
|
||||
}
|
||||
if [ -n "$VERBOSE" ]; then
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
VERSION_NAME="${DEFINITION##*/}"
|
||||
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||
|
||||
if ! pyenv-virtualenv-prefix "${VERSION_NAME}" 1>/dev/null 2>&1; then
|
||||
OLDIFS="$IFS"
|
||||
IFS=$'\n' virtualenvs=($(pyenv-virtualenvs --bare))
|
||||
IFS="$OLDIFS"
|
||||
|
||||
declare -a dependencies
|
||||
for venv in "${virtualenvs[@]}"; do
|
||||
venv_prefix="$(pyenv-virtualenv-prefix "${venv}" 2>/dev/null || true)"
|
||||
if [ -d "${venv_prefix}" ] && [ "${PREFIX}" = "${venv_prefix}" ]; then
|
||||
dependencies[${#dependencies[*]}]="${venv}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$FORCE" ] && [ -n "$dependencies" ]; then
|
||||
echo "pyenv: ${#dependencies[@]} virtualenv(s) is depending on $PREFIX." >&2
|
||||
read -p "continue with uninstallation? (y/N) "
|
||||
case "$REPLY" in
|
||||
y* | Y* ) ;;
|
||||
* ) exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
@@ -12,10 +12,7 @@ if [ -z "${PREFIX}" ]; then
|
||||
fi
|
||||
|
||||
BIN_PATH="${PREFIX}/bin"
|
||||
ETC_PATH="${PREFIX}/etc/pyenv.d"
|
||||
|
||||
mkdir -p "$BIN_PATH"
|
||||
mkdir -p "$ETC_PATH"
|
||||
|
||||
install -p bin/* "$BIN_PATH"
|
||||
cp -RPp etc/pyenv.d/* "$ETC_PATH"
|
||||
|
||||
@@ -19,7 +19,7 @@ setup() {
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv shell "venv"
|
||||
pyenv shell "venv";
|
||||
source "${PYENV_ROOT}/versions/venv/bin/activate"
|
||||
EOS
|
||||
}
|
||||
@@ -37,7 +37,7 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv shell "venv"
|
||||
pyenv shell "venv";
|
||||
. "${PYENV_ROOT}/versions/venv/bin/activate.fish"
|
||||
EOS
|
||||
}
|
||||
@@ -53,7 +53,7 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv shell "venv27"
|
||||
pyenv shell "venv27";
|
||||
source "${PYENV_ROOT}/versions/venv27/bin/activate"
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ setup() {
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
declare -f deactivate 1>/dev/null 2>&1 && deactivate
|
||||
declare -f deactivate 1>/dev/null 2>&1 && deactivate;
|
||||
pyenv shell --unset
|
||||
EOS
|
||||
}
|
||||
@@ -21,7 +21,7 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
functions -q deactivate; and deactivate
|
||||
functions -q deactivate; and deactivate;
|
||||
pyenv shell --unset
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ load test_helper
|
||||
|
||||
setup() {
|
||||
export PYENV_ROOT="${TMP}/pyenv"
|
||||
export PYENV_VIRTUALENV_VERSION="20140421"
|
||||
export PYENV_VIRTUALENV_VERSION="20140602"
|
||||
}
|
||||
|
||||
@test "display virtualenv version" {
|
||||
|
||||
Reference in New Issue
Block a user