mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-11 04:53:53 -05:00
Should not try to find system-site-packages if virtualenv is a conda's environment (#104)
This commit is contained in:
@@ -5,27 +5,31 @@
|
|||||||
|
|
||||||
if [ ! -x "${PYENV_COMMAND_PATH}" ]; then
|
if [ ! -x "${PYENV_COMMAND_PATH}" ]; then
|
||||||
virtualenv_prefix="$(pyenv-virtualenv-prefix 2>/dev/null || true)"
|
virtualenv_prefix="$(pyenv-virtualenv-prefix 2>/dev/null || true)"
|
||||||
if [ -d "${virtualenv_prefix}" ]; then
|
if [ -d "$(pyenv-prefix)" ] && [ -d "${virtualenv_prefix}" ]; then
|
||||||
unset include_system_site_packages
|
unset include_system_site_packages
|
||||||
if [ -f "$(pyenv-prefix)/pyvenv.cfg" ]; then
|
if [ -f "$(pyenv-prefix)/bin/conda" ]; then
|
||||||
# pyvenv
|
: # do nothing for conda's environments
|
||||||
if grep -q -i "include-system-site-packages *= *true" "$(pyenv-prefix)/pyvenv.cfg" 1>/dev/null 2>&1; then
|
|
||||||
include_system_site_packages=1
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# virtualenv
|
if [ -f "$(pyenv-prefix)/pyvenv.cfg" ]; then
|
||||||
shopt -s nullglob
|
# pyvenv
|
||||||
no_global_site_packages="$(echo "$(pyenv-prefix)/lib/"*"/no-global-site-packages.txt")"
|
if grep -q -i "include-system-site-packages *= *true" "$(pyenv-prefix)/pyvenv.cfg" 1>/dev/null 2>&1; then
|
||||||
shopt -u nullglob
|
include_system_site_packages=1
|
||||||
if [ ! -f "${no_global_site_packages}" ]; then
|
fi
|
||||||
include_system_site_packages=1
|
else
|
||||||
|
# virtualenv
|
||||||
|
shopt -s nullglob
|
||||||
|
no_global_site_packages="$(echo "$(pyenv-prefix)/lib/"*"/no-global-site-packages.txt")"
|
||||||
|
shopt -u nullglob
|
||||||
|
if [ ! -f "${no_global_site_packages}" ]; then
|
||||||
|
include_system_site_packages=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
if [ -n "${include_system_site_packages}" ]; then
|
||||||
if [ -n "${include_system_site_packages}" ]; then
|
# virtualenv is created with `--system-site-packages`
|
||||||
# virtualenv is created with `--system-site-packages`
|
virtualenv_command_path="${virtualenv_prefix}/bin/${PYENV_COMMAND_PATH##*/}"
|
||||||
virtualenv_command_path="${virtualenv_prefix}/bin/${PYENV_COMMAND_PATH##*/}"
|
if [ -x "${virtualenv_command_path}" ]; then
|
||||||
if [ -x "${virtualenv_command_path}" ]; then
|
PYENV_COMMAND_PATH="${virtualenv_command_path}"
|
||||||
PYENV_COMMAND_PATH="${virtualenv_command_path}"
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user