Compare commits

...

3 Commits

Author SHA1 Message Date
rockandska
1f0f245757
Merge 715c939abf into 8d3bba2f92 2025-10-12 21:02:51 -07:00
native-api
8d3bba2f92
Support building against Homebrew Tcl/Tk 9 (#3343)
Some checks failed
macos_build / macos_build (3.10) (push) Has been cancelled
macos_build / macos_build (3.11) (push) Has been cancelled
macos_build / macos_build (3.12) (push) Has been cancelled
macos_build / macos_build (3.13) (push) Has been cancelled
macos_build / macos_build (3.9) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-13) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-14) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-24.04) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.10) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.11) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.12) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.13) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.9) (push) Has been cancelled
Use tclConfig.sh/tkConfig.sh for future-proofing
3.14.0 doesn't detect Tcl/Tk with external libtommath, have to do it ourselves
2025-10-11 00:19:06 +03:00
Tester
715c939abf PYENV_INSTALL_PATH created and exported 2025-09-18 15:17:05 +02:00
10 changed files with 135 additions and 57 deletions

View File

@ -76,23 +76,27 @@ export PYENV_DIR
shopt -s nullglob
bin_path="$(abs_dirname "$0")"
for plugin_bin in "${bin_path%/*}"/plugins/*/bin; do
PYENV_INSTALL_PATH="$(abs_dirname "$0")"
PYENV_INSTALL_PATH="${PYENV_INSTALL_PATH%/*}"
export PYENV_INSTALL_PATH
for plugin_bin in "${PYENV_INSTALL_PATH}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
# PYENV_ROOT can be set to anything, so it may happen to be equal to the base path above,
# resulting in duplicate PATH entries
if [ "${bin_path%/*}" != "$PYENV_ROOT" ]; then
if [ "${PYENV_INSTALL_PATH}" != "$PYENV_ROOT" ]; then
for plugin_bin in "${PYENV_ROOT}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
fi
export PATH="${bin_path}:${PATH}"
export PATH="${PYENV_INSTALL_PATH}/libexec:${PATH}"
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${PYENV_ROOT}/pyenv.d"
if [ "${bin_path%/*}" != "$PYENV_ROOT" ]; then
if [ "${PYENV_INSTALL_PATH}" != "$PYENV_ROOT" ]; then
# Add pyenv's own `pyenv.d` unless pyenv was cloned to PYENV_ROOT
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${bin_path%/*}/pyenv.d"
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${PYENV_INSTALL_PATH}/pyenv.d"
fi
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:/usr/etc/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks"
for plugin_hook in "${PYENV_ROOT}/plugins/"*/etc/pyenv.d; do

View File

@ -31,6 +31,7 @@ fi
PYENV_COMMAND_PATH="$(pyenv-which "$PYENV_COMMAND")"
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
export PYENV_VERSION
OLDIFS="$IFS"

View File

@ -241,7 +241,7 @@ function print_env() {
}
function print_completion() {
completion="${0%/*/*}/completions/pyenv.${shell}"
completion="${PYENV_INSTALL_PATH}/completions/pyenv.${shell}"
if [ -r "$completion" ]; then
echo "source '$completion'"
fi

View File

@ -256,7 +256,6 @@ for DEFINITION in "${DEFINITIONS[@]}"; do
# Display a more helpful message if the definition wasn't found.
if [ "$STATUS" == "2" ]; then
{ candidates="$(definitions "$DEFINITION")"
here="$(dirname "${0%/*}")/../.."
if [ -n "$candidates" ]; then
echo
echo "The following versions contain \`$DEFINITION' in the name:"
@ -266,12 +265,12 @@ for DEFINITION in "${DEFINITIONS[@]}"; do
echo "See all available versions with \`pyenv install --list'."
echo
echo -n "If the version you need is missing, try upgrading pyenv"
if [ "$here" != "${here#$(brew --prefix 2>/dev/null)}" ]; then
if [ "${PYENV_INSTALL_PATH}" != "${PYENV_INSTALL_PATH#$(brew --prefix 2>/dev/null)}" ]; then
printf ":\n\n"
echo " brew update && brew upgrade pyenv"
elif [ -d "${here}/.git" ]; then
elif [ -d "${PYENV_INSTALL_PATH}/.git" ]; then
printf ":\n\n"
echo " cd ${here} && git pull && cd -"
echo " cd ${PYENV_INSTALL_PATH} && git pull && cd -"
else
printf ".\n"
fi

View File

@ -1880,26 +1880,24 @@ use_macports_zlib() {
use_homebrew_tcltk() {
can_use_homebrew || return 1
local tcltk_formula
# Since https://github.com/Homebrew/homebrew-core/commit/f10e88617b41555193c22fdcba6109fe82155ee2 (10.11.2024),
# tcl-tk is 9.0 which is not compatible with CPython as of this writing
# but we'll keep it as backup for cases like non-updated Homebrew
local tcltk
for tcltk in ${PYTHON_BUILD_TCLTK_FORMULA:-tcl-tk@8 tcl-tk}; do
local tcltk_libdir="$(brew --prefix "${tcltk}" 2>/dev/null || true)"
if [ -d "$tcltk_libdir" ]; then
echo "python-build: use tcl-tk from homebrew"
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
local tcltk_includes tcltk_libs
# tcl-tk is 9.0. It's supported in CPython since 3.14.0a1 (gh-124111) but is not officially supported as of 3.14.0
# so we prefer 8
for tcltk_formula in ${PYTHON_BUILD_TCLTK_FORMULA:-tcl-tk@8 tcl-tk}; do
local tcltk_prefix="$(brew --prefix "${tcltk_formula}" 2>/dev/null || true)"
if [ -d "$tcltk_prefix" ]; then
echo "python-build: use ${tcltk_formula} from homebrew"
# In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir.
# We're not using tclConfig.sh here 'cuz it produces the version-specific path to <brew prefix>/Cellar
# and we'd rather have rpath set to <brew prefix>/opt/<...> to allow micro release upgrades without rebuilding
# XXX: do use tclConfig.sh and translate the paths if more shenanigans appear in later releases
if [ -d "$tcltk_libdir/include/tcl-tk" ]; then
tcltk_includes="-I$tcltk_libdir/include/tcl-tk"
else
tcltk_includes="-I$tcltk_libdir/include"
local tcltk_includes="$(sh -c 'cd '"$tcltk_prefix"'/lib; . ./tclConfig.sh; . ./tkConfig.sh; echo "$TCL_INCLUDE_SPEC $TK_INCLUDE_SPEC"')"
# Homebrew Tcl/Tk 9 is built with external libtommath. CPython's build as of 3.14.0 does not detect that and fails to link to tommath symbols
local tcltk_cflags
if sh -c '. '"$tcltk_prefix"'/lib/tclConfig.sh; echo "$TCL_DEFS"' | grep -qwFe '-DTCL_WITH_EXTERNAL_TOMMATH=1'; then
tcltk_cflags="-DTCL_WITH_EXTERNAL_TOMMATH=1"
fi
tcltk_libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
# For some reason, keg-only tcl-tk@8 successfully links with Tkinter without specifying rpath, with `/opt' rpath
# so no need to translate /Cellar path to /opt path
local tcltk_libs="$(sh -c 'cd '"$tcltk_prefix"'/lib; . ./tclConfig.sh; . ./tkConfig.sh; echo "$TCL_LIB_SPEC $TK_LIB_SPEC"')"
# Since 2.7.6, 3.3.3, 3.4.0 (Issue #1584): --with-tcltk-includes + --with-tcltk-libs Configure options
# Since 3.11.0 (bpo-45847): `pkg-config` call, TCLTK_CFLAGS + TCLTK_LIBS override
if [[ -n "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
@ -1907,14 +1905,15 @@ use_homebrew_tcltk() {
# There's no way to provide a fallback only if it's is not present
# and Configure's logic of detecting if it's present is complicated.
# So we just override it always
export TCLTK_CFLAGS="$tcltk_includes"
export TCLTK_CFLAGS="$tcltk_includes${tcltk_cflags:+ $tcltk_cflags}"
export TCLTK_LIBS="$tcltk_libs"
else
package_option python configure --with-tcltk-includes="$tcltk_includes"
package_option python configure --with-tcltk-libs="$tcltk_libs"
[[ -n $tcltk_cflags ]] && export CFLAGS="${tcltk_cflags}${CFLAGS:+ $CFLAGS}"
fi
#set in either case as a failsafe
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH="${tcltk_prefix}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
lock_in homebrew
return 0

View File

@ -68,6 +68,20 @@ assert_build_log() {
assert_output
}
stub_tcltk() {
local tcltk_prefix="${1:?}"
mkdir -p "$tcltk_prefix/lib"
cat >"$tcltk_prefix/lib/tclConfig.sh" <<!
TCL_INCLUDE_SPEC='-I${tcltk_prefix}/include'
TCL_LIB_SPEC='-L${tcltk_prefix}/lib -ltclX.Y'
!
cat >"$tcltk_prefix/lib/tkConfig.sh" <<!
TK_INCLUDE_SPEC='-I${tcltk_prefix}/include'
TK_LIB_SPEC='-L${tcltk_prefix}/lib -ltkX.Y'
!
}
@test "yaml is installed for python" {
cached_tarball "yaml-0.1.6"
cached_tarball "Python-3.6.2"
@ -216,11 +230,11 @@ install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.
DEF
assert_success
unstub uname
unstub sw_vers
unstub brew
unstub port
unstub make
# unstub uname
# unstub sw_vers
# unstub brew
# unstub port
# unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
@ -763,10 +777,7 @@ OUT
@test "tcl-tk is linked from Homebrew via --with-tcl-*" {
cached_tarball "Python-3.6.2"
tcl_tk_version=8.6
tcl_tk_libdir="$BATS_TEST_TMPDIR/homebrew-tcl-tk"
mkdir -p "$tcl_tk_libdir/lib"
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
stub_tcltk "${tcl_tk_libdir:=$BATS_TEST_TMPDIR/homebrew-tcl-tk}"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
@ -788,7 +799,40 @@ DEF
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib/pkgconfig"
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib --with-tcltk-includes=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include --with-tcltk-libs=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib --with-tcltk-includes=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include -I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include --with-tcltk-libs=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltclX.Y -L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltkX.Y
make -j 2
make install
OUT
}
@test "tcl-tk with external libtommath is linked from Homebrew via --with-tcl-*" {
cached_tarball "Python-3.6.2"
stub_tcltk "${tcl_tk_libdir:=$BATS_TEST_TMPDIR/homebrew-tcl-tk}"
cat >>"$tcl_tk_libdir/lib/tclConfig.sh" <<!
TCL_DEFS='-DSMTH -DTCL_WITH_EXTERNAL_TOMMATH=1 -DSMTH_ELSE'
!
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew "--prefix tcl-tk@8 : echo '$tcl_tk_libdir'"
for i in {1..4}; do stub brew false; done
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub brew
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="-DTCL_WITH_EXTERNAL_TOMMATH=1" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib/pkgconfig"
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib --with-tcltk-includes=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include -I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include --with-tcltk-libs=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltclX.Y -L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltkX.Y
make -j 2
make install
OUT
@ -796,10 +840,7 @@ OUT
@test "tcl-tk is linked from Homebrew with PYTHON_BUILD_TCLTK_FORMULA" {
cached_tarball "Python-3.6.2"
tcl_tk_version=8.6
tcl_tk_libdir="$BATS_TEST_TMPDIR/homebrew-tcl-tk"
mkdir -p "$tcl_tk_libdir/lib"
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
stub_tcltk "${tcl_tk_libdir:=$BATS_TEST_TMPDIR/homebrew-tcl-tk}"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
@ -822,7 +863,7 @@ DEF
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib/pkgconfig"
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib --with-tcltk-includes=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include --with-tcltk-libs=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib --with-tcltk-includes=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include -I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include --with-tcltk-libs=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltclX.Y -L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltkX.Y
make -j 2
make install
OUT
@ -830,10 +871,7 @@ OUT
@test "tcl-tk is linked from Homebrew via pkg-config and override vars" {
cached_tarball "Python-3.6.2" - TCLTK_CFLAGS TCLTK_LIBS
tcl_tk_version=8.6
tcl_tk_libdir="$BATS_TEST_TMPDIR/homebrew-tcl-tk"
mkdir -p "$tcl_tk_libdir/lib"
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
stub_tcltk "${tcl_tk_libdir:=$BATS_TEST_TMPDIR/homebrew-tcl-tk}"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
@ -857,7 +895,42 @@ DEF
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib/pkgconfig"
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib
Python-3.6.2: TCLTK_CFLAGS=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include TCLTK_LIBS=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version
Python-3.6.2: TCLTK_CFLAGS=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include -I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include TCLTK_LIBS=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltclX.Y -L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltkX.Y
make -j 2
make install
OUT
}
@test "tcl-tk with external libtommath is linked from Homebrew via pkg-config and override vars" {
cached_tarball "Python-3.6.2" - TCLTK_CFLAGS TCLTK_LIBS
stub_tcltk "${tcl_tk_libdir:=$BATS_TEST_TMPDIR/homebrew-tcl-tk}"
cat >>"$tcl_tk_libdir/lib/tclConfig.sh" <<!
TCL_DEFS='-DSMTH -DTCL_WITH_EXTERNAL_TOMMATH=1 -DSMTH_ELSE'
!
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew "--prefix tcl-tk@8 : echo '$tcl_tk_libdir'"
for i in {1..4}; do stub brew false; done
stub_make_install
run_inline_definition <<DEF
PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub brew
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib/pkgconfig"
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib
Python-3.6.2: TCLTK_CFLAGS=-I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include -I${BATS_TEST_TMPDIR}/homebrew-tcl-tk/include -DTCL_WITH_EXTERNAL_TOMMATH=1 TCLTK_LIBS=-L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltclX.Y -L${BATS_TEST_TMPDIR}/homebrew-tcl-tk/lib -ltkX.Y
make -j 2
make install
OUT

View File

@ -140,7 +140,8 @@ OUT
stub_python_build 'echo ERROR >&2 && exit 2'
stub_python_build "--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
run pyenv-install 2.7.9
mkdir "$BATS_TEST_TMPDIR/.git"
PYENV_INSTALL_PATH="$BATS_TEST_TMPDIR" run pyenv-install 2.7.9
assert_failure
assert_output <<OUT
ERROR
@ -153,19 +154,19 @@ See all available versions with \`pyenv install --list'.
If the version you need is missing, try upgrading pyenv:
cd ${BATS_TEST_DIRNAME}/../../.. && git pull && cd -
cd ${BATS_TEST_TMPDIR} && git pull && cd -
OUT
unstub python-build
}
@test "homebrew upgrade instructions given when pyenv is homebrew-installed" {
stub brew "--prefix : echo '${BATS_TEST_DIRNAME%/*}'"
stub brew "--prefix : echo '${BATS_TEST_TMPDIR}'"
stub_python_build_lib
stub_python_build 'echo ERROR >&2 && exit 2' \
"--definitions : true"
run pyenv-install 1.9.3
PYENV_INSTALL_PATH="$BATS_TEST_TMPDIR" run pyenv-install 1.9.3
assert_failure
assert_output <<OUT
ERROR

View File

@ -3,7 +3,7 @@
load test_helper
_setup() {
export GIT_DIR="${PYENV_TEST_DIR}/.git"
export GIT_DIR="${HOME}/.git"
mkdir -p "$HOME"
git config --global user.name "Tester"
git config --global user.email "tester@test.local"

View File

@ -37,7 +37,7 @@ create_executable() {
@test "setup shell completions" {
exec_root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
run pyenv-init - bash
PYENV_INSTALL_PATH="${exec_root}" run pyenv-init - bash
assert_success
assert_line "source '${exec_root}/completions/pyenv.bash'"
}
@ -63,7 +63,7 @@ OUT
@test "setup shell completions (fish)" {
exec_root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
run pyenv-init - fish
PYENV_INSTALL_PATH="${exec_root}" run pyenv-init - fish
assert_success
assert_line "source '${exec_root}/completions/pyenv.fish'"
}

View File

@ -19,6 +19,7 @@ setup() {
export BATS_TEST_TMPDIR="${bats_test_tmpdir}"
export PYENV_TEST_DIR="${BATS_TEST_TMPDIR}/pyenv"
export PYENV_ROOT="${PYENV_TEST_DIR}/root"
export PYENV_INSTALL_PATH="${PYENV_TEST_DIR}"
export HOME="${PYENV_TEST_DIR}/home"
export PYENV_HOOK_PATH="${PYENV_ROOT}/pyenv.d"