mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-08 11:33:55 -05:00
Link python*-config into VE (#460)
Required to build binaries that link against Python. Carl Meyer, the champion for PEP 0405, has confirmed that there isn't a particular reason why `venv` doesn't do that.
This commit is contained in:
@@ -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}"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user