mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-22 21:22:38 +00:00
Use ensurepip to install pip if available
This commit is contained in:
parent
2c26b0870a
commit
558200285b
4 changed files with 39 additions and 38 deletions
|
@ -1051,16 +1051,11 @@ apply_python_patch() {
|
|||
}
|
||||
|
||||
build_package_verify_python() {
|
||||
# Create `python` executable if missing. Especially for Py3k.
|
||||
[ -e "${PYTHON_BIN}" ] || {
|
||||
local python
|
||||
for python in "${PREFIX_PATH}/bin/python"*; do
|
||||
if expr "$(basename "$python")" : '^python[0-9][0-9]*\.[0-9][0-9]*$' 2>&1 >/dev/null; then
|
||||
( cd "${PREFIX_PATH}/bin" && ln -fs "$(basename "$python")" python )
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
local package_name="$1"
|
||||
local python="$2"
|
||||
if [ ! -e "${PREFIX_PATH}/bin/python" ] && [ -e "${PREFIX_PATH}/bin/${python}" ]; then
|
||||
( cd "${PREFIX_PATH}/bin" && ln -fs "${python}" "python" )
|
||||
fi
|
||||
if [ ! -x "${PYTHON_BIN}" ]; then
|
||||
echo "pyenv: invalid Python executable: ${PYTHON_BIN}" >&4 2>&1
|
||||
return 1
|
||||
|
@ -1069,57 +1064,69 @@ build_package_verify_python() {
|
|||
|
||||
# Post-install check for Python 2.4.x
|
||||
build_package_verify_py24() {
|
||||
build_package_verify_python "$@"
|
||||
build_package_verify_readline "$@"
|
||||
build_package_verify_zlib "$@"
|
||||
build_package_verify_bz2 "$@"
|
||||
build_package_verify_python "$1" "${2:-python2.4}"
|
||||
build_package_verify_readline "$1" "${2:-python2.4}"
|
||||
build_package_verify_zlib "$1" "${2:-python2.4}"
|
||||
build_package_verify_bz2 "$1" "${2:-python2.4}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 2.5.x
|
||||
build_package_verify_py25() {
|
||||
build_package_verify_py24 "$@"
|
||||
build_package_verify_sqlite3 "$@"
|
||||
build_package_verify_py24 "$1" "${2:-python2.5}"
|
||||
build_package_verify_sqlite3 "$1" "${2:-python2.5}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 2.6.x
|
||||
build_package_verify_py26() {
|
||||
build_package_verify_py25 "$@"
|
||||
build_package_verify_ssl "$@"
|
||||
build_package_verify_py25 "$1" "${2:-python2.6}"
|
||||
build_package_verify_ssl "$1" "${2:-python2.6}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 2.7.x
|
||||
build_package_verify_py27() {
|
||||
build_package_verify_py26 "$@"
|
||||
build_package_verify_py26 "$1" "${2:-python2.7}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 3.0.x
|
||||
build_package_verify_py30() {
|
||||
build_package_verify_python "$@"
|
||||
build_package_verify_readline "$@"
|
||||
build_package_verify_ssl "$@"
|
||||
build_package_verify_sqlite3 "$@"
|
||||
build_package_verify_zlib "$@"
|
||||
build_package_verify_bz2 "$@"
|
||||
build_package_verify_python "$1" "${2:-python3.0}"
|
||||
build_package_verify_readline "$1" "${2:-python3.0}"
|
||||
build_package_verify_ssl "$1" "${2:-python3.0}"
|
||||
build_package_verify_sqlite3 "$1" "${2:-python3.0}"
|
||||
build_package_verify_zlib "$1" "${2:-python3.0}"
|
||||
build_package_verify_bz2 "$1" "${2:-python3.0}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 3.1.x
|
||||
build_package_verify_py31() {
|
||||
build_package_verify_py30 "$@"
|
||||
build_package_verify_py30 "$1" "${2:-python3.1}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 3.2.x
|
||||
build_package_verify_py32() {
|
||||
build_package_verify_py31 "$@"
|
||||
build_package_verify_py31 "$1" "${2:-python3.2}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 3.3.x
|
||||
build_package_verify_py33() {
|
||||
build_package_verify_py32 "$@"
|
||||
build_package_verify_py32 "$1" "${2:-python3.3}"
|
||||
}
|
||||
|
||||
# Post-install check for Python 3.4.x
|
||||
build_package_verify_py34() {
|
||||
build_package_verify_py33 "$@"
|
||||
build_package_verify_py33 "$1" "${2:-python3.4}"
|
||||
}
|
||||
|
||||
build_package_ensurepip() {
|
||||
{ "$PYTHON_BIN" -m ensurepip
|
||||
} >&4 2>&1
|
||||
|
||||
if [ ! -e "${PREFIX_PATH}/bin/pip" ]; then
|
||||
local pip="$("$PYTHON_BIN" -c 'import sys;v=sys.version_info;sys.stdout.write("pip%d.%d"%(v[0],v[1]))')"
|
||||
if [ -e "${PREFIX_PATH}/bin/${pip}" ]; then
|
||||
( cd "${PREFIX_PATH}/bin" && ln -fs "${pip}" "pip" )
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build_package_verify_import() {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require_cc "gcc" "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
install_hg "Python-3.4-dev" "https://bitbucket.org/mirror/cpython" "default" standard verify_py34
|
||||
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python
|
||||
install_package "pip-1.5" "https://pypi.python.org/packages/source/p/pip/pip-1.5.tar.gz#6969b8a8adc4c7f7c5eb1707118f0686" python
|
||||
install_hg "Python-3.4-dev" "https://bitbucket.org/mirror/cpython" "default" standard verify_py34 ensurepip
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require_cc "gcc" "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
install_package "Python-3.4.0b1" "http://python.org/ftp/python/3.4.0/Python-3.4.0b1.tgz#83143a755b8a29a59026c1fdfb8d18fc" ldflags_dirs standard verify_py34
|
||||
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python
|
||||
install_package "pip-1.5" "https://pypi.python.org/packages/source/p/pip/pip-1.5.tar.gz#6969b8a8adc4c7f7c5eb1707118f0686" python
|
||||
install_package "Python-3.4.0b1" "http://python.org/ftp/python/3.4.0/Python-3.4.0b1.tgz#83143a755b8a29a59026c1fdfb8d18fc" ldflags_dirs standard verify_py34 ensurepip
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
require_cc "gcc" "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
install_package "Python-3.4.0b2" "http://python.org/ftp/python/3.4.0/Python-3.4.0b2.tgz#afe112d6fe595f501f1dcb3627e7b476" ldflags_dirs standard verify_py34
|
||||
install_package "setuptools-2.1" "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#2044725530450d0517393882dc4b7508" python
|
||||
install_package "pip-1.5" "https://pypi.python.org/packages/source/p/pip/pip-1.5.tar.gz#6969b8a8adc4c7f7c5eb1707118f0686" python
|
||||
install_package "Python-3.4.0b2" "http://python.org/ftp/python/3.4.0/Python-3.4.0b2.tgz#afe112d6fe595f501f1dcb3627e7b476" ldflags_dirs standard verify_py34 ensurepip
|
||||
|
|
Loading…
Reference in a new issue