mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-09 03:53:48 -05:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74f923b5fc | ||
|
|
59c560893a | ||
|
|
4971d9e35e | ||
|
|
6d13db992f | ||
|
|
13d8568620 | ||
|
|
cc56f76733 | ||
|
|
4c261e6ea1 | ||
|
|
31355676f0 | ||
|
|
c162dcd932 | ||
|
|
0b6320d371 | ||
|
|
3bfaa33c1b | ||
|
|
cd2858aa17 | ||
|
|
19359de7b8 | ||
|
|
8dd46e3915 | ||
|
|
ed1083ec27 | ||
|
|
904fe964b0 | ||
|
|
036fd63bbd | ||
|
|
1250d7dd30 | ||
|
|
ad6a950734 |
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Editor configuration, see https://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
|
||||||
|
# Makefiles always use tabs for indentation
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = unset # Allow user-defined tab width
|
||||||
5
.github/workflows/macos_build.yml
vendored
5
.github/workflows/macos_build.yml
vendored
@@ -1,5 +1,9 @@
|
|||||||
name: macos_build
|
name: macos_build
|
||||||
on: [pull_request, push]
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
macos_build:
|
macos_build:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -10,6 +14,7 @@ jobs:
|
|||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
runs-on: macos-11
|
runs-on: macos-11
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
4
.github/workflows/no-response.yml
vendored
4
.github/workflows/no-response.yml
vendored
@@ -9,8 +9,12 @@ on:
|
|||||||
# Schedule for ten minutes after the hour, every hour
|
# Schedule for ten minutes after the hour, every hour
|
||||||
- cron: '10 * * * *'
|
- cron: '10 * * * *'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
jobs:
|
jobs:
|
||||||
noResponse:
|
noResponse:
|
||||||
|
permissions:
|
||||||
|
issues: write # to update issues (lee-dohm/no-response)
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: lee-dohm/no-response@v0.5.0
|
- uses: lee-dohm/no-response@v0.5.0
|
||||||
|
|||||||
4
.github/workflows/pyenv_tests.yml
vendored
4
.github/workflows/pyenv_tests.yml
vendored
@@ -1,5 +1,9 @@
|
|||||||
name: pyenv_tests
|
name: pyenv_tests
|
||||||
on: [pull_request, push]
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pyenv_tests:
|
pyenv_tests:
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
5
.github/workflows/ubuntu_build.yml
vendored
5
.github/workflows/ubuntu_build.yml
vendored
@@ -1,5 +1,9 @@
|
|||||||
name: ubuntu_build
|
name: ubuntu_build
|
||||||
on: [pull_request, push]
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu_build:
|
ubuntu_build:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -10,6 +14,7 @@ jobs:
|
|||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,3 +8,5 @@
|
|||||||
/src/*.o
|
/src/*.o
|
||||||
/bats/
|
/bats/
|
||||||
/default-packages
|
/default-packages
|
||||||
|
.idea
|
||||||
|
*.un~
|
||||||
|
|||||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,5 +1,21 @@
|
|||||||
## Version History
|
## Version History
|
||||||
|
|
||||||
|
## Release 2.3.7
|
||||||
|
|
||||||
|
* Add Python version 3.11 to the macOS build by @jbkkd in https://github.com/pyenv/pyenv/pull/2510
|
||||||
|
* Don't use Zlib from XCode SDK if a custom compiler is used by @native-api in https://github.com/pyenv/pyenv/pull/2516
|
||||||
|
* Change line endings from CRLF to LF by @hoang-himself in https://github.com/pyenv/pyenv/pull/2517
|
||||||
|
* Fix resolution of a name that's a prefix of another name by @native-api in https://github.com/pyenv/pyenv/pull/2521
|
||||||
|
* GitHub Workflows security hardening by @sashashura in https://github.com/pyenv/pyenv/pull/2511
|
||||||
|
* Add nushell to activate list by @theref in https://github.com/pyenv/pyenv/pull/2524
|
||||||
|
* Fix compilation error when building OpenSSL 1.1.1q in MacOS 11+ for 3.9.15 and 3.8.15 by @twangboy in https://github.com/pyenv/pyenv/pull/2520
|
||||||
|
* Add simple `.editorconfig` file by @aphedges in https://github.com/pyenv/pyenv/pull/2518
|
||||||
|
* Support `aria2c` being a snap by @native-api in https://github.com/pyenv/pyenv/pull/2528
|
||||||
|
* Add CPython 3.12.0a2 by @saaketp in https://github.com/pyenv/pyenv/pull/2527
|
||||||
|
* Add --no-push-path option by @isaacl in https://github.com/pyenv/pyenv/pull/2526
|
||||||
|
* Fix typo in README.md by @weensy in https://github.com/pyenv/pyenv/pull/2535
|
||||||
|
* Copy auto installer oneliner to readme by @spookyuser in https://github.com/pyenv/pyenv/pull/2538
|
||||||
|
|
||||||
## Release 2.3.6
|
## Release 2.3.6
|
||||||
|
|
||||||
* Add CPython 3.10.8 (#2480)
|
* Add CPython 3.10.8 (#2480)
|
||||||
|
|||||||
@@ -386,11 +386,12 @@ List existing pyenv shims.
|
|||||||
|
|
||||||
Configure the shell environment for pyenv
|
Configure the shell environment for pyenv
|
||||||
|
|
||||||
Usage: eval "$(pyenv init [-|--path] [--no-rehash] [<shell>])"
|
Usage: eval "$(pyenv init [-|--path] [--no-push-path] [--no-rehash] [<shell>])"
|
||||||
|
|
||||||
- Initialize shims directory, print PYENV_SHELL variable, completions path
|
- Initialize shims directory, print PYENV_SHELL variable, completions path
|
||||||
and shell function
|
and shell function
|
||||||
--path Print shims path
|
--path Print shims path
|
||||||
|
--no-push-path Do not push shim to the start of PATH if they're already there
|
||||||
--no-rehash Add no rehash command to output
|
--no-rehash Add no rehash command to output
|
||||||
|
|
||||||
## `pyenv completions`
|
## `pyenv completions`
|
||||||
|
|||||||
26
README.md
26
README.md
@@ -247,7 +247,9 @@ which does install native Windows Python versions.
|
|||||||
|
|
||||||
#### Automatic installer
|
#### Automatic installer
|
||||||
|
|
||||||
Visit our other project:
|
`curl https://pyenv.run | bash`
|
||||||
|
|
||||||
|
For more details visit our other project:
|
||||||
https://github.com/pyenv/pyenv-installer
|
https://github.com/pyenv/pyenv-installer
|
||||||
|
|
||||||
|
|
||||||
@@ -258,14 +260,14 @@ easy to fork and contribute any changes back upstream.
|
|||||||
|
|
||||||
* **Check out Pyenv where you want it installed.**
|
* **Check out Pyenv where you want it installed.**
|
||||||
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else):
|
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else):
|
||||||
|
```
|
||||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||||
|
```
|
||||||
* Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
* Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
||||||
worry if it fails; Pyenv will still work normally:
|
worry if it fails; Pyenv will still work normally:
|
||||||
|
```
|
||||||
cd ~/.pyenv && src/configure && make -C src
|
cd ~/.pyenv && src/configure && make -C src
|
||||||
|
```
|
||||||
|
|
||||||
### Set up your shell environment for Pyenv
|
### Set up your shell environment for Pyenv
|
||||||
|
|
||||||
@@ -404,21 +406,21 @@ please visit the wiki page about
|
|||||||
|
|
||||||
#### Prefix auto-resolution
|
#### Prefix auto-resolution
|
||||||
|
|
||||||
Pyenv automatically resolves full prefixes to the latest version in the corresponding version line.
|
All Pyenv subcommands except `uninstall` automatically resolve full prefixes to the latest version in the corresponding version line.
|
||||||
E.g. to install the latest 3.10 release:
|
|
||||||
|
`pyenv install` picks the latest known version while other subcommands -- the latest installed version.
|
||||||
|
|
||||||
|
E.g. to install and then switch to the latest 3.10 release:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pyenv install 3.10
|
pyenv install 3.10
|
||||||
|
pyenv global 3.10
|
||||||
```
|
```
|
||||||
|
|
||||||
The same happens whenever Pyenv selects a version to use.
|
|
||||||
Installation selects the latest version known to Pyenv
|
|
||||||
while switching -- the latest installed version.
|
|
||||||
|
|
||||||
You can run [`pyenv latest <prefix>`](COMMANDS.md#pyenv-latest) to see
|
You can run [`pyenv latest <prefix>`](COMMANDS.md#pyenv-latest) to see
|
||||||
what a specific prefix would be resolved to.
|
what a specific prefix would be resolved to.
|
||||||
|
|
||||||
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details on the resolution process.
|
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details.
|
||||||
|
|
||||||
|
|
||||||
#### Python versions with extended support
|
#### Python versions with extended support
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
version="2.3.6"
|
version="2.3.7"
|
||||||
git_revision=""
|
git_revision=""
|
||||||
|
|
||||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Summary: Configure the shell environment for pyenv
|
# Summary: Configure the shell environment for pyenv
|
||||||
# Usage: eval "$(pyenv init [-|--path] [--no-rehash] [<shell>])"
|
# Usage: eval "$(pyenv init [-|--path] [--no-push-path] [--no-rehash] [<shell>])"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
@@ -9,6 +9,7 @@ set -e
|
|||||||
if [ "$1" = "--complete" ]; then
|
if [ "$1" = "--complete" ]; then
|
||||||
echo -
|
echo -
|
||||||
echo --path
|
echo --path
|
||||||
|
echo --no-push-path
|
||||||
echo --no-rehash
|
echo --no-rehash
|
||||||
echo bash
|
echo bash
|
||||||
echo fish
|
echo fish
|
||||||
@@ -19,6 +20,7 @@ fi
|
|||||||
|
|
||||||
mode="help"
|
mode="help"
|
||||||
no_rehash=""
|
no_rehash=""
|
||||||
|
no_push_path=""
|
||||||
for args in "$@"
|
for args in "$@"
|
||||||
do
|
do
|
||||||
if [ "$args" = "-" ]; then
|
if [ "$args" = "-" ]; then
|
||||||
@@ -31,6 +33,11 @@ do
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$args" = "--no-push-path" ]; then
|
||||||
|
no_push_path=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$args" = "--no-rehash" ]; then
|
if [ "$args" = "--no-rehash" ]; then
|
||||||
no_rehash=1
|
no_rehash=1
|
||||||
shift
|
shift
|
||||||
@@ -141,11 +148,27 @@ function init_dirs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function print_path() {
|
function print_path() {
|
||||||
|
# if no_push_path is set, guard the PATH manipulation with a check on whether
|
||||||
|
# the shim is already in the PATH.
|
||||||
|
if [ -n "$no_push_path" ]; then
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
echo 'while set index (contains -i -- '\'"${PYENV_ROOT}/shims"\'' $PATH)'
|
echo 'if not contains -- "'"${PYENV_ROOT}/shims"'" $PATH'
|
||||||
echo 'set -eg PATH[$index]; end; set -e index'
|
print_path_prepend_shims
|
||||||
echo 'set -gx PATH '\'"${PYENV_ROOT}/shims"\'' $PATH'
|
echo 'end'
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
echo 'if [[ ":$PATH:" != *'\':"${PYENV_ROOT}"/shims:\''* ]]; then'
|
||||||
|
print_path_prepend_shims
|
||||||
|
echo 'fi'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
case "$shell" in
|
||||||
|
fish )
|
||||||
|
echo 'while set pyenv_index (contains -i -- "'"${PYENV_ROOT}/shims"'" $PATH)'
|
||||||
|
echo 'set -eg PATH[$pyenv_index]; end; set -e pyenv_index'
|
||||||
|
print_path_prepend_shims
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
# Some distros (notably Debian-based) set Bash's SSH_SOURCE_BASHRC compilation option
|
# Some distros (notably Debian-based) set Bash's SSH_SOURCE_BASHRC compilation option
|
||||||
@@ -160,6 +183,18 @@ function print_path() {
|
|||||||
echo 'if [[ ${paths[i]} == "'\'\'"${PYENV_ROOT}/shims"\'\''" ]]; then unset '\'\\\'\''paths[i]'\'\\\'\''; '
|
echo 'if [[ ${paths[i]} == "'\'\'"${PYENV_ROOT}/shims"\'\''" ]]; then unset '\'\\\'\''paths[i]'\'\\\'\''; '
|
||||||
echo 'fi; done; '
|
echo 'fi; done; '
|
||||||
echo 'echo "${paths[*]}"'\'')"'
|
echo 'echo "${paths[*]}"'\'')"'
|
||||||
|
print_path_prepend_shims
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function print_path_prepend_shims() {
|
||||||
|
case "$shell" in
|
||||||
|
fish )
|
||||||
|
echo 'set -gx PATH '\'"${PYENV_ROOT}/shims"\'' $PATH'
|
||||||
|
;;
|
||||||
|
* )
|
||||||
echo 'export PATH="'"${PYENV_ROOT}"'/shims:${PATH}"'
|
echo 'export PATH="'"${PYENV_ROOT}"'/shims:${PATH}"'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ IFS=$'\n'
|
|||||||
else
|
else
|
||||||
DEFINITION_CANDIDATES=( $(python-build --definitions ) )
|
DEFINITION_CANDIDATES=( $(python-build --definitions ) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | grep -qxFe "$prefix"; then
|
||||||
|
echo "$prefix"
|
||||||
|
exit $exitcode;
|
||||||
|
fi
|
||||||
|
|
||||||
# https://stackoverflow.com/questions/11856054/is-there-an-easy-way-to-pass-a-raw-string-to-grep/63483807#63483807
|
# https://stackoverflow.com/questions/11856054/is-there-an-easy-way-to-pass-a-raw-string-to-grep/63483807#63483807
|
||||||
prefix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$prefix")"
|
prefix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$prefix")"
|
||||||
# FIXME: more reliable and readable would probably be to loop over them and transform in pure Bash
|
# FIXME: more reliable and readable would probably be to loop over them and transform in pure Bash
|
||||||
|
|||||||
@@ -360,12 +360,38 @@ http_head_aria2c() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
http_get_aria2c() {
|
http_get_aria2c() {
|
||||||
local out="${2:-$(mktemp "out.XXXXXX")}"
|
# aria2c always treats -o argument as a relative path
|
||||||
if aria2c --allow-overwrite=true --no-conf=true -o "${out}" ${ARIA2_OPTS} "$1" >&4; then
|
local out dir_out;
|
||||||
|
if [[ -n "$2" ]]; then
|
||||||
|
out="$(basename $2)";
|
||||||
|
dir_out="$(dirname $2)";
|
||||||
|
else
|
||||||
|
out="$(mktemp "out.XXXXXX")";
|
||||||
|
dir_out="$TMPDIR";
|
||||||
|
fi
|
||||||
|
|
||||||
|
# In Ubuntu, aria2c is only available as a snap. Snaps cannot read or write /tmp
|
||||||
|
# (files cannot be found, any write result is silently discarded).
|
||||||
|
local aria2c_is_snap;
|
||||||
|
if [[ $(command -v aria2c) == "/snap/"* ]]; then aria2c_is_snap=1; fi
|
||||||
|
|
||||||
|
if [[ -n $aria2c_is_snap ]]; then
|
||||||
|
local real_dir_out="$dir_out"
|
||||||
|
# presumably, snaps can always write to under $HOME
|
||||||
|
dir_out="$HOME"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if aria2c --allow-overwrite=true --no-conf=true -d "${dir_out}" -o "${out}" ${ARIA2_OPTS} "$1" >&4; then
|
||||||
[ -n "$2" ] || cat "${out}"
|
[ -n "$2" ] || cat "${out}"
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
ret=$?
|
||||||
|
|
||||||
|
if [[ -n "$2" && -n $aria2c_is_snap ]]; then
|
||||||
|
mv "$dir_out/$out" "$real_dir_out/$out"
|
||||||
|
fi
|
||||||
|
return "$ret"
|
||||||
}
|
}
|
||||||
|
|
||||||
http_head_curl() {
|
http_head_curl() {
|
||||||
@@ -1564,6 +1590,8 @@ use_homebrew_zlib() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
use_xcode_sdk_zlib() {
|
use_xcode_sdk_zlib() {
|
||||||
|
# If a custom compiler is used, including XCode SDK will likely break it
|
||||||
|
[[ "${CC:-clang}" != "clang" || "$(command -v clang 2>/dev/null || true)" != "/usr/bin/clang" ]] && return 1
|
||||||
local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)"
|
local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)"
|
||||||
if [ -d "$xc_sdk_path" ]; then
|
if [ -d "$xc_sdk_path" ]; then
|
||||||
echo "python-build: use zlib from xcode sdk"
|
echo "python-build: use zlib from xcode sdk"
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
prefer_openssl11
|
|
||||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
|
||||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" 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.12.0a1" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a1.tar.xz#7be2bd9b1fc9f64b334660581bb645f0eae0b344c80130f1eb22983a1c292f43" standard verify_py312 copy_python_gdb ensurepip
|
|
||||||
else
|
|
||||||
install_package "Python-3.12.0a1" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a1.tgz#db4dd2315715e11250175f5dc06fa9d32d4a9fed4db7b6774d4be72d7b94b7e3" standard verify_py312 copy_python_gdb ensurepip
|
|
||||||
fi
|
|
||||||
9
plugins/python-build/share/python-build/3.12.0a2
Normal file
9
plugins/python-build/share/python-build/3.12.0a2
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1s" "https://www.openssl.org/source/openssl-1.1.1s.tar.gz#c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" 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.12.0a2" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a2.tar.xz#1eafc1384e532cac6432632a77350ef504a114c4235c1f6f2a85f817f5b1926a" standard verify_py312 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.12.0a2" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a2.tgz#81fa3468cada25f5ac8868230a847999495464f8ab67df1df3e8e8e280df0b2b" standard verify_py312 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||||
|
index 7a240cd706..6cec6f1a9b 100644
|
||||||
|
--- a/test/v3ext.c
|
||||||
|
+++ b/test/v3ext.c
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include "internal/nelem.h"
|
||||||
|
|
||||||
|
+#include <string.h>
|
||||||
|
#include "testutil.h"
|
||||||
|
|
||||||
|
static const char *infile;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||||
|
index 7a240cd706..6cec6f1a9b 100644
|
||||||
|
--- a/test/v3ext.c
|
||||||
|
+++ b/test/v3ext.c
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include "internal/nelem.h"
|
||||||
|
|
||||||
|
+#include <string.h>
|
||||||
|
#include "testutil.h"
|
||||||
|
|
||||||
|
static const char *infile;
|
||||||
@@ -21,7 +21,7 @@ setup() {
|
|||||||
@test "using aria2c if available" {
|
@test "using aria2c if available" {
|
||||||
export PYTHON_BUILD_ARIA2_OPTS=
|
export PYTHON_BUILD_ARIA2_OPTS=
|
||||||
export -n PYTHON_BUILD_HTTP_CLIENT
|
export -n PYTHON_BUILD_HTTP_CLIENT
|
||||||
stub aria2c "--allow-overwrite=true --no-conf=true -o * http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$4"
|
stub aria2c "--allow-overwrite=true --no-conf=true -d * -o * http://example.com/* : cp $FIXTURE_ROOT/\${7##*/} \$6"
|
||||||
|
|
||||||
install_fixture definitions/without-checksum
|
install_fixture definitions/without-checksum
|
||||||
assert_success
|
assert_success
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
activate
|
activate
|
||||||
activate.csh
|
activate.csh
|
||||||
activate.fish
|
activate.fish
|
||||||
|
activate.nu
|
||||||
# gettext (#688)
|
# gettext (#688)
|
||||||
gettext.sh
|
gettext.sh
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ echo "\$PATH"
|
|||||||
command -v fish >/dev/null || skip "-- fish not installed"
|
command -v fish >/dev/null || skip "-- fish not installed"
|
||||||
OLDPATH="$PATH"
|
OLDPATH="$PATH"
|
||||||
export PATH="${BATS_TEST_DIRNAME}/nonexistent:${PYENV_ROOT}/shims:$PATH"
|
export PATH="${BATS_TEST_DIRNAME}/nonexistent:${PYENV_ROOT}/shims:$PATH"
|
||||||
# fish 2 (Ubuntu Bionic) adds spurious messages when setting PATH, messing up the output
|
|
||||||
run fish <<!
|
run fish <<!
|
||||||
set -x PATH "$PATH"
|
set -x PATH "$PATH"
|
||||||
pyenv init - | source
|
pyenv init - | source
|
||||||
@@ -108,6 +107,50 @@ echo "\$PATH"
|
|||||||
assert_output "${PYENV_ROOT}/shims:${BATS_TEST_DIRNAME}/nonexistent:${OLDPATH//${PYENV_ROOT}\/shims:/}"
|
assert_output "${PYENV_ROOT}/shims:${BATS_TEST_DIRNAME}/nonexistent:${OLDPATH//${PYENV_ROOT}\/shims:/}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "adds shims to PATH with --no-push-path if they're not on PATH" {
|
||||||
|
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
|
||||||
|
run bash -e <<!
|
||||||
|
eval "\$(pyenv-init - --no-push-path)"
|
||||||
|
echo "\$PATH"
|
||||||
|
!
|
||||||
|
assert_success
|
||||||
|
assert_output "${PYENV_ROOT}/shims:${PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "adds shims to PATH with --no-push-path if they're not on PATH (fish)" {
|
||||||
|
command -v fish >/dev/null || skip "-- fish not installed"
|
||||||
|
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
|
||||||
|
run fish <<!
|
||||||
|
set -x PATH "$PATH"
|
||||||
|
pyenv-init - --no-push-path| source
|
||||||
|
echo "\$PATH"
|
||||||
|
!
|
||||||
|
assert_success
|
||||||
|
assert_output "${PYENV_ROOT}/shims:${PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "doesn't change PATH with --no-push-path if shims are already on PATH" {
|
||||||
|
export PATH="${BATS_TEST_DIRNAME}/../libexec:${PYENV_ROOT}/shims:/usr/bin:/bin:/usr/local/bin"
|
||||||
|
run bash -e <<!
|
||||||
|
eval "\$(pyenv-init - --no-push-path)"
|
||||||
|
echo "\$PATH"
|
||||||
|
!
|
||||||
|
assert_success
|
||||||
|
assert_output "${PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "doesn't change PATH with --no-push-path if shims are already on PATH (fish)" {
|
||||||
|
command -v fish >/dev/null || skip "-- fish not installed"
|
||||||
|
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:${PYENV_ROOT}/shims:/bin:/usr/local/bin"
|
||||||
|
run fish <<!
|
||||||
|
set -x PATH "$PATH"
|
||||||
|
pyenv-init - --no-push-path| source
|
||||||
|
echo "\$PATH"
|
||||||
|
!
|
||||||
|
assert_success
|
||||||
|
assert_output "${PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
@test "outputs sh-compatible syntax" {
|
@test "outputs sh-compatible syntax" {
|
||||||
run pyenv-init - bash
|
run pyenv-init - bash
|
||||||
assert_success
|
assert_success
|
||||||
|
|||||||
@@ -64,6 +64,21 @@ pyenv: no known versions match the prefix \`3.8'
|
|||||||
!
|
!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "complete name resolves to itself" {
|
||||||
|
create_executable pyenv-versions <<!
|
||||||
|
#!$BASH
|
||||||
|
echo foo
|
||||||
|
echo foo.bar
|
||||||
|
!
|
||||||
|
|
||||||
|
run pyenv-latest foo
|
||||||
|
assert_success
|
||||||
|
assert_output <<!
|
||||||
|
foo
|
||||||
|
!
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@test "sort CPython" {
|
@test "sort CPython" {
|
||||||
create_executable pyenv-versions <<!
|
create_executable pyenv-versions <<!
|
||||||
#!$BASH
|
#!$BASH
|
||||||
|
|||||||
Reference in New Issue
Block a user