Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Link python*-config into VE #460

Merged
merged 4 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bin/pyenv-virtualenv
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,15 @@ else
fi
fi

(
shopt -s nullglob
for extra_binary in "$PREFIX"/bin/python*-config; do
extra_binary_linkname="$VIRTUALENV_PATH/bin/$(basename $extra_binary)"
[[ -e "$extra_binary_linkname" ]] || \
ln -s "$extra_binary" "$extra_binary_linkname"
done
)

## Create symlink in the `versions` directory for backward compatibility
if [ -d "${VIRTUALENV_PATH}" ] && [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then
ln -fs "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}"
Expand Down
9 changes: 7 additions & 2 deletions test/virtualenv.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ unstub_pyenv() {
stub pyenv-exec "python2.7 -m venv --help : false"
stub pyenv-exec "python2 -m venv --help : false"
stub pyenv-exec "python -m venv --help : false"
stub pyenv-exec "virtualenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\""
stub pyenv-exec "virtualenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"; mkdir -p \"\$2/bin\""
stub pyenv-exec "python -s -m ensurepip : false"
stub pyenv-exec "python -s */get-pip.py : true"
stub curl true
create_executable "${PYENV_VERSION}" "python-config"
create_executable "${PYENV_VERSION}" "python2-config"
create_executable "${PYENV_VERSION}" "python2.7-config"

run pyenv-virtualenv "2.7.11" "venv"

Expand All @@ -41,8 +44,10 @@ PYENV_VERSION=2.7.11 virtualenv ${PYENV_ROOT}/versions/2.7.11/envs/venv
Installing pip from https://bootstrap.pypa.io/pip/2.7/get-pip.py...
rehashed
OUT
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/venv/bin/pydoc" ]
assert_success
for x in pydoc python-config python2-config python2.7-config; do
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/venv/bin/$x" ]
done

unstub_pyenv
unstub pyenv-virtualenv-prefix
Expand Down