6 Commits

Author SHA1 Message Date
Yamashita, Yuu
51ebc8ff8a v20160112 2016-01-12 01:53:27 +00:00
Yamashita, Yuu
4c8eeebbff Add missing declaration of virtualenv_prefix to fix looking up executables from source version (#62) 2016-01-12 00:33:34 +00:00
Yamashita, Yuu
433992e376 Merge pull request #138 from kerstin/autoactivate
Clarification of auto-activation/deactivation feature
2016-01-03 07:44:19 +09:00
Kerstin Kollmann
efe6d6757c clarify how auto-activation works (requirements) 2016-01-02 16:31:37 +01:00
Yamashita, Yuu
5963688fc4 v20151229 2015-12-29 09:13:51 +00:00
Yamashita, Yuu
13b7dc172a need to use functions -q to check existence of the function in fish (#136) 2015-12-29 09:03:31 +00:00
7 changed files with 23 additions and 12 deletions

View File

@@ -1,5 +1,13 @@
## Version History
#### 20160112
* Fix problem with `virtualenv` to look up executables from source version with `--system-site-packages` (#62)
#### 20151229
* Fix `deactivate` error on `fish` (#136)
#### 20151222
* Improved interoperability with Anaconda/Miniconda (#103, #106, #107, #108)

View File

@@ -34,7 +34,7 @@ From inside that directory you can:
$ git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
```
2. (OPTIONAL) **Add `pyenv virtualenv-init` to your shell** to enable auto-activation of virtualenv. This is entirely optional but pretty useful.
2. (OPTIONAL) **Add `pyenv virtualenv-init` to your shell** to enable auto-activation of virtualenvs. This is entirely optional but pretty useful. See "Activate virtualenv" below.
```sh
$ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
@@ -125,8 +125,7 @@ $ pyenv virtualenvs
Some external tools (e.g. [jedi](https://github.com/davidhalter/jedi)) might
require you to `activate` the virtualenv and `conda` environments.
`pyenv-virtualenv` will automatically activate/deactivate the virtualenv if
the `eval "$(pyenv virtualenv-init -)"` is properly configured in your shell.
If `eval "$(pyenv virtualenv-init -)"` is configured in your shell, `pyenv-virtualenv` will automatically activate/deactivate virtualenvs on entering/leaving directories which contain a `.python-version` file that lists a valid virtual environment. `.python-version` files denote local Python versions and can be created and deleted with the [`pyenv local`](https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-local) command.
You can also activate and deactivate a pyenv virtualenv manually:

View File

@@ -162,7 +162,7 @@ esac
case "${shell}" in
fish )
cat <<EOS
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS

View File

@@ -9,7 +9,7 @@
# -f/--force Install even if the version appears to be installed already
#
PYENV_VIRTUALENV_VERSION="20151222"
PYENV_VIRTUALENV_VERSION="20160112"
set -e
[ -n "$PYENV_DEBUG" ] && set -x

View File

@@ -37,8 +37,12 @@ if [ ! -x "${PYENV_COMMAND_PATH}" ]; then
if [ ! -f "${no_global_site_packages}" ]; then
include_system_site_packages=1
fi
virtualenv_orig_prefix="$(find "${virtualenv_libpath}/" -maxdepth 2 -type f -and -name "orig-prefix.txt" 2>/dev/null | head -1)"
if [ -f "${virtualenv_orig_prefix}" ]; then
virtualenv_prefix="$(cat "${virtualenv_orig_prefix}" 2>/dev/null || true)"
fi
fi
if [ -n "${include_system_site_packages}" ]; then
if [ -n "${include_system_site_packages}" ] && [ -n "${virtualenv_prefix}" ]; then
# virtualenv is created with `--system-site-packages`
virtualenv_command_path="${virtualenv_prefix}/bin/${PYENV_COMMAND_PATH##*/}"
if [ -x "${virtualenv_command_path}" ]; then

View File

@@ -77,7 +77,7 @@ if [ -n "\$_OLD_VIRTUAL_PYTHONHOME" ];
setenv PYTHONHOME "\$_OLD_VIRTUAL_PYTHONHOME";
set -e _OLD_VIRTUAL_PYTHONHOME;
end;
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS

View File

@@ -228,7 +228,7 @@ if [ -n "\$_OLD_VIRTUAL_PYTHONHOME" ];
setenv PYTHONHOME "\$_OLD_VIRTUAL_PYTHONHOME";
set -e _OLD_VIRTUAL_PYTHONHOME;
end;
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS
@@ -255,7 +255,7 @@ if [ -n "\$_OLD_VIRTUAL_PYTHONHOME" ];
setenv PYTHONHOME "\$_OLD_VIRTUAL_PYTHONHOME";
set -e _OLD_VIRTUAL_PYTHONHOME;
end;
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS
@@ -284,7 +284,7 @@ if [ -n "\$_OLD_VIRTUAL_PYTHONHOME" ];
setenv PYTHONHOME "\$_OLD_VIRTUAL_PYTHONHOME";
set -e _OLD_VIRTUAL_PYTHONHOME;
end;
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS
@@ -313,7 +313,7 @@ if [ -n "\$_OLD_VIRTUAL_PYTHONHOME" ];
setenv PYTHONHOME "\$_OLD_VIRTUAL_PYTHONHOME";
set -e _OLD_VIRTUAL_PYTHONHOME;
end;
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS
@@ -340,7 +340,7 @@ if [ -n "\$_OLD_VIRTUAL_PYTHONHOME" ];
setenv PYTHONHOME "\$_OLD_VIRTUAL_PYTHONHOME";
set -e _OLD_VIRTUAL_PYTHONHOME;
end;
if functions -g deactivate;
if functions -q deactivate;
functions -e deactivate;
end;
EOS