mirror of
https://github.com/pyenv/pyenv.git
synced 2026-04-06 21:55:11 +09:00
Compare commits
No commits in common. "master" and "v2.6.26" have entirely different histories.
2
.github/workflows/add_version.yml
vendored
2
.github/workflows/add_version.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
||||
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
|
||||
- name: Generate Github token
|
||||
if: env.rc == 0
|
||||
uses: actions/create-github-app-token@v3
|
||||
uses: actions/create-github-app-token@v2
|
||||
id: generate-token
|
||||
with:
|
||||
app-id: ${{ vars.PYENV_BOT_APP_ID }}
|
||||
|
||||
17
COMMANDS.md
17
COMMANDS.md
@ -40,8 +40,9 @@ Lists all available pyenv commands.
|
||||
|
||||
Sets a local application-specific Python version by writing the version
|
||||
name to a `.python-version` file in the current directory. This version
|
||||
overrides the [global version](#pyenv-global), and can be overridden
|
||||
itself with the [`pyenv shell`](#pyenv-shell) command.
|
||||
overrides the global version, and can be overridden itself by setting
|
||||
the `PYENV_VERSION` environment variable or with the `pyenv shell`
|
||||
command.
|
||||
|
||||
$ pyenv local 2.7.6
|
||||
|
||||
@ -97,8 +98,9 @@ This is mainly useful in special cases like provisioning scripts.
|
||||
## `pyenv global`
|
||||
|
||||
Sets the global version of Python to be used in all shells by writing
|
||||
the version name to the `$PYENV_ROOT/version` file. This version can be
|
||||
overridden with [`pyenv local`](#pyenv-local) or [`pyenv shell`](#pyenv-shell).
|
||||
the version name to the `~/.pyenv/version` file. This version can be
|
||||
overridden by an application-specific `.python-version` file, or by
|
||||
setting the `PYENV_VERSION` environment variable.
|
||||
|
||||
$ pyenv global 2.7.6
|
||||
|
||||
@ -234,7 +236,6 @@ Then install the desired versions:
|
||||
You can also install the latest version of Python in a specific version line by supplying a prefix instead of a complete name:
|
||||
|
||||
$ pyenv install 3.10
|
||||
$ pyenv install 3
|
||||
|
||||
See the [`pyenv latest` documentation](#pyenv-latest) for details on prefix resolution.
|
||||
|
||||
@ -242,6 +243,9 @@ An older option is to use the `:latest` syntax. For example, to install the late
|
||||
|
||||
pyenv install 3.8:latest
|
||||
|
||||
To install the latest major release for Python 3 try:
|
||||
|
||||
pyenv install 3:latest
|
||||
|
||||
## `pyenv uninstall`
|
||||
|
||||
@ -348,9 +352,10 @@ locations of the currently selected versions.
|
||||
|
||||
Displays the latest installed or known version with the given prefix
|
||||
|
||||
Usage: pyenv latest [-k|--known] <prefix>
|
||||
Usage: pyenv latest [-k|--known] [-q|--quiet] <prefix>
|
||||
|
||||
-k/--known Select from all known versions instead of installed
|
||||
-q/--quiet Do not print an error message on resolution failure
|
||||
|
||||
Only full prefixes are searched: in the actual name, the given prefix must be followed by a dot or a dash.
|
||||
|
||||
|
||||
@ -407,7 +407,7 @@ of the following commands:
|
||||
|
||||
* [`pyenv shell <version>`](COMMANDS.md#pyenv-shell) -- select just for current shell session
|
||||
* [`pyenv local <version>`](COMMANDS.md#pyenv-local) -- automatically select whenever you are in the current directory (or its subdirectories)
|
||||
* [`pyenv global <version>`](COMMANDS.md#pyenv-global) -- select globally for your user account
|
||||
* [`pyenv global <version>`](COMMANDS.md#pyenv-shell) -- select globally for your user account
|
||||
|
||||
E.g. to select the above-mentioned newly-installed Python 3.10.4 as your preferred version to use:
|
||||
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
# Usage: pyenv commands [--sh|--no-sh]
|
||||
|
||||
set -e
|
||||
[[ -n $PYENV_DEBUG ]] && set -x
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
# Provide pyenv completions
|
||||
if [[ $1 = "--complete" ]]; then
|
||||
if [ "$1" = "--complete" ]; then
|
||||
echo --sh
|
||||
echo --no-sh
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ $1 = "--sh" ]]; then
|
||||
if [ "$1" = "--sh" ]; then
|
||||
sh=1
|
||||
shift
|
||||
elif [[ $1 = "--no-sh" ]]; then
|
||||
elif [ "$1" = "--no-sh" ]; then
|
||||
nosh=1
|
||||
shift
|
||||
fi
|
||||
@ -24,25 +24,20 @@ IFS=: paths=($PATH)
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
{
|
||||
if [[ -n $sh ]]; then
|
||||
for path in "${paths[@]}"; do
|
||||
for command in "${path}"/pyenv-sh-*; do
|
||||
echo "${command##*/pyenv-sh-}"
|
||||
done
|
||||
done
|
||||
else
|
||||
for path in "${paths[@]}"; do
|
||||
for command in "${path}"/pyenv-*; do
|
||||
command="${command##*/pyenv-}"
|
||||
if [[ -n $nosh ]]; then
|
||||
if [[ ${command:0:3} != "sh-" ]]; then
|
||||
echo "$command"
|
||||
fi
|
||||
else
|
||||
{ for path in "${paths[@]}"; do
|
||||
for command in "${path}/pyenv-"*; do
|
||||
command="${command##*pyenv-}"
|
||||
if [ -n "$sh" ]; then
|
||||
if [ "${command:0:3}" = "sh-" ]; then
|
||||
echo "${command##sh-}"
|
||||
fi
|
||||
done
|
||||
elif [ -n "$nosh" ]; then
|
||||
if [ "${command:0:3}" != "sh-" ]; then
|
||||
echo "${command##sh-}"
|
||||
fi
|
||||
else
|
||||
echo "${command##sh-}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
} | sort -u
|
||||
done
|
||||
} | sort | uniq
|
||||
|
||||
@ -112,8 +112,8 @@ else
|
||||
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 multiple"
|
||||
echo " Python versions to be found at the same time."
|
||||
echo "Note: See 'pyenv help global' for tips on allowing both"
|
||||
echo " python2 and python3 to be found."
|
||||
} >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -202,14 +202,7 @@ build_failed() {
|
||||
colorize 33 "Results logged to ${LOG_PATH}"
|
||||
printf "\n\n"
|
||||
echo "Last 10 log lines:"
|
||||
TAIL=`tail -n 10 "$LOG_PATH"`
|
||||
echo "$TAIL"
|
||||
if echo "$TAIL" | grep -q "no acceptable C compiler found"; then
|
||||
printf "\n"
|
||||
echo "Are the build dependencies for Python correctly installed?"
|
||||
echo "Please consult to the Wiki page for more info."
|
||||
echo "https://github.com/pyenv/pyenv/wiki#suggested-build-environment"
|
||||
fi
|
||||
tail -n 10 "$LOG_PATH"
|
||||
fi
|
||||
} >&3
|
||||
exit 1
|
||||
|
||||
@ -68,8 +68,8 @@ pyenv: py.test: command not found
|
||||
The \`py.test' command exists in these Python versions:
|
||||
3.4
|
||||
|
||||
Note: See 'pyenv help global' for tips on allowing multiple
|
||||
Python versions to be found at the same time.
|
||||
Note: See 'pyenv help global' for tips on allowing both
|
||||
python2 and python3 to be found.
|
||||
OUT
|
||||
}
|
||||
|
||||
@ -85,8 +85,8 @@ pyenv: py.test: command not found
|
||||
The \`py.test' command exists in these Python versions:
|
||||
3.4
|
||||
|
||||
Note: See 'pyenv help global' for tips on allowing multiple
|
||||
Python versions to be found at the same time.
|
||||
Note: See 'pyenv help global' for tips on allowing both
|
||||
python2 and python3 to be found.
|
||||
OUT
|
||||
}
|
||||
|
||||
@ -118,8 +118,8 @@ The \`py.test' command exists in these Python versions:
|
||||
3.3
|
||||
3.4
|
||||
|
||||
Note: See 'pyenv help global' for tips on allowing multiple
|
||||
Python versions to be found at the same time.
|
||||
Note: See 'pyenv help global' for tips on allowing both
|
||||
python2 and python3 to be found.
|
||||
OUT
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user