6 Commits

Author SHA1 Message Date
Yamashita Yuu
c9043920db v20140602 2014-06-02 21:42:27 +09:00
Yamashita Yuu
26f2004abb Add semicolon for the deactivate scripts for non-fish 2014-06-02 16:02:39 +09:00
Yamashita, Yuu
b9e2fc6acb Merge pull request #23 from fgimian/fish-activation-fix
Repaired virtualenv activation and deactivation for the fish shell
2014-05-31 14:19:02 +09:00
Fotis Gimian
21a8745bcf Updated tests to correctly pass for fish shell bug fix 2014-05-31 15:15:45 +10:00
Fotis Gimian
f7da0c5808 Repaired virtualenv activation and deactivation for the fish shell 2014-05-31 12:29:19 +10:00
Yamashita Yuu
3f5171e2fc Use new style GH raw url to avoid redirects (raw.github.com -> raw.githubusercontent.com) 2014-04-30 11:52:15 +09:00
9 changed files with 17 additions and 40 deletions

View File

@@ -131,6 +131,11 @@ You can set certain environment variables to control the pyenv-virtualenv.
## Version History ## 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 #### 20140421
* Display error if `pyenv activate` was invoked as a command * Display error if `pyenv activate` was invoked as a command

View File

@@ -41,7 +41,7 @@ fi
pyenv-virtualenv-prefix "${versions}" 1>/dev/null pyenv-virtualenv-prefix "${versions}" 1>/dev/null
echo "pyenv shell \"${versions}\"" echo "pyenv shell \"${versions}\";"
case "$shell" in case "$shell" in
fish ) echo ". \"$(pyenv-prefix "${versions}")/bin/activate.fish\"" ;; fish ) echo ". \"$(pyenv-prefix "${versions}")/bin/activate.fish\"" ;;
* ) echo "source \"$(pyenv-prefix "${versions}")/bin/activate\"" ;; * ) echo "source \"$(pyenv-prefix "${versions}")/bin/activate\"" ;;

View File

@@ -11,7 +11,7 @@ set -e
shell="$(basename "${PYENV_SHELL:-$SHELL}")" shell="$(basename "${PYENV_SHELL:-$SHELL}")"
case "$shell" in case "$shell" in
fish ) echo "functions -q deactivate; and deactivate";; fish ) echo "functions -q deactivate; and deactivate;";;
* ) echo "declare -f deactivate 1>/dev/null 2>&1 && deactivate";; * ) echo "declare -f deactivate 1>/dev/null 2>&1 && deactivate;";;
esac esac
echo "pyenv shell --unset" echo "pyenv shell --unset"

View File

@@ -11,7 +11,7 @@
# -f/--force Install even if the version appears to be installed already # -f/--force Install even if the version appears to be installed already
# #
PYENV_VIRTUALENV_VERSION="20140421" PYENV_VIRTUALENV_VERSION="20140602"
set -e set -e
[ -n "$PYENV_DEBUG" ] && set -x [ -n "$PYENV_DEBUG" ] && set -x
@@ -181,9 +181,9 @@ install_pip() {
else else
[ -n "${GET_PIP_URL}" ] || { [ -n "${GET_PIP_URL}" ] || {
if [ -n "${PIP_VERSION}" ]; then 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 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 fi
} }
if [ -n "$VERBOSE" ]; then if [ -n "$VERBOSE" ]; then

View File

@@ -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

View File

@@ -12,10 +12,7 @@ if [ -z "${PREFIX}" ]; then
fi fi
BIN_PATH="${PREFIX}/bin" BIN_PATH="${PREFIX}/bin"
ETC_PATH="${PREFIX}/etc/pyenv.d"
mkdir -p "$BIN_PATH" mkdir -p "$BIN_PATH"
mkdir -p "$ETC_PATH"
install -p bin/* "$BIN_PATH" install -p bin/* "$BIN_PATH"
cp -RPp etc/pyenv.d/* "$ETC_PATH"

View File

@@ -19,7 +19,7 @@ setup() {
assert_success assert_success
assert_output <<EOS assert_output <<EOS
pyenv shell "venv" pyenv shell "venv";
source "${PYENV_ROOT}/versions/venv/bin/activate" source "${PYENV_ROOT}/versions/venv/bin/activate"
EOS EOS
} }
@@ -37,7 +37,7 @@ EOS
assert_success assert_success
assert_output <<EOS assert_output <<EOS
pyenv shell "venv" pyenv shell "venv";
. "${PYENV_ROOT}/versions/venv/bin/activate.fish" . "${PYENV_ROOT}/versions/venv/bin/activate.fish"
EOS EOS
} }
@@ -53,7 +53,7 @@ EOS
assert_success assert_success
assert_output <<EOS assert_output <<EOS
pyenv shell "venv27" pyenv shell "venv27";
source "${PYENV_ROOT}/versions/venv27/bin/activate" source "${PYENV_ROOT}/versions/venv27/bin/activate"
EOS EOS
} }

View File

@@ -11,7 +11,7 @@ setup() {
assert_success assert_success
assert_output <<EOS assert_output <<EOS
declare -f deactivate 1>/dev/null 2>&1 && deactivate declare -f deactivate 1>/dev/null 2>&1 && deactivate;
pyenv shell --unset pyenv shell --unset
EOS EOS
} }
@@ -21,7 +21,7 @@ EOS
assert_success assert_success
assert_output <<EOS assert_output <<EOS
functions -q deactivate; and deactivate functions -q deactivate; and deactivate;
pyenv shell --unset pyenv shell --unset
EOS EOS
} }

View File

@@ -4,7 +4,7 @@ load test_helper
setup() { setup() {
export PYENV_ROOT="${TMP}/pyenv" export PYENV_ROOT="${TMP}/pyenv"
export PYENV_VIRTUALENV_VERSION="20140421" export PYENV_VIRTUALENV_VERSION="20140602"
} }
@test "display virtualenv version" { @test "display virtualenv version" {