Merge branch 'pyenv:master' into master

This commit is contained in:
binbjz 2024-07-05 19:28:02 +08:00 committed by GitHub
commit b11728c284
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 190 additions and 34 deletions

View file

@ -15,7 +15,7 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
runs-on: macos-11
runs-on: macos-14
steps:
- uses: actions/checkout@v4
# Normally, we would use the superbly maintained...

View file

@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
python-version: ${{fromJson(needs.discover_modified_scripts.outputs.versions)}}
os: ["macos-11", "macos-12"]
os: ["macos-13", "macos-14"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

View file

@ -12,8 +12,8 @@ jobs:
os:
- ubuntu-22.04
- ubuntu-20.04
- macos-12
- macos-11
- macos-14
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

View file

@ -1,5 +1,17 @@
# Version History
## Release v2.4.6
* CI: push MacOS jobs to MacOS 13 and 14 by @native-api in https://github.com/pyenv/pyenv/pull/3002
* Add 3.13.0b3t and exclude it from `pyenv latest` by @colesbury in https://github.com/pyenv/pyenv/pull/3001
* Speed up `pyenv prefix` by not constructing advice text when it would be discarded by @Erotemic in https://github.com/pyenv/pyenv/pull/3005
## Release v2.4.5
* Add CPython 3.13.0b3 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/2996
## Release v2.4.4
* Add support for miniconda3 24.5.0-0 with py3.12, py3.11, py3.10, py3.9 by @binbjz in https://github.com/pyenv/pyenv/pull/2994
* Add support for free-threaded Python by @colesbury in https://github.com/pyenv/pyenv/pull/2995
## Release v2.4.3
* Add miniconda3 24.4.0-0 by @binbjz in https://github.com/pyenv/pyenv/pull/2982

View file

@ -12,7 +12,7 @@
set -e
[ -n "$PYENV_DEBUG" ] && set -x
version="2.4.3"
version="2.4.6"
git_revision=""
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then

View file

@ -50,7 +50,7 @@ IFS=$'\n'
DEFINITION_CANDIDATES=(\
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d'));
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d' -e '/[0-9]+t$/d'));
# Compose a sorting key, followed by | and original value
DEFINITION_CANDIDATES=(\

View file

@ -30,9 +30,9 @@ OLDIFS="$IFS"
{ IFS=:
for version in ${PYENV_VERSION}; do
if [ "$version" = "system" ]; then
if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python 2>/dev/null)" || \
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python3 2>/dev/null)" || \
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python2 2>/dev/null)"; then
if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python --skip-advice 2>/dev/null)" || \
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python3 --skip-advice 2>/dev/null)" || \
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python2 --skip-advice 2>/dev/null)"; then
shopt -s extglob
# In some distros (Arch), Python can be found in sbin as well as bin
PYENV_PREFIX_PATH="${PYTHON_PATH%/?(s)bin/*}"

View file

@ -128,9 +128,9 @@ print_version() {
# Include "system" in the non-bare output, if it exists
if [ -n "$include_system" ] && \
(PYENV_VERSION=system pyenv-which python >/dev/null 2>&1 || \
PYENV_VERSION=system pyenv-which python3 >/dev/null 2>&1 || \
PYENV_VERSION=system pyenv-which python2 >/dev/null 2>&1) ; then
(PYENV_VERSION=system pyenv-which python --skip-advice >/dev/null 2>&1 || \
PYENV_VERSION=system pyenv-which python3 --skip-advice >/dev/null 2>&1 || \
PYENV_VERSION=system pyenv-which python2 --skip-advice >/dev/null 2>&1) ; then
print_version system "/"
fi

View file

@ -2,13 +2,14 @@
#
# Summary: Display the full path to an executable
#
# Usage: pyenv which <command> [--nosystem]
# Usage: pyenv which <command> [--nosystem] [--skip-advice]
#
# Displays the full path to the executable that pyenv will invoke when
# you run the given command.
# Use --nosystem argument in case when you don't need to search command in the
# system environment.
#
# Internal switch --skip-advice used to skip printing an error message on a
# failed search.
set -e
[ -n "$PYENV_DEBUG" ] && set -x
@ -18,11 +19,27 @@ if [ "$1" = "--complete" ]; then
exec pyenv-shims --short
fi
if [ "$2" = "--nosystem" ]; then
system="system"
SKIP_ADVICE=""
PYENV_COMMAND="$1"
while [[ $# -gt 0 ]]
do
case "$1" in
--skip-advice)
SKIP_ADVICE=1
shift
;;
--nosystem)
system=""
else
system="system"
fi
shift
;;
*)
shift
;;
esac
done
remove_from_path() {
local path_to_remove="$1"
@ -36,8 +53,6 @@ remove_from_path() {
echo "${result#:}"
}
PYENV_COMMAND="$1"
if [ -z "$PYENV_COMMAND" ]; then
pyenv-help --usage which >&2
exit 1
@ -85,17 +100,18 @@ else
fi
echo "pyenv: $PYENV_COMMAND: command not found" >&2
if [ -z "$SKIP_ADVICE" ]; then
versions="$(pyenv-whence "$PYENV_COMMAND" || true)"
if [ -n "$versions" ]; then
{ echo
echo "The \`$1' command exists in these Python versions:"
echo "The \`$PYENV_COMMAND' command exists in these Python versions:"
echo "$versions" | sed 's/^/ /g'
echo
echo "Note: See 'pyenv help global' for tips on allowing both"
echo " python2 and python3 to be found."
} >&2
fi
fi
exit 127
fi

View file

@ -822,6 +822,7 @@ build_package_standard_build() {
use_homebrew_zlib || true
fi
use_dsymutil || true
use_free_threading || true
fi
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
@ -1761,6 +1762,12 @@ use_dsymutil() {
fi
}
use_free_threading() {
if [[ -n "$PYTHON_BUILD_FREE_THREADING" ]]; then
package_option python configure --disable-gil
fi
}
build_package_enable_shared() {
package_option python configure --enable-shared
}

View file

@ -3,7 +3,7 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.3.1" "https://www.openssl.org/source/openssl-3.3.1.tar.gz#777cd596284c883375a2a7a11bf5d2786fc5413255efab20c50d6ffe6d020b7e" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.13.0b2" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0b2.tar.xz#bf11be01b42a07a3659e4e233591e03da631b7112aa61ee1e030eeb8c5dfd869" standard verify_py313 copy_python_gdb ensurepip
install_package "Python-3.13.0b3" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0b3.tar.xz#3be094ad08b11dc2a065463524239c78dc9f2b342b01dcd4e1e606dbbc5c78a5" standard verify_py313 copy_python_gdb ensurepip
else
install_package "Python-3.13.0b2" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0b2.tgz#c87c42aa8137230a15a02ed90a6600610ba680cb5b54c0fbc57581a0d032e0c4" standard verify_py313 copy_python_gdb ensurepip
install_package "Python-3.13.0b3" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0b3.tgz#5e9c01cdb3e2fb1f5732a55e9522cb6a011693e795ec347b3f69ff5e217175e4" standard verify_py313 copy_python_gdb ensurepip
fi

View file

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.0b3

View file

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.13-dev

View file

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.14-dev

View file

@ -0,0 +1,25 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-aarch64" )
install_script "Miniconda3-py310_24.5.0-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.5.0-0-Linux-aarch64.sh#edcf076c80846beded0b72e98811cf7b93d0abc2ae93c060efc76f8da1e6fc45" "miniconda" verify_py310
;;
"Linux-s390x" )
install_script "Miniconda3-py310_24.5.0-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.5.0-0-Linux-s390x.sh#e00f3d03d13fc4fa394a5d20a5476087237ee6cb029eba3b02322acc104b530b" "miniconda" verify_py310
;;
"Linux-x86_64" )
install_script "Miniconda3-py310_24.5.0-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.5.0-0-Linux-x86_64.sh#b3d73db6a05069fbdf20dc33fc9b6a29fa7198578f0d090c639f5ca0e84102bd" "miniconda" verify_py310
;;
"MacOSX-arm64" )
install_script "Miniconda3-py310_24.5.0-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.5.0-0-MacOSX-arm64.sh#e422602aa19140c600b5889e5b41a0d7187640107ea82fcb5da857dd25330148" "miniconda" verify_py310
;;
"MacOSX-x86_64" )
install_script "Miniconda3-py310_24.5.0-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.5.0-0-MacOSX-x86_64.sh#6d7c1cc138adfc4bb2ccbb8a22eb8e9eb13a366b6af0d63245b643e6c3a3c708" "miniconda" verify_py310
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
echo
} >&2
exit 1
;;
esac

View file

@ -0,0 +1,25 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-aarch64" )
install_script "Miniconda3-py311_24.5.0-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.5.0-0-Linux-aarch64.sh#94a742af7bf5c7bae3dba6bd07d84d94b858b839e15af2ea0cd10fdf2bde8a73" "miniconda" verify_py311
;;
"Linux-s390x" )
install_script "Miniconda3-py311_24.5.0-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.5.0-0-Linux-s390x.sh#002963f32aebe1091d5da9a82416831f3c11217e6b4ea164c655f0d11f0cff80" "miniconda" verify_py311
;;
"Linux-x86_64" )
install_script "Miniconda3-py311_24.5.0-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.5.0-0-Linux-x86_64.sh#38b203bb1f2be78b735ebc00162f29e8e73fcd9a619ed5980490a72193ee1f58" "miniconda" verify_py311
;;
"MacOSX-arm64" )
install_script "Miniconda3-py311_24.5.0-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.5.0-0-MacOSX-arm64.sh#a3d62f20f09e8079db76379090f21b7ae34832dadeb5a250e4fab324c8328727" "miniconda" verify_py311
;;
"MacOSX-x86_64" )
install_script "Miniconda3-py311_24.5.0-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.5.0-0-MacOSX-x86_64.sh#9e7dc7e0fbf0e9b2ff6bafdae9bf6ef122ae92d53533c2bbeb73433c0c6a4bd9" "miniconda" verify_py311
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
echo
} >&2
exit 1
;;
esac

View file

@ -0,0 +1,25 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-aarch64" )
install_script "Miniconda3-py312_24.5.0-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.5.0-0-Linux-aarch64.sh#70afe954cc8ee91f605f9aa48985bfe01ecfc10751339e8245eac7262b01298d" "miniconda" verify_py312
;;
"Linux-s390x" )
install_script "Miniconda3-py312_24.5.0-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.5.0-0-Linux-s390x.sh#bd2a0a8ea34c84c860868d5b8efde07afc51cdede76b64dd94e9c3fd2d65257e" "miniconda" verify_py312
;;
"Linux-x86_64" )
install_script "Miniconda3-py312_24.5.0-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.5.0-0-Linux-x86_64.sh#4b3b3b1b99215e85fd73fb2c2d7ebf318ac942a457072de62d885056556eb83e" "miniconda" verify_py312
;;
"MacOSX-arm64" )
install_script "Miniconda3-py312_24.5.0-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.5.0-0-MacOSX-arm64.sh#12e678b8156aea69a132568b6176a019c7a1ba753ddf5caedf086d3c5460fe92" "miniconda" verify_py312
;;
"MacOSX-x86_64" )
install_script "Miniconda3-py312_24.5.0-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.5.0-0-MacOSX-x86_64.sh#b1c87c8334ea878d30a9976c1860b1004e6d55bdec5228089fec40be81156363" "miniconda" verify_py312
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
echo
} >&2
exit 1
;;
esac

View file

@ -0,0 +1,25 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-aarch64" )
install_script "Miniconda3-py39_24.5.0-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.5.0-0-Linux-aarch64.sh#b716e3bc556e9ab7a4f206b04b53bd57c24e94956598d89fc78863b115cce9e8" "miniconda" verify_py39
;;
"Linux-s390x" )
install_script "Miniconda3-py39_24.5.0-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.5.0-0-Linux-s390x.sh#c2d6bec964a96130eb5f1c4ea46993cf10f7957d45ac31d9aa94c34b5ebfed32" "miniconda" verify_py39
;;
"Linux-x86_64" )
install_script "Miniconda3-py39_24.5.0-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.5.0-0-Linux-x86_64.sh#07a2435123fd8f41e6528baa5f272ce754fd8acaef08ce7081afb00227b8754a" "miniconda" verify_py39
;;
"MacOSX-arm64" )
install_script "Miniconda3-py39_24.5.0-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.5.0-0-MacOSX-arm64.sh#f5f63a0de44b7b0872f3c00dca71b896933ccc844a93bf120aad6df66b6475b3" "miniconda" verify_py39
;;
"MacOSX-x86_64" )
install_script "Miniconda3-py39_24.5.0-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.5.0-0-MacOSX-x86_64.sh#b65d7f01820bdfe1abb6b4dd84d48e6c62a6d72ee0cc400a4e8bb4ea89ff1c84" "miniconda" verify_py39
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
echo
} >&2
exit 1
;;
esac

View file

@ -10,7 +10,7 @@ pyenv_install_resolve_latest() {
$(python-build --definitions | \
grep -F "${DEFINITION_PREFIX}" | \
grep "^${DEFINITION_TYPE}" | \
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/(b|rc)[0-9]+$/d' | \
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/(b|rc)[0-9]+$/d' -e '/[0-9]+t$/d' | \
sort -t. -k1,1r -k 2,2nr -k 3,3nr \
|| true))
DEFINITION="${DEFINITION_CANDIDATES}"

View file

@ -103,6 +103,9 @@ echo 3.8.5-latest
echo 3.8.5a2
echo 3.8.5b3
echo 3.8.5rc2
echo 3.8.5t
echo 3.8.5b3t
echo 3.8.5rc2t
echo 3.8.1
echo 3.8.1/envs/foo
!

View file

@ -155,3 +155,15 @@ exit
PYENV_VERSION=3.4 run pyenv-which python
assert_success "version=3.4.2"
}
@test "skip advice supresses error messages" {
create_executable "2.7" "python"
create_executable "3.3" "py.test"
create_executable "3.4" "py.test"
PYENV_VERSION=2.7 run pyenv-which py.test --skip-advice
assert_failure
assert_output <<OUT
pyenv: py.test: command not found
OUT
}