From e83a1f12c23e845c6779c5d84ee6f3baf84aca4e Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 22 Aug 2017 23:00:05 +0000 Subject: [PATCH 1/3] Generate `pydoc` executable after creating new virtualenv (fixes #197, pyenv/pyenv#963) --- bin/pyenv-virtualenv | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index cf802297..4edd97b0 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -533,6 +533,16 @@ if [ -d "${VIRTUALENV_PATH}" ] && [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then ln -fs "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}" fi +if [ ! -e "${VIRTUALENV_PATH}/bin/pydoc" ]; then + cat < "${VIRTUALENV_PATH}/bin/pydoc" +#!${VIRTUALENV_PATH}/bin/python +import pydoc +if __name__ == '__main__': + pydoc.cli() +EOS + chmod +x "${VIRTUALENV_PATH}/bin/pydoc" +fi + if [ -z "${NO_ENSUREPIP}" ]; then ## Install setuptools and pip. PYENV_VERSION="${VIRTUALENV_NAME}" build_package_ensurepip From e339fde2f382270769f60145bef6034f648560de Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 22 Aug 2017 23:04:39 +0000 Subject: [PATCH 2/3] Create virtualenv's bin directory explicitly to avoid CI failures --- bin/pyenv-virtualenv | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index 4edd97b0..286c60ae 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -534,6 +534,7 @@ if [ -d "${VIRTUALENV_PATH}" ] && [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then fi if [ ! -e "${VIRTUALENV_PATH}/bin/pydoc" ]; then + mkdir -p "${VIRTUALENV_PATH}/bin" cat < "${VIRTUALENV_PATH}/bin/pydoc" #!${VIRTUALENV_PATH}/bin/python import pydoc From 927914b25f6691e2dbf8ca31f088102c23841639 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Wed, 23 Aug 2017 11:14:42 +0000 Subject: [PATCH 3/3] Make sure pydoc executable exists after creating virtualenv --- test/pyvenv.bats | 16 +++++++++++----- test/virtualenv.bats | 11 ++++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/test/pyvenv.bats b/test/pyvenv.bats index d5637cd8..01eb676e 100644 --- a/test/pyvenv.bats +++ b/test/pyvenv.bats @@ -32,11 +32,12 @@ unstub_pyenv() { run pyenv-virtualenv venv - assert_success assert_output <