1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 07:13:53 -05:00

Compare commits

...

16 Commits

Author SHA1 Message Date
Yamashita Yuu
1b066598ce v20150524 2015-05-24 10:53:17 +09:00
Yamashita Yuu
cc94ad39f1 Add 2.7.10 (fixes #380) 2015-05-24 10:40:47 +09:00
Daniel Hahler
c754efc44b Merge pull request #378 from blueyed/version-file-read-without-type
pyenv-version-file-read: use sed instead of type/head/awk
2015-05-18 16:37:09 +02:00
Yamashita, Yuu
46ffb0c8df Merge pull request #290 from blueyed/version-handle-missing-better
Improve `pyenv version`, if there is one missing
2015-05-17 12:05:03 +09:00
Yamashita, Yuu
70cce28ba3 Merge pull request #368 from blueyed/pip-rehash-for-versions
pip-rehash: handle versions in commands, like "pip2" and "pip3.4"
2015-05-17 11:35:31 +09:00
Daniel Hahler
9156191168 pyenv-version-file-read: use sed/cut instead of type/head/awk
I was seeing the following occasionally in scripts:

> …/.pyenv/libexec/pyenv-version-file-read: line 12: type: write error: Broken pipe

This patch hopefully improves/fixes this, and it seems better anyway to
just use sed here.
2015-05-16 23:02:00 +02:00
Yamashita, Yuu
5402ce423b Merge pull request #376 from thomasjo/tj-fix-bad-anaconda-urls
Fix broken Anaconda3 2.2.0 URLs
2015-05-12 20:06:11 +09:00
Thomas Johansen
2ea2e7558d Fix broken Anaconda3-2.2.0 URLs 2015-05-12 12:52:41 +02:00
Yamashita, Yuu
9d8da866f1 Merge pull request #375 from kuanyili/anaconda
Add Anaconda/Anaconda3 2.2.0 and Miniconda/Miniconda3 3.9.1 definitions
2015-05-12 07:30:51 +09:00
Kuan-Yi Li
70fa356585 Add Miniconda/Miniconda3 3.9.1 definitions 2015-05-12 01:50:29 +08:00
Kuan-Yi Li
31fb290de2 Add Anaconda/Anaconda3 2.2.0 definitions 2015-05-12 01:19:04 +08:00
Josh Friend
e285f2e5b1 use full path when installing a jar 2015-05-04 10:35:34 -04:00
Josh Friend
1d31529b46 v20150404 2015-05-04 08:25:25 -04:00
Daniel Hahler
481198d255 pip-rehash: handle versions in commands, like "pip2" and "pip3.4"
Fixes https://github.com/yyuu/pyenv/issues/367
2015-04-30 00:49:53 +02:00
Daniel Hahler
e8433cfeb3 Use exitcode from pyenv-version-name in pyenv-version, do not halt 2014-12-11 20:37:03 +01:00
Daniel Hahler
7f88eabd0b Improve pyenv version, if there is one missing
Display the other available ones still.

Fixes https://github.com/yyuu/pyenv/issues/291
2014-12-11 18:49:38 +01:00
18 changed files with 190 additions and 21 deletions

View File

@@ -1,5 +1,19 @@
## Version History
#### 20150524
* pyenv: Improve `pyenv version`, if there is one missing (#290)
* pyenv: Improve pip-rehash to handle versions in command, like `pip2` and `pip3.4` (#368)
* python-build: Add CPython release; 2.7.10 (#380)
* python-build: Add Miniconda/Miniconda3 3.9.1 and Anaconda/Anaconda3 2.2.0 (#375, #376)
#### 20150504
* python-build: Add Jython 2.7.0
* python-build: Add CPython alpha release; 3.5.0a4
* python-build: Add CPython 3.1, 3.1.1, and 3.1.2
* python-build: Fix pip version to 1.5.6 for CPython 3.1.x (#351)
#### 20150326
* python-build: Add Portable PyPy binaries from https://github.com/squeaky-pl/portable-pypy (#329)
@@ -230,7 +244,7 @@
#### 0.4.0-20130726
* pyenv: Fix minor issue of variable scope in `pyenv versions`
* pyenv: Fix minor issue of variable scope in `pyenv versions`
* python-build: Update base version to ruby-build v20130628
* python-build: Use brew managed OpenSSL and GNU Readline if they are available
* python-build: Fix build of CPython 3.3+ on OS X (#29)

View File

@@ -12,7 +12,7 @@
set -e
[ -n "$PYENV_DEBUG" ] && set -x
version="20150326"
version="20150524"
if cd "$PYENV_ROOT" 2>/dev/null; then
git_revision="$(git describe --tags HEAD 2>/dev/null || true)"

View File

@@ -8,10 +8,13 @@
set -e
[ -n "$PYENV_DEBUG" ] && set -x
exitcode=0
OLDIFS="$IFS"
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name))
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name)) || exitcode=$?
IFS="$OLDIFS"
for PYENV_VERSION_NAME in "${PYENV_VERSION_NAMES[@]}"; do
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
done
exit $exitcode

View File

@@ -9,7 +9,7 @@ if [ -e "$VERSION_FILE" ]; then
# Read the first non-whitespace word from the specified version file.
# Be careful not to load it whole in case there's something crazy in it.
IFS="${IFS}"$'\r'
words=( $(cut -b 1-1024 "$VERSION_FILE" | $(type -p gawk awk | head -1) '{ print($1) }') )
words=($(cut -b 1-1024 "$VERSION_FILE" | sed 's/^\s*\(\S\+\).*/\1/'))
versions=("${words[@]}")
if [ -n "$versions" ]; then

View File

@@ -21,6 +21,7 @@ version_exists() {
versions=()
OLDIFS="$IFS"
{ IFS=:
any_not_installed=0
for version in ${PYENV_VERSION}; do
if version_exists "$version" || [ "$version" = "system" ]; then
versions=("${versions[@]}" "${version}")
@@ -28,7 +29,7 @@ OLDIFS="$IFS"
versions=("${versions[@]}" "${version#python-}")
else
echo "pyenv: version \`$version' is not installed" >&2
exit 1
any_not_installed=1
fi
done
}
@@ -39,3 +40,7 @@ OLDIFS="$IFS"
echo "${versions[*]}"
}
IFS="$OLDIFS"
if [ "$any_not_installed" = 1 ]; then
exit 1
fi

View File

@@ -534,7 +534,9 @@ fetch_jar() {
download_tarball "$package_url" "$package_filename" "$checksum"
fi
{ if $JAVA -jar ${package_name}.jar -s -d ${package_name}; then
# Must use full path to jar and destination directory:
# http://bugs.jython.org/issue2350
{ if $JAVA -jar $PWD/${package_name}.jar -s -d $PWD/${package_name}; then
if [ -z "$KEEP_BUILD_PATH" ]; then
rm -f "$package_filename"
else

View File

@@ -0,0 +1,3 @@
#require_gcc
install_package "readline-6.3" "http://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline
install_package "Python-2.7.10" "https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz#eda8ce6eec03e74991abb5384170e7c65fcd7522e409b8e83d7e6372add0f12a" ldflags_dirs standard verify_py27 ensurepip

View File

@@ -0,0 +1,19 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-x86" )
install_script "Anaconda-2.2.0-Linux-x86" "http://repo.continuum.io/archive/Anaconda-2.2.0-Linux-x86.sh#6437d5b08a19c3501f2f5dc3ae1ae16f91adf6bed0f067ef0806a9911b1bef15" "anaconda" verify_py27
;;
"Linux-x86_64" )
install_script "Anaconda-2.2.0-Linux-x86_64" "http://repo.continuum.io/archive/Anaconda-2.2.0-Linux-x86_64.sh#ca2582cb2188073b0f348ad42207211a2b85c10b244265b5b27bab04481b88a2" "anaconda" verify_py27
;;
"MacOSX-x86_64" )
install_script "Anaconda-2.2.0-MacOSX-x86_64" "http://repo.continuum.io/archive/Anaconda-2.2.0-MacOSX-x86_64.sh#20570e2f3911e38a78d8f888f3ff445d6c0cf97a2fca40d6956b48d12aaef339" "anaconda" verify_py27
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of Anaconda is not available for $(anaconda_architecture 2>/dev/null || true)."
echo
} >&2
exit 1
;;
esac

View File

@@ -0,0 +1,19 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-x86" )
install_script "Anaconda3-2.2.0-Linux-x86" "http://repo.continuum.io/archive/Anaconda3-2.2.0-Linux-x86.sh#223655cd256aa912dfc83ab24570e47bb3808bc3b0c6bd21b5db0fcf2750883e" "anaconda" verify_py34
;;
"Linux-x86_64" )
install_script "Anaconda3-2.2.0-Linux-x86_64" "http://repo.continuum.io/archive/Anaconda3-2.2.0-Linux-x86_64.sh#4aac68743e7706adb93f042f970373a6e7e087dbf4b02ac467c94ca4ce33d2d1" "anaconda" verify_py34
;;
"MacOSX-x86_64" )
install_script "Anaconda3-2.2.0-MacOSX-x86_64" "http://repo.continuum.io/archive/Anaconda3-2.2.0-MacOSX-x86_64.sh#81a2089ea6127717f146454e99ea0be2bd595193e4151bb05b4c15749b1d8124" "anaconda" verify_py34
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of Anaconda3 is not available for $(anaconda_architecture 2>/dev/null || true)."
echo
} >&2
exit 1
;;
esac

View File

@@ -1,15 +1,6 @@
require_java
install_jar "jython-2.7.0" "https://repo1.maven.org/maven2/org/python/jython-installer/2.7.0/jython-installer-2.7.0.jar#b44352ece72382268a60e2848741c96609a91d796bb9a9c6ebeff62f0c12c9cf" jython
# Jython is supposed to install pip using ensurepip by default, but this does
# not appear to be working so we do it manually.
#
# pyenv's `ensurepip` downloads `get-pip.py` which isnt currently compatible
# with jython: http://bugs.jython.org/issue2302
#
# Use the ensurepip module in jython to install the bundled pip instead:
"$PYTHON_BIN" -m ensurepip
case "$(pypy_architecture 2>/dev/null || true)" in
"osx64"|"win32" )
# Jython does not seem to work properly on OSX/windows unless JAVA_HOME is set

View File

@@ -0,0 +1,19 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-x86" )
install_script "Miniconda-3.9.1-Linux-x86" "http://repo.continuum.io/miniconda/Miniconda-3.9.1-Linux-x86.sh#f3cdc8d774acce05462eb07d2676162c519e1e5d35c98d1dc3d6eb7b262da0b2" "miniconda" verify_py27
;;
"Linux-x86_64" )
install_script "Miniconda-3.9.1-Linux-x86_64" "http://repo.continuum.io/miniconda/Miniconda-3.9.1-Linux-x86_64.sh#64f2b5047f944bb9b06e46c7281e9edffd412981c93e31d4c111287a1d30fef4" "miniconda" verify_py27
;;
"MacOSX-x86_64" )
install_script "Miniconda-3.9.1-MacOSX-x86_64" "http://repo.continuum.io/miniconda/Miniconda-3.9.1-MacOSX-x86_64.sh#ea529626cfb3519eebee83c40965f0a58375e0826c6777b759eb0c42ca9970d2" "miniconda" verify_py27
;;
* )
{ 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,19 @@
case "$(anaconda_architecture 2>/dev/null || true)" in
"Linux-x86" )
install_script "Miniconda3-3.9.1-Linux-x86" "http://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86.sh#1a9f8abfc63080c2d764039335a24465388533cca86472224c994ed8d32c4d48" "miniconda" verify_py34
;;
"Linux-x86_64" )
install_script "Miniconda3-3.9.1-Linux-x86_64" "http://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86_64.sh#6c6b44acdd0bc4229377ee10d52c8ac6160c336d9cdd669db7371aa9344e1ac3" "miniconda" verify_py34
;;
"MacOSX-x86_64" )
install_script "Miniconda3-3.9.1-MacOSX-x86_64" "http://repo.continuum.io/miniconda/Miniconda3-3.9.1-MacOSX-x86_64.sh#e32523e3fdf0addab008e816c54eb6ae6eb6d62b1122d1e0dc4f4313a97b0591" "miniconda" verify_py34
;;
* )
{ 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

@@ -1,5 +1,13 @@
PYENV_PIP_REHASH_ROOT="${BASH_SOURCE[0]%/*}/pip-rehash"
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_COMMAND##*/}" ]; then
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/${PYENV_COMMAND##*/}"
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}"
PYENV_REHASH_COMMAND="${PYENV_COMMAND##*/}"
# Remove any version information, from e.g. "pip2" or "pip3.4".
if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.\d)?$ ]]; then
PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}"
fi
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND}" ]; then
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND##*/}"
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}"
export PYENV_REHASH_REAL_COMMAND="${PYENV_COMMAND##*/}"
fi

View File

@@ -11,7 +11,7 @@ _PATH="${_PATH#:}"
_PATH="${_PATH%:}"
PATH="${_PATH}"
PYENV_COMMAND_PATH="$(pyenv-which "$(basename "$0")")"
PYENV_COMMAND_PATH="$(pyenv-which "${PYENV_REHASH_REAL_COMMAND}")"
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
export PATH="${PYENV_BIN_PATH}:${PATH}"

View File

@@ -11,7 +11,7 @@ _PATH="${_PATH#:}"
_PATH="${_PATH%:}"
PATH="${_PATH}"
PYENV_COMMAND_PATH="$(pyenv-which "$(basename "$0")")"
PYENV_COMMAND_PATH="$(pyenv-which "${PYENV_REHASH_REAL_COMMAND}")"
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
export PATH="${PYENV_BIN_PATH}:${PATH}"

View File

@@ -5,7 +5,7 @@ load test_helper
@test "blank invocation" {
run pyenv
assert_success
assert [ "${lines[0]}" == "pyenv 20150326" ]
assert [ "${lines[0]}" == "pyenv 20150524" ]
}
@test "invalid command" {

View File

@@ -52,6 +52,39 @@ setup() {
assert_failure "pyenv: version \`1.2' is not installed"
}
@test "one missing version (second missing)" {
create_version "3.4.2"
PYENV_VERSION="3.4.2:1.2" run pyenv-version-name
assert_failure
assert_output <<OUT
pyenv: version \`1.2' is not installed
3.4.2
OUT
}
@test "one missing version (first missing)" {
create_version "3.4.2"
PYENV_VERSION="1.2:3.4.2" run pyenv-version-name
assert_failure
assert_output <<OUT
pyenv: version \`1.2' is not installed
3.4.2
OUT
}
pyenv-version-name-without-stderr() {
pyenv-version-name 2>/dev/null
}
@test "one missing version (without stderr)" {
create_version "3.4.2"
PYENV_VERSION="1.2:3.4.2" run pyenv-version-name-without-stderr
assert_failure
assert_output <<OUT
3.4.2
OUT
}
@test "version with prefix in name" {
create_version "2.7.6"
cat > ".python-version" <<<"python-2.7.6"

View File

@@ -36,3 +36,37 @@ setup() {
run pyenv-version
assert_success "3.3.3 (set by ${PYENV_ROOT}/version)"
}
@test "set by PYENV_VERSION, one missing" {
create_version "3.3.3"
PYENV_VERSION=3.3.3:1.2 run pyenv-version
assert_failure
assert_output <<OUT
pyenv: version \`1.2' is not installed
3.3.3 (set by PYENV_VERSION environment variable)
OUT
}
@test "set by PYENV_VERSION, two missing" {
create_version "3.3.3"
PYENV_VERSION=3.4.2:3.3.3:1.2 run pyenv-version
assert_failure
assert_output <<OUT
pyenv: version \`3.4.2' is not installed
pyenv: version \`1.2' is not installed
3.3.3 (set by PYENV_VERSION environment variable)
OUT
}
pyenv-version-without-stderr() {
pyenv-version 2>/dev/null
}
@test "set by PYENV_VERSION, one missing (stderr filtered)" {
create_version "3.3.3"
PYENV_VERSION=3.4.2:3.3.3 run pyenv-version-without-stderr
assert_failure
assert_output <<OUT
3.3.3 (set by PYENV_VERSION environment variable)
OUT
}