mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-12 21:43:51 -05:00
Merge pull request #169 from puhitaku/verbose_env
Suppress activate/deactivate messages by default
This commit is contained in:
@@ -138,7 +138,9 @@ fi
|
||||
|
||||
pyenv-sh-deactivate --force --quiet ${VERBOSE+--verbose} || true
|
||||
|
||||
echo "pyenv-virtualenv: activate ${venv}" 1>&2
|
||||
if [ -n "$PYENV_VIRTUALENV_VERBOSE_ACTIVATE" ]; then
|
||||
echo "pyenv-virtualenv: activate ${venv}" 1>&2
|
||||
fi
|
||||
|
||||
if [ -z "$no_shell" ]; then
|
||||
# shell version set in pyenv-sh-activate should be unset
|
||||
|
||||
@@ -58,7 +58,9 @@ else
|
||||
venv="${prefix##*/}"
|
||||
fi
|
||||
|
||||
echo "pyenv-virtualenv: deactivate ${venv}" 1>&2
|
||||
if [ -n "$PYENV_VIRTUALENV_VERBOSE_ACTIVATE" ]; then
|
||||
echo "pyenv-virtualenv: deactivate ${venv}" 1>&2
|
||||
fi
|
||||
|
||||
if [ -n "${PYENV_ACTIVATE_SHELL}" ]; then
|
||||
# shell version set in pyenv-sh-activate should be unset
|
||||
|
||||
@@ -11,6 +11,7 @@ setup() {
|
||||
unset CONDA_DEFAULT_ENV
|
||||
unset PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
unset PYENV_VIRTUALENV_VERBOSE_ACTIVATE
|
||||
unset PYENV_VIRTUALENV_DISABLE_PROMPT
|
||||
unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT
|
||||
unset VIRTUAL_ENV_DISABLE_PROMPT
|
||||
@@ -30,7 +31,6 @@ setup() {
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
@@ -46,6 +46,7 @@ EOS
|
||||
|
||||
@test "activate virtualenv from current version (verbose)" {
|
||||
export PYENV_VIRTUALENV_INIT=1
|
||||
export PYENV_VIRTUALENV_VERBOSE_ACTIVATE=1
|
||||
|
||||
stub pyenv-version-name "echo venv"
|
||||
stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\""
|
||||
@@ -84,7 +85,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv
|
||||
export PYENV_VERSION="venv";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
|
||||
@@ -113,7 +113,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv
|
||||
setenv PYENV_VIRTUAL_ENV "${PYENV_ROOT}/versions/venv";
|
||||
setenv VIRTUAL_ENV "${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing not working for fish.
|
||||
@@ -138,7 +137,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv
|
||||
setenv PYENV_VERSION "venv";
|
||||
setenv PYENV_ACTIVATE_SHELL 1;
|
||||
setenv PYENV_VIRTUAL_ENV "${PYENV_ROOT}/versions/venv";
|
||||
@@ -164,7 +162,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv27
|
||||
export PYENV_VERSION="venv27";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
|
||||
@@ -191,7 +188,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv27
|
||||
export PYENV_VERSION="venv27";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
|
||||
@@ -218,7 +214,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv27
|
||||
setenv PYENV_VERSION "venv27";
|
||||
setenv PYENV_ACTIVATE_SHELL 1;
|
||||
setenv PYENV_VIRTUAL_ENV "${PYENV_ROOT}/versions/venv27";
|
||||
@@ -243,7 +238,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv27
|
||||
setenv PYENV_VERSION "venv27";
|
||||
setenv PYENV_ACTIVATE_SHELL 1;
|
||||
setenv PYENV_VIRTUAL_ENV "${PYENV_ROOT}/versions/venv27";
|
||||
@@ -367,7 +361,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate venv27
|
||||
export PYENV_VERSION="venv27:2.7.10";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
|
||||
|
||||
@@ -12,6 +12,7 @@ setup() {
|
||||
unset CONDA_DEFAULT_ENV
|
||||
unset PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
unset PYENV_VIRTUALENV_VERBOSE_ACTIVATE
|
||||
unset PYENV_VIRTUALENV_DISABLE_PROMPT
|
||||
unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT
|
||||
unset VIRTUAL_ENV_DISABLE_PROMPT
|
||||
@@ -32,7 +33,6 @@ setup() {
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate anaconda-2.3.0
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0";
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0";
|
||||
export CONDA_DEFAULT_ENV="root";
|
||||
@@ -62,7 +62,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate anaconda-2.3.0
|
||||
setenv PYENV_VIRTUAL_ENV "${TMP}/pyenv/versions/anaconda-2.3.0";
|
||||
setenv VIRTUAL_ENV "${TMP}/pyenv/versions/anaconda-2.3.0";
|
||||
setenv CONDA_DEFAULT_ENV "root";
|
||||
@@ -90,7 +89,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate miniconda-3.9.1
|
||||
export PYENV_VERSION="miniconda-3.9.1";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1";
|
||||
@@ -122,7 +120,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate anaconda-2.3.0/envs/foo
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo";
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo";
|
||||
export CONDA_DEFAULT_ENV="foo";
|
||||
@@ -152,7 +149,6 @@ EOS
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
deactivated
|
||||
pyenv-virtualenv: activate miniconda-3.9.1/envs/bar
|
||||
export PYENV_VERSION="miniconda-3.9.1/envs/bar";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1/envs/bar";
|
||||
|
||||
@@ -11,6 +11,7 @@ setup() {
|
||||
unset CONDA_DEFAULT_ENV
|
||||
unset PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
unset PYENV_VIRTUALENV_VERBOSE_ACTIVATE
|
||||
unset PYENV_VIRTUALENV_DISABLE_PROMPT
|
||||
unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT
|
||||
unset VIRTUAL_ENV_DISABLE_PROMPT
|
||||
@@ -29,7 +30,6 @@ setup() {
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate anaconda-2.3.0
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
unset VIRTUAL_ENV;
|
||||
unset CONDA_DEFAULT_ENV;
|
||||
@@ -65,7 +65,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate anaconda-2.3.0
|
||||
set -e PYENV_VIRTUAL_ENV;
|
||||
set -e VIRTUAL_ENV;
|
||||
set -e CONDA_DEFAULT_ENV;
|
||||
@@ -97,7 +96,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate anaconda-2.3.0/envs/foo
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
unset VIRTUAL_ENV;
|
||||
unset CONDA_DEFAULT_ENV;
|
||||
|
||||
@@ -11,6 +11,7 @@ setup() {
|
||||
unset CONDA_DEFAULT_ENV
|
||||
unset PYTHONHOME
|
||||
unset _OLD_VIRTUAL_PYTHONHOME
|
||||
unset PYENV_VIRTUALENV_VERBOSE_ACTIVATE
|
||||
unset PYENV_VIRTUALENV_DISABLE_PROMPT
|
||||
unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT
|
||||
unset VIRTUAL_ENV_DISABLE_PROMPT
|
||||
@@ -27,7 +28,6 @@ setup() {
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
unset VIRTUAL_ENV;
|
||||
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
|
||||
@@ -53,6 +53,7 @@ EOS
|
||||
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"
|
||||
export PYENV_ACTIVATE_SHELL=
|
||||
export PYENV_VIRTUALENV_VERBOSE_ACTIVATE=1
|
||||
|
||||
PYENV_SHELL="bash" run pyenv-sh-deactivate --verbose
|
||||
|
||||
@@ -89,7 +90,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
unset VIRTUAL_ENV;
|
||||
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
|
||||
@@ -120,7 +120,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
unset PYENV_VERSION;
|
||||
unset PYENV_ACTIVATE_SHELL;
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
@@ -153,7 +152,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
unset PYENV_VERSION;
|
||||
unset PYENV_ACTIVATE_SHELL;
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
@@ -186,7 +184,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
unset VIRTUAL_ENV;
|
||||
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
|
||||
@@ -217,7 +214,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
set -e PYENV_VIRTUAL_ENV;
|
||||
set -e VIRTUAL_ENV;
|
||||
if [ -n "\$_OLD_VIRTUAL_PATH" ];
|
||||
@@ -244,7 +240,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
set -e PYENV_VIRTUAL_ENV;
|
||||
set -e VIRTUAL_ENV;
|
||||
if [ -n "\$_OLD_VIRTUAL_PATH" ];
|
||||
@@ -271,7 +266,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
set -e PYENV_VERSION;
|
||||
set -e PYENV_ACTIVATE_SHELL;
|
||||
set -e PYENV_VIRTUAL_ENV;
|
||||
@@ -300,7 +294,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
set -e PYENV_VERSION;
|
||||
set -e PYENV_ACTIVATE_SHELL;
|
||||
set -e PYENV_VIRTUAL_ENV;
|
||||
@@ -329,7 +322,6 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv-virtualenv: deactivate venv
|
||||
set -e PYENV_VIRTUAL_ENV;
|
||||
set -e VIRTUAL_ENV;
|
||||
if [ -n "\$_OLD_VIRTUAL_PATH" ];
|
||||
|
||||
Reference in New Issue
Block a user