mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Support virtualenvs with names starting with "python-" (#3086)
Some checks are pending
macos_build / macos_build (3.10) (push) Waiting to run
macos_build / macos_build (3.11) (push) Waiting to run
macos_build / macos_build (3.12) (push) Waiting to run
macos_build / macos_build (3.8) (push) Waiting to run
macos_build / macos_build (3.9) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-13) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-14) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-20.04) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Waiting to run
ubuntu_build / ubuntu_build (3.10) (push) Waiting to run
ubuntu_build / ubuntu_build (3.11) (push) Waiting to run
ubuntu_build / ubuntu_build (3.12) (push) Waiting to run
ubuntu_build / ubuntu_build (3.8) (push) Waiting to run
ubuntu_build / ubuntu_build (3.9) (push) Waiting to run
Some checks are pending
macos_build / macos_build (3.10) (push) Waiting to run
macos_build / macos_build (3.11) (push) Waiting to run
macos_build / macos_build (3.12) (push) Waiting to run
macos_build / macos_build (3.8) (push) Waiting to run
macos_build / macos_build (3.9) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-13) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-14) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-20.04) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Waiting to run
ubuntu_build / ubuntu_build (3.10) (push) Waiting to run
ubuntu_build / ubuntu_build (3.11) (push) Waiting to run
ubuntu_build / ubuntu_build (3.12) (push) Waiting to run
ubuntu_build / ubuntu_build (3.8) (push) Waiting to run
ubuntu_build / ubuntu_build (3.9) (push) Waiting to run
This commit is contained in:
@@ -32,8 +32,12 @@ OLDIFS="$IFS"
|
|||||||
for version in ${PYENV_VERSION}; do
|
for version in ${PYENV_VERSION}; do
|
||||||
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
||||||
normalised_version="${version#python-}"
|
normalised_version="${version#python-}"
|
||||||
if version_exists "${normalised_version}" || [ "$version" = "system" ]; then
|
if version_exists "${version}" || [ "$version" = "system" ]; then
|
||||||
|
versions=("${versions[@]}" "${version}")
|
||||||
|
elif version_exists "${normalised_version}"; then
|
||||||
versions=("${versions[@]}" "${normalised_version}")
|
versions=("${versions[@]}" "${normalised_version}")
|
||||||
|
elif resolved_version="$(pyenv-latest -b "${version}")"; then
|
||||||
|
versions=("${versions[@]}" "${resolved_version}")
|
||||||
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
||||||
versions=("${versions[@]}" "${resolved_version}")
|
versions=("${versions[@]}" "${resolved_version}")
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -127,3 +127,10 @@ OUT
|
|||||||
assert_success
|
assert_success
|
||||||
assert_output "3.12.6"
|
assert_output "3.12.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "pyenv version started by python-" {
|
||||||
|
create_version "python-3.12.6"
|
||||||
|
PYENV_VERSION="python-3.12.6" run pyenv-version-name
|
||||||
|
assert_success
|
||||||
|
assert_output "python-3.12.6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user